Learning C# at the moment. Can't say I hate it too much,,,
short x = 2;
short y = 2;
// short z = x + y; -- won't compile
short z = (short) x + y // correct
This makes me laugh though. While x and y are both shorts, the result of their addition at runtime will implicitly be given the type int, and so requires an explicit cast to be assigned to another short. I understand nobody really
needs to be working with shorts in C#, and if memory efficiency at that level is something you're worried about, then the bloat from the C# runtime will eat up way more memory that you'll be "saving" by using shorts instead of a 32bit or 64bit number. Still though, this makes me chuckle.
Can't say I dislike the language itself so far honestly; though I prefer a lower level language. While easy to learn and work with, it's no fun at all. The biggest drawback for me being that it's primarily a language used on windows. Who the fuck wants to use, develop for, or (god forbid) develop on windows?
Anyone else have thoughts / opinions / horror stories or just quirky anecdotes relating to C#?