Posts
67
Comments
120
Trackbacks
0
February 2012 Entries
C# to C++–A Somewhat Short Guide (Update 1)

Last updated: 2012-02-14

This is a big post – over 12200 16600 words – and so I’ve decided to make it available as a PDF download, which you can get here:

http://www.bobtacoindustries.com/Content/Devs/CsToCpp-ASomewhatShortGuide.pdf

It has bookmarks for easier navigation along with a Table of Contents and page numbers.

I expect that I will revise this from time to time and welcome any suggestions, feedback, and (especially) corrections. If so I will update the Last updated field at the top and will create a revised PDF as well. I hope this proves useful.

Update: I realized when looking at stats the other day that this post was so big that it wasn’t going through to many people’s RSS feeds (including my own!). So I stripped out the text and have decided just to keep it as a PDF link.

Updates and Changes:

2012-02-14

New sections:

  • Namespaces
  • enums subheading under Fundamental types
  • Functions
  • A brief word on the volatile keyword
  • Casting values
  • nullptr subheading under Pointers
  • Lambda expressions

Significant changes:

  • Added discussion of cstdint header to Fundamental types
  • Touched up some language and added a brief note on “mixins” to Multiple inheritance
  • Added subheadings to C++ constructors; also revised its code sample
  • Added a note about non-string uses of the ‘char’ type to Strings

There were many other miscellaneous edits made. I incorporated much of the great feedback I’ve received in the comments. I did not end up moving the Pointers section this time but have not ruled it out either. I’m on the fence about it because, to me, modern C++ is all about clean, safe code with automatic storage duration objects and C++ Standard Library container types. Pointers are still a part of C++ and likely always will be. But I’m not convinced that they belong right up front. I need to re-read the document through from beginning to end before I make a decision on that, I guess.

Most of the things I wanted to add this time around are in the document now. I’m considering a section on multi-threading but that will have to wait for another update. Once VS11’s ranged for loop support is released, I’ll be adding a section on that. I would like to make the templates discussion a lot more in depth at some point but that’s something for another time.

The link above has not changed; the new version is there now and has subsumed the old one. I’ll be posting this as a new blog post as well so if you see it twice, that’s why.

Posted On Tuesday, February 14, 2012 1:52 PM | Comments (0)
Going Native 2012 sessions available for download and streaming

If you missed it, you can now download or stream (whichever you prefer) the sessions from the Going Native 2012 conference. I watched the whole thing and it was fascinating. If you’re new to C++, then some of the sessions are likely to be at a higher level than you may be ready for (though you can certainly watch them if you like). But there are some sessions I think any C++ developer would profit from watching. These are they:

Day 1:

Bjarne Stroustrup - C++11 Style

Stephan T. Lavavej - STL11 – Magic && Secrets

Panel - The Importance of Being Native

Day 2:

Herb Sutter - C++11, VC++11 and Beyond

Chandler Carruth - Clang - Defending C++ from Murphy's Million Monkeys

Panel- Ask Us Anything!

If you are planning to do any multi-threading, then I’d definitely recommend watching Hans Boehm - Threads and Shared Variables in C++11 . For Metro style development, I’d generally recommend using the Parallel Patterns Library (PPL) and the Concurrent Runtime (ConcRT) as they mesh nicely with WinRT’s asynchrony.

Andrei Alexandrescu is a great speaker and his sessions are really entertaining and informative. But it’s likely to be a little while before variadic templates appear in VC++11 (post-RTM but likely in an out-of-band release rather than waiting for VS11 SP1) and they are a pretty tricky topic and the concept of “static if” is a proposal for a future version of the C++ language (but an interesting one and so I’d definitely say go watch it if you have time). They are interesting sessions but not really things for beginners.

Bjarne Stroustrup and Andrew Sutton’s session entitled “A Concept Design for C++” is also interesting but is something that’s still in the research phase of development. It had been proposed for C++11 but was dropped because (as I understand it) they didn’t feel that it was ready to be included in the standard just yet. (This is an area where I personally think C++ could take a lesson from C#. I think C++ would benefit a lot from a purely abstract type (something similar to if not the same as C#’s interface type) with its own keyword designating it as such (thereby adding developer-friendly guarantees that the type was abstract and thus removing the need to use multiple class inheritance for such reasons). This in turn would open the door to a mechanism for templates that would be similar to C#’s constraint system for C# generics. Maybe there are good reasons not to do this; I’m not a language designer. But from an outsider’s perspective, I think C# got this one right.)

Posted On Tuesday, February 7, 2012 10:27 PM | Comments (0)
C# to C++ – A Somewhat Short Guide

Last updated: 2012-02-14

This is a big post – over 12200 16600 words – and so I’ve decided to make it available as a PDF download, which you can get here:

http://www.bobtacoindustries.com/Content/Devs/CsToCpp-ASomewhatShortGuide.pdf

It has bookmarks for easier navigation along with a Table of Contents and page numbers.

I expect that I will revise this from time to time and welcome any suggestions, feedback, and (especially) corrections. If so I will update the Last updated field at the top and will create a revised PDF as well. I hope this proves useful.

Update: I realized when looking at stats the other day that this post was so big that it wasn’t going through to many people’s RSS feeds (including my own!). So I stripped out the text and have decided just to keep it as a PDF link.

Updates and Changes:

2012-02-14

New sections:

  • Namespaces
  • enums subheading under Fundamental types
  • Functions
  • A brief word on the volatile keyword
  • Casting values
  • nullptr subheading under Pointers
  • Lambda expressions

Significant changes:

  • Added discussion of cstdint header to Fundamental types
  • Touched up some language and added a brief note on “mixins” to Multiple inheritance
  • Added subheadings to C++ constructors; also revised its code sample
  • Added a note about non-string uses of the ‘char’ type to Strings

There were many other miscellaneous edits made. I incorporated much of the great feedback I’ve received in the comments. I did not end up moving the Pointers section this time but have not ruled it out either. I’m on the fence about it because, to me, modern C++ is all about clean, safe code with automatic storage duration objects and C++ Standard Library container types. Pointers are still a part of C++ and likely always will be. But I’m not convinced that they belong right up front. I need to re-read the document through from beginning to end before I make a decision on that, I guess.

Most of the things I wanted to add this time around are in the document now. I’m considering a section on multi-threading but that will have to wait for another update. Once VS11’s ranged for loop support is released, I’ll be adding a section on that. I would like to make the templates discussion a lot more in depth at some point but that’s something for another time.

The link above has not changed; the new version is there now and has subsumed the old one. I’ll be posting this as a new blog post as well so if you see it twice, that’s why.

Posted On Thursday, February 2, 2012 8:45 AM | Comments (10)
Bob Taco Industries is an ISV focused on game and app development for Microsoft platforms headed up by Michael B. McLaughlin. Mike is a Microsoft Visual C++ MVP (previously an XNA/DirectX MVP from 2011-2013), a developer, a writer, a consultant, and a retired lawyer. If you're a developer who is just getting started, consider checking out the BTI website's section for developers for links to code samples and other helpful sites.
Tag Cloud