Archive for February, 2007

A Few Words on Synth

Friday, February 23rd, 2007

If you are into heavy server-side development, you probably do not pay much attention at other Java features, such as GUI. However, I like to dig everything around this great language and the platform. Some time ago, I came across “Synth” thing in Java. This is a way to customize and change look’n feel of your Swing application with no ugly code tweaks, but with a single XML file, which is great for designers and other not-programming folks.

I played with it for some time, came across some hard to find and fix issues, read about exciting and promising Synth features in JDK 6 and left it for the future.

The future is now but still there is not so much information on the subject and that is surprising. With the ‘new’ JDK 6, I hoped there would be more information, more tutorials; people would start looking at it. However, unfortunately the only information about Synth I can find on Google dates back to 2005. Strange.

Well, maybe today I will look into it again and try to get something done, like to build a ‘Javazing’ look’n feel that will resemble the design of that blog.

Hot Water

Thursday, February 22nd, 2007

Check out how this guy managed to get hot water. Pretty smart I think.

List of Countries for Java Application

Thursday, February 22nd, 2007

No more, no less: the list of countries for your resource bundle file:

Show List

A Few Words On PHP

Thursday, February 22nd, 2007

I know some Java programmers consider PHP to be a simple language for simple solutions. But the number of PHP powered sites is really large. PHP powered content management systems (CMS) have great look and exciting features. When you write in plain PHP without using any of the PHP frameworks, it sucks. It really does. You have to split the page in a few ‘tiles’, then include this pages in every page, to have the same header and footer for example. You also do not have a ‘cross-application’ context, so you cannot use in-memory cache as much as we do it in Java applications.

I also like the idea of tags in Java. Do not know whether it is a Java invention or not. Tags are great and can be of great help and a great time and money save for many projects. In order to have something like tags in PHP you have to write a function that will print the html in an old servlet style. It sucks. I also do not understand why there is no database connection caching in PHP. I asked my friend, a professional PHP programmer if this is a good practice to make a connection to the database and then close it. He said YES and why not. However, maybe there is a cache that is just hidden from the programmer? If so, this is great.

The big thing I do not like in Java is that the JVM and the server such as Tomcat are the real memory hogs. That is why the hosting is expensive and they require to have experienced staff on board to tune and maintain such hosting. I know GoDaddy (my current hosting) claims to support Java in their cheap hosting plans (starting from 6 bucks a month). I think it can be good for a very simple application. I also know they do not let file I/O operations. It is not very good. Therefore, Java is wrong for simple and hobbyist projects. My blog is a PHP powered Wordpress system. I would love to install a Java-based solution, such as blojsom (a wicked name, isn’t it?) but I have no desire to pay 30 bucks a month for the cheapest VPS plan to install Java-based stuff. However, PHP rocks for that niche.

They say PHP was made by web designers and for web designers. I have no doubt in that. Check out PHP projects - they are all beautiful, tons of themes and templates. Java projects are made by software engineers who do not really care if their work looks beautiful or not (think of pre-ocean Java Swing look and feel).

I also get used to easy debugging of Java projects, to logs (thanks Log4J), to an exception handling mechanism. PHP is great and the quantity and high quality of PHP software is amazing. PHP is good for any solution, Java is good for any solution if you can afford to pay high hosting bills.