Freedom LOST at Software Freedom Day!
6:27pm, September 19th, 2006
Have you ever wondered why instance methods in java are virtual by default and in C# not? In C# to make a method virtual you have to explicitly do it right? Why is that?
I think better to ask from creator of the C# language. :)
So this is what Anders Hejlsberg says:
There are several reasons. One is performance. We can observe that as people write code in Java, they forget to mark their methods final. Therefore, those methods are virtual. Because they're virtual, they don't perform as well. There's just performance overhead associated with being a virtual method. That's one issue.
A more important issue is versioning. There are two schools of thought about virtual methods. The academic school of thought says, "Everything should be virtual, because I might want to override it someday." The pragmatic school of thought, which comes from building real applications that run in the real world, says, "We've got to be real careful about what we make virtual."
When we make something virtual in a platform, we're making an awful lot of promises about how it evolves in the future. For a non-virtual method, we promise that when you call this method, x and y will happen. When we publish a virtual method in an API, we not only promise that when you call this method, x and y will happen. We also promise that when you override this method, we will call it in this particular sequence with regard to these other ones and the state will be in this and that invariant.
Every time you say virtual in an API, you are creating a call back hook. As an OS or API framework designer, you've got to be real careful about that. You don't want users overriding and hooking at any arbitrary point in an API, because you cannot necessarily make those promises. And people may not fully understand the promises they are making when they make something virtual. more...
3:38pm, September 17th, 2006
9:18am, September 14th, 2006
last week my project manager asked me to do training for our colleagues on Unit testing with Nunit. So I thought better to use VS 2005 with new inbuilt unit testing capabilities. I had installed VS Professional edition and I knew that Unit testing is not coming with that edition. I knew that we have VS team edition for architects also and I installed it. But after I installed it I couldn’t found built-in unit testing there. I thought this may be an installation problem or I haven’t to configure VS for unit testing. So I played some times with IDE’s configuration settings but didn’t succeed. (Anyway I found another interesting setting that always shows you the solution in Visual Studio Team Edition for Software Architects like in other editions(I know professional edition does). Otherwise it won’t show you the solution just after you add a project. Damn... I don’t know why VS team came up with this kinda default setting.)
I tried googling but didn’t come with a solution. But some times later my friend Prasanna told me that VS team edition for architects doesn’t contains inbuilt unit testing. What’s the …. Seems like architects don’t won’t to know abt unit testing. (hay I’m not a architect right… just installed the edition what we have)
Prass send me this link which compares all Visual Studio Editions. Thx man.
http://msdn.microsoft.com/vstudio/teamsystem/products/compare/default.aspx
Seems like we have to go for the Team Suite. But I don’t think its worth to go for since we have kinda inbuilt process following and using good source control system too. We are using perforce for source control management. It works great.
8:35am, September 14th, 2006
“Yesterday it still worked and now it doesn't anymore, what did happen?"
"Why does it work on this computer and not on another one?"
I bet you have heard this before from your colleagues or may be you have yelled like this. :)
Anyway read this nice document from Hans De Smaele and try to reduce no of times you will hear this. But I’m death sure it wouldn’t be eliminated. :)
http://www.microsoft.com/belux/msdn/nl/community/articles/feb05_applicationdebugging.mspx
8:34pm, September 13th, 2006
Today I did a presentation on DAO pattern (Data Access Objects) for the Sri Lanka .net community at Microsoft Sri Lanka office. This was my first public presentation even though I have done presentations for my colleagues and have trained them. Actually this was a new experience to me. I don’t happy with my presentation skills there today but I think I can improve quickly as I have always done. Anyway my friends commented me as it’s a good one but how can I trust them since they are my close friends. :D Anyway I learned a lot from doing this and try to do better in future. I would like to say thanks to all my friends who encourage me to do this presentation including Dinesh, Wella, Ludmal, Chandana, Charith, AsankaM etc… There are lots more. :D I'm very proud of that I have lots of great friends.
Since my topic is bit advance and new to lots of developers who haven’t involving in application deign and architecture they might felt in little difficulty in understanding. There is no time to explain some related patterns and technologies in detail there.
Ok, anyone who doesn’t know about DAO pattern just checks this out. This is the blue print of the pattern from Java world (Sun). Anyway my implementation has little bit changes to fit in to my scenario.
http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
1:43pm, September 6th, 2006
6:23am, September 1st, 2006