|
![](/i/fill.gif) |
As with any language, my WTF list:
- Unsigned integers have names prefixed with "u", and signed integers
have no prefix. Except byte, which is the other way around: "byte" and
"sbyte". WTF?
- The "char" type works with Unicode. Well done. Oh, but wait... It only
stores 16 bits, and yet Unicode actually requires 24 bits to represent a
single code-point. So this "Unicode character" only actually covers the
Basic Multilingual Plane. FAIL!
- "As of C# 2.0, it is also possible to have an array in a structure."
(Erm, why the HELL would it not be possible to do that before??)
- "x & y" performs a Boolean-OR if the arguments are Bools, and a
bitwise-OR if they are integers. The same goes for all the other logical
operators. Except NOT, which has "!x" for Bools and "~x" for integers. WTF?
- "x + y" performs addition. Unless either argument is a string, in
which case the other is converted to a string as well (if not a string
already) and the strings are concatenated. Unless both arguments are
delegates, in which case they are concatenated. (I guess there's a
/reason/ the Java guys claim that operator overloading is evil!)
- Goto? Seriously? Well, I suppose /technically/ that's not actually a
WTF...
- Anonymous delegates /and/ lambda functions?
- A delegate is a thing which is called when an event is fired, but an
event /is/ a delegate?? (In fairness, this is probably a Wikibooks WTF
rather than anything to do with the design of C#.)
- Extension methods. Just... what??
- A non-generic queue is called Queue, and a generic queue is called
Queue<T>. And yet, for the other container types, the generic and
non-generic versions have completely different, unrelated names. (I
guess that's backwards compatibility for you... oh, wait.)
Post a reply to this message
|
![](/i/fill.gif) |