Thursday, August 21, 2008

Write once run everywhere, eh??

Writing a desktop application in Java means dreaming of an application that we wish will run on any platform. One "fatal" mistake that I saw today, i.e. assuming that the file separator is "\", guess on which platform the application was developed.

To avoid this kind of mistake, simply use File.pathSeparator instead of hardcoding "\" in the code.

Thread, if we playing around with thread, make sure that your threads won't cause any deadlock, if it run in windows, don't you ever believe 100% that it will run in *nix. Each os has different way of scheduling threads, so beware.

Drawing on canvas, handling mouse events, creating custom component, if your code does this, test it on all platforms before you claim that it runs everywhere (at least windows, linux, mac).


It seems the dream of having an application which runs anywhere is not yet fully realized. But still I'm grateful for what Java provides now and will look for the realization of the dream.

Thursday, August 07, 2008

Quantity Always Trumps Quality

I hate to say it but I got to admit that this article has a good argument. I always think that quality is more important than quantity, for example in coding. But I have to admit, only by experience that your quality will be improved.

Mind that. No practice, no improvement on quality :)

Tuesday, August 05, 2008

I don't believe in a framework unless I got the source

As the title said, I don't believe in a framework unless I got the source. The sole reason is the source code is my pass out of trouble (though sometimes it doesn't).

Consider this, you're picking out a framework and after some research you decide to use it in your project. Everybody happy until some weird things happen, you've follow all the procedures still you got this weird things hampering you.

No code = no explanation = hoping that somebody out there also experience this and have their way out so that you could follow them and hopefully your problem will be solved too... finger crossed.

I hope now you know what I mean with having the source code is my pass out of this kind of weird behavior.



Note : I just involved in .NET development, strange errors occurred and it's difficult to reproduce (it is there, 100%!!!). Staring at the code, don't know what is really going on, all that I could do is googling and trying to find a workaround.