I thought I would finally take the plunge and start reading that mammoth book on C# and .net 3.5 that I bought ages ago.
Phew, there is a lot to go over but I have found a few things that sound great and a few things that really concern me.
- Good: No more worrying about Unicode and 64 bit. From what I have read its all Unicode under the hood and the runtime chooses 64 or 32 bit depending on the OS so you dont have to worry about it.
- Bad: No optional parameters on method calls. WHAT, I was soooo shocked that this wasnt available, are we back to VB days … it appears so. However I have read that .net 4 does have support for optional parameters but what worries me is that I had presumed that this sort of basic thing was a given, so what else am I presuming?
- Bad: ByRef/ByValue confusion. Now this is something I am totally confused about, it feels like VB where some things are passed by reference and others by value; unless you have read the documentation and thoroughly understand and remember things then you just won’t know. But then you are totally screwed if you have ValueTypes and ReferenceTypes embedded within each other, you just cannot presume any sort of basic understanding of what might happen without a full understanding of any objects you are using. For example, a struct is a ValueType and is passed by value unless you explicitly use the ref keyword, whereas a class is a ReferenceType and is allocated on the heap and is always by reference
- Bad: No implicit stack/heap allocation. Things are done automatically for you so you do not have to worry; but what if you want to do things like allocate a number on the heap, well tough thats just too advanced for your little brain, sorry! This is where I have the biggest problem; with C/C++ you just always knew what was gonna happen, everything was on the stack and went out of scope unless you allocated it on the heap with new; now in C# new doesn’t do anything but call the default constructor on the object and any embedded objects (huh), why bother with that, why not do that by default and do away with new altogether … I am clearly misunderstanding something here
- Good: I like the way you can define the type of an enum, whether its a Byte or an Int32 (by default), this is useful for serialisation; I also like the way you can find out the ‘string’ representation of any type value.
- Good: I like the way you can use int and it will always be an Int32 on all OS’s and languages that support .net; long will always be an Int64 where the OS supports it (e.g. not on embedded devices)
I will carry on reading and learning and see what other things are thrown up … hopefully I will be corrected on the above as I find out more.



