02 April 2012

Effective C#

Now that I own the c++ coding standards book, I also want to buy the Effective C++ book by Scott Meyers. I also already read it at Larian front to back and I know its worth.

But since I'm currently developing more in C# I thought I'd look for similar quality books about that language. I just ordered Effective C# by Bill Wagner and I hope it's as good as the C++ books.

While looking for it, I also found this code project article that has the same title. It offers some tips but unfortunately without explaining why the tips apply. But at least I learned some small ideas that I can use in the future:

  • I can write strings with an @ in front and then I don't have to worry about double backslashes to have a single backslash in my path.
  • I really should start using stringbuilders, I know I have to use them but the only time I want to concatenate strings is when I want to have some debugging output. I'm too lazy to create stringbuilders at that time and since they're only executed in debug mode I don't want to bother with them. But when I do concatenate strings in release, I should use stringbuilders, let's do that from now on.
  • Let's look into ngen
  • Wow, 'checked', handy keyword!

    And concerning the 'for' versus 'foreach' discussion: I want to delve more deeply into that because let's face it, foreach is soooo easy to use that I do not want to ditch it just because it would be a little less efficient. I want to know for sure that's the case and when that's the case. I hope my new book (arriving in 2-3 days) will provide me with an answer.
  • No comments: