Sunday, October 30, 2005

Feel My presence :)

So finally i m glad to release my own website... was waiting for years to this. check this out:

Do tell me if any of you guys reading this find an error of a silly mistake... Jorge already pointed out that the w3c validator gives 7 standard errors... i'll fix them as soon as google fixes its 40 errors :)...

and yes am blogging after a week or so... i was really busy last few weeks with my mid terms. I went through the whole of Jeff Prosise and am pretty comfortable with C#.Net now.... though i have a million reasons to hate it. As all you guys would me knowing that C# is a derivative of Java, MS have crossed all the limits to make it look better. I call that over engineering.
They have introduced a feature called Boxing. People who have used java would be knowing that you cant simply use primitive datatype in conjunction with collections. eg. u cannot put an int in a HashMap, one needs to box int to Integer before doing the required stuff. C# has a work-around. It automatically boxes the primitive datatypes into objects.

Now for total newbies that might seem like a wonderful stuff but the consequences of this thing are really wicked. Now suppose i am making a multithreaded application and i want to give shared access to some stuff, say i want to lock on a variable

int i;
am doing stuffs really kewl;

this mechanism in C# is really easy and awesome, anyone who has worked with barebones C would agree to that. Now under the hood the CLR (common language runtime...just like jvm for java) is creating an object which boxes i. If the code was locking on some object like a System.Collection.Queue object then there wouldn't have been any problem. Now in above case if another thread tries to do the same thing the CLR reboxes i into a different object. So there will be no run time or compile time errors. Undercovers the threads are blocking on different objects but developer thinks that they are locked on same object. Java 1.4 with no autoboxing would have given me an error if i would have tried to lock on datatype but C# thinks that it is a lot intelligent than the coders. In short a slight mistake and there will be no synchronization between the threads.... resulting in hard to debug code and crappy race conditions which show up magically at sometime. Ya and by the way i can tell u about delegates too, which are hell lot similar to Qt signal and slots....aaah but i wont explain its pitholes...go learn C# urself :)

Jorge told me that Java5 is incorporating autoboxing!!! what is the world comming to???


  1. Is it me, or free webhosting has existed since the dawn of time? How come you didn't have a website before?
    I created a few personal sites back in the day, but I always ended up neglecting them and throwing them to the trash. In the end they were just ways for me to learn HTML and Flash and stuff. Oh well, blogging's good enough for me ;).

  2. Hey i never said i din create websites... i did a official business page for dad (on cjb) but somehow never got time to create a homepage... i mean i just wanted it to be perfect... and the iteration process never ended so the sites never left my pc to the web server