Archive for January, 2008

Learn your history before you present yourself as an authority

Wednesday, January 2nd, 2008

When you read a book about something, you should be able to safely presume that the author is somewhat of an authority on the subject matter of the book. So when reading an e-book on C#, I was surprised to come across the following Author’s Note:

Author’s Note: struct is not a new concept. In C++, the struct is another way of defining a class (why?). Even though most of the time C++ developers use struct for lightweight objects holding just data, the C++ compiler does not impose this.

I find it interesting that the author of a C# programming book has to ask why “struct is another way of defining a class.” Tip: some things were done for backward compatibility and to make it easier to work with older code. Not to mention that in C++ there actually is a (small) difference between struct and class.