19 Jul 2004 TazForEver   » (Journeyer)

About C# reflexion
I'm really disapointed about C# reflection.

If you want to retrieve the type, i.e System.Type, of a class, you have to use the typeof operator :
System.Type st = typeof(Stack);

But if you want to retrieve the type of an object, you have to use object::GetType().
System.Type st = my_stack.GetType();

This sucks so much ... why typeof can't be applied to an object ? and this ugly method call makes me crazy ... all the C# API is full of these shits, it seems that may be half of the ยต$ hackers were not aware of properties. And guess what, object::GetType() is overloaded ... We're so far from python __class__ attribute :

This is a very bad design : it would have been too easy to extend the typeof operator and put everything else in System.Reflection ... i really can't understand why they did this. Even if i think C# is a bit better than Java, it just sucks. I hate these languages that are designed in 6 months... i can't understand ...

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!