Wednesday, March 23, 2005

Code generation and partial classes

The world isn't a level playing field.

If you are a vendor providing tools with code generation in Java(and probably some other languages too) then the problem of regenerating code without overwriting the users changes is something you have to take into account. A lot of tools solve the problem by putting markers in comments around the parts of the code that they are interested in and allow changes only to parts outside the markers. If the user wants he can remove the markers and the tool will skip regeneration of those parts. Overall every cursed tool developer ends up writing his own thing and the markers make the code less readable. One way to work around is probably by inheriting the generated class and putting all user added code in the subclass. However this can have performance implications and can also lead to encapsulation breakage.

However, if you are Microsoft where you control both the programming languages and the tools you end up solving the problem by introducing partial types/classes in the language specification, thus taking away the need for the user to edit the generated file at all. With partial classes the tool is happy emitting code in one file and the user is happy coding away in another.

So ye SUN and JCP gods please shower us with your partial blessings :)

This post also has similar comments.

Tuesday, March 22, 2005

Flux

I got the below mail from Sudeep who used to be a college senior and is now pursuing a PhD in Algorithms at IITB.
check out my partner sreejitha's blog at
http://kinginistar.blogspot.com

This message was sent by Sudeep KS to friends.
The blog link sent by him is interesting and the thoughts expressed in it are probably in the realm of the abnormal as is also procliamed in one of the posts "Responsibility and Society". Can't link to it directly since permalinks seem to be absent so you will have to search it up in here.

Monday, March 07, 2005

Jackwa and Jillwa

A friend sent this today :D

Jackwa aur Jillwa
Gaye upar Hillwa
Paani bhari ke waaste...

Jackwa gir gawa
Uka khopdiya phoot gawa
Aur Jillwa awat ludkan pooore raaste..

"Uka khopadiya phoot gawa" is my favourite line :)