Wednesday, December 17, 2008

Java Programmers Are Idiots?

My brother just sent me a funny quote. I don't know if it is true or not:
entwickeln Sie lieber überzeugende Lösungen anstatt viele Stunden mit Coding zu verbringen? Ist Ihnen die Produktivität Ihres Teams wichtig?

Mark Driver, *VP Research von Gartner*, kommentierte kürzlich:

"Here’s a simple equation. In terms of mental fortitude...*
1 Smalltalk developer = 2.5 C++ developers
1 C++ developer = 1.5 Java developers*"
You don't need german to understand. Of course it can not be true. How can anyone measure mental fortitude? And how does it related with productivity is another issue.

There is a famous email exchange from Linux Torvald claiming the advantages of C versus C++, here is a quote:
If you want a VCS that is written in C++, go play with Monotone. Really.They use a "real database". They use "nice object-oriented libraries". They use "nice C++ abstractions". And quite frankly, as a result of all these design decisions that sound so appealing to some CS people, the end result is a horrible and unmaintainable mess.


This however is quite interesting since I am probably not the only one to have seen the disastrous effects of too enthusiastic abstraction professionals in Java. This is why many Java projects are utter crap. But again, not everybody makes this mistake. Some people know how to build good things. As the result of Java being popular, we have many crap programmers with pseudo genius theories you don't find in C or Haskell.

On another subject, I seriously wonder why we don't have more distributed compilation in Java as in C/C++. I am tired of seing those core doing nothing while compiling.

Java Programmers Are Idiots?

My brother just sent me a funny quote. I don't know if it is true or not:
entwickeln Sie lieber überzeugende Lösungen anstatt viele Stunden mit Coding zu verbringen? Ist Ihnen die Produktivität Ihres Teams wichtig?

Mark Driver, *VP Research von Gartner*, kommentierte kürzlich:

"Here’s a simple equation. In terms of mental fortitude...*
1 Smalltalk developer = 2.5 C++ developers
1 C++ developer = 1.5 Java developers*"
You don't need german to understand. Of course it can not be true. How can anyone measure mental fortitude? And how does it related with productivity is another issue.

There is a famous email exchange from Linux Torvald claiming the advantages of C versus C++, here is a quote:
If you want a VCS that is written in C++, go play with Monotone. Really.They use a "real database". They use "nice object-oriented libraries". They use "nice C++ abstractions". And quite frankly, as a result of all these design decisions that sound so appealing to some CS people, the end result is a horrible and unmaintainable mess.


This however is quite interesting since I am probably not the only one to have seen the disastrous effects of too enthusiastic abstraction professionals in Java. This is why many Java projects are utter crap. But again, not everybody makes this mistake. Some people know how to build good things. As the result of Java being popular, we have many crap programmers with pseudo genius theories you don't find in C or Haskell.

On another subject, I seriously wonder why we don't have more distributed compilation in Java as in C/C++. I am tired of seing those core doing nothing while compiling.

Tuesday, December 09, 2008

Double.NaN Is Evil

I don't know what Sun had in mind when creating Double.NaN number. It is very inintuitive to use. I am sure every single developer out there fell in the trap of trying to find out if a double was NaN or not using:
Double.NaN == myDouble


This does not work (I don't know the real reason why), one has to use:
Double.isNaN(myDouble)

Not intuitive!

Double.NaN Is Evil

I don't know what Sun had in mind when creating Double.NaN number. It is very inintuitive to use. I am sure every single developer out there fell in the trap of trying to find out if a double was NaN or not using:
Double.NaN == myDouble


This does not work (I don't know the real reason why), one has to use:
Double.isNaN(myDouble)

Not intuitive!

Thursday, November 27, 2008

Grails Spring Union Not Surprising

Looking out at some old post. I found out I was not far from the truth in January 2008 when I stated:
"In 2008 the Ruby On Rails mentality will continue to prevail. In the Java world, Grails is the most likely to benefit from it. (...) It could also be something based around Spring as their current MVC solution is not very good and very old fashioned."
I don't think I will be right with the provocative Java is dead. A post recently titled No Future In Java makes some good points about where the future of Java still is: the web applications. Grails is probably today the best contender in the Java world, far ahead from the others, and it leverages the Java developers. However I am not sure one can say that RIA is a fad, or that RIA will only be done in a super powerful browser in the future. Microsoft might be a game changer here. The real advantages of the browser application so far are: easy deployment (the killer argument IMHO), "simple" security. I would not be surprised if in the near future, Microsoft advertises a solution for RIA easily deployed, based on standard protocols (HTTP?), a bit like IBM does with Eclipse RIA, but much more ambitious.

Grails Spring Union Not Surprising

Looking out at some old post. I found out I was not far from the truth in January 2008 when I stated:
"In 2008 the Ruby On Rails mentality will continue to prevail. In the Java world, Grails is the most likely to benefit from it. (...) It could also be something based around Spring as their current MVC solution is not very good and very old fashioned."
I don't think I will be right with the provocative Java is dead. A post recently titled No Future In Java makes some good points about where the future of Java still is: the web applications. Grails is probably today the best contender in the Java world, far ahead from the others, and it leverages the Java developers. However I am not sure one can say that RIA is a fad, or that RIA will only be done in a super powerful browser in the future. Microsoft might be a game changer here. The real advantages of the browser application so far are: easy deployment (the killer argument IMHO), "simple" security. I would not be surprised if in the near future, Microsoft advertises a solution for RIA easily deployed, based on standard protocols (HTTP?), a bit like IBM does with Eclipse RIA, but much more ambitious.

Friday, November 21, 2008

Java Is Dead

These days, I have the feeling that Java is dead. Even if, or maybe because I have used Java so much in the past 10 years, I have this feeling.

In 1998 Java was revolutionary. It was a very simple to learn object oriented language with modern concepts and familiar syntax. Furthermore the standard library had neat features like internet networking and it could be integrated in the browser. All this at a time when the internet just started to be popular.

Today we have very few evolutions, a huge library (with lots of useful and useless stuff in). Some good stuff has been added like concurrent utils, but not many things changed overall. Open source languages like Python are much more dynamic in their library maintenance. The language does not seem to provide anything interesting when compared to the alternatives, like .NET or even with the "scripting languages" like Python. In the browser it has failed where Flash has succeeded.

Lots of things are too complicated to build in Java when compared to other languages. I feel Swing, database access (JDBC), JSP could be vastly improved to help developer productivity. Why is ORM less important in the Microsoft world? because the standard database layer of Microsoft is not as crappy as JDBC. Why don't they have tons of web frameworks? because ASP.NET is decent, does more than JSP and does not get too much in your way at the same time. Microsoft finds the right balance between library complexity, power and developer friendlyness.

Browser applications are less popular, and desktop apps integrated to a "3-tier" architecture more popular. Java on the desktop is really weak. Give me .NET or QT anytime. There are still no big Java desktop apps on everyday people desktops except Eclipse (IBM has really done an impressive job with it). It is almost 2009 and I still have no Java app except the dev environment for my Java programmer job on my Linux desktop. I know that in my everyday job, I would be more productive with a .NET environment, just because Java sucks so much on the client side. Borland Delphi was more productive 10 years ago!

Java on the Mobile is a failure. Almost nobody uses it and is plagged with compatibility problems. However there is hope here, with Android from Google.

The only advantage of Java compared to .NET is that it is free. You have Tomcat, Glassfish for free. You can deploy on Linux. If you are a poor developer that's quite an advantage. But most company pay for Java, they want the "security" of an IBM and they deploy on Windows machines. It does not make sense, those companies should buy the better Microsoft stack instead of IBM. And I am sure more and more will. Vista might be the big Microsoft failure, I am sure it will be fixed with Windows 7, and Microsoft dev tools are just getting better and better.

Scala, Groovy, JRuby don't fix anything, they are just toy programming languages and are based on the JVM, on the Java libraries. In the lot, Scala does better because it has the concept of library, and they do try to build more interesting libraries than Sun. But it is too complex to be ever popular.

All the open source libraries in Java are fine but who needs to choose between 20 web frameworks, 5 loggers, etc.. There are very few really useful ones: hibernate, lucene, jmeter, junit.

If Java has no logical place in most companies, if it does not provide anything more than the alternatives, and is very weak on the desktop, what's left to Java? the code base and the developers? That's about it. It sounds a lot like Cobol in the early 90s. Java is dead.

Java Is Dead

These days, I have the feeling that Java is dead. Even if, or maybe because I have used Java so much in the past 10 years, I have this feeling.

In 1998 Java was revolutionary. It was a very simple to learn object oriented language with modern concepts and familiar syntax. Furthermore the standard library had neat features like internet networking and it could be integrated in the browser. All this at a time when the internet just started to be popular.

Today we have very few evolutions, a huge library (with lots of useful and useless stuff in). Some good stuff has been added like concurrent utils, but not many things changed overall. Open source languages like Python are much more dynamic in their library maintenance. The language does not seem to provide anything interesting when compared to the alternatives, like .NET or even with the "scripting languages" like Python. In the browser it has failed where Flash has succeeded.

Lots of things are too complicated to build in Java when compared to other languages. I feel Swing, database access (JDBC), JSP could be vastly improved to help developer productivity. Why is ORM less important in the Microsoft world? because the standard database layer of Microsoft is not as crappy as JDBC. Why don't they have tons of web frameworks? because ASP.NET is decent, does more than JSP and does not get too much in your way at the same time. Microsoft finds the right balance between library complexity, power and developer friendlyness.

Browser applications are less popular, and desktop apps integrated to a "3-tier" architecture more popular. Java on the desktop is really weak. Give me .NET or QT anytime. There are still no big Java desktop apps on everyday people desktops except Eclipse (IBM has really done an impressive job with it). It is almost 2009 and I still have no Java app except the dev environment for my Java programmer job on my Linux desktop. I know that in my everyday job, I would be more productive with a .NET environment, just because Java sucks so much on the client side. Borland Delphi was more productive 10 years ago!

Java on the Mobile is a failure. Almost nobody uses it and is plagged with compatibility problems. However there is hope here, with Android from Google.

The only advantage of Java compared to .NET is that it is free. You have Tomcat, Glassfish for free. You can deploy on Linux. If you are a poor developer that's quite an advantage. But most company pay for Java, they want the "security" of an IBM and they deploy on Windows machines. It does not make sense, those companies should buy the better Microsoft stack instead of IBM. And I am sure more and more will. Vista might be the big Microsoft failure, I am sure it will be fixed with Windows 7, and Microsoft dev tools are just getting better and better.

Scala, Groovy, JRuby don't fix anything, they are just toy programming languages and are based on the JVM, on the Java libraries. In the lot, Scala does better because it has the concept of library, and they do try to build more interesting libraries than Sun. But it is too complex to be ever popular.

All the open source libraries in Java are fine but who needs to choose between 20 web frameworks, 5 loggers, etc.. There are very few really useful ones: hibernate, lucene, jmeter, junit.

If Java has no logical place in most companies, if it does not provide anything more than the alternatives, and is very weak on the desktop, what's left to Java? the code base and the developers? That's about it. It sounds a lot like Cobol in the early 90s. Java is dead.

Friday, November 14, 2008

Why ArchLinux Is Better Than Ubuntu

It has been now a week since I have installed ArchLinux on my home computer. I daily use Ubuntu 8.10 at work.

Since the Ubuntu upgrade from 8.04 to 8.10 I have had problems with my Xorg settings. I just found out the nvidia-settings utility does not manage to save the configuration anymore. So I have to lookup on google and try to fix it. And that annoys me. That annoys me because the promess of Ubuntu is that everything works out of the box. In reality, you have to mess with the configuration as much as with ArchLinux.

There are 2 negative points of ArchLinux when compared to Ubuntu:
- The install on a new computer takes a lot of time (not the 30min of Ubuntu) to have a decent desktop running. It can only be done by people ready to fiddle with config files0. But it is well documented in the Arch wiki. So ArchLinux is definately not newbie oriented.
- Some proprietary software might not be installed easily. For a long time Oracle was not trivial to install. Now there is an AUR file for it, so it is quite simple.

Now the positive side:
- good KDE 4.1.3 available
- more up-to-date packages
- "transparent" updates - no big breaking the system at each release.
- learn to use the useful configuration files. They are not many to use in ArchLinux. One feels much more in control on what's installed and what's happening. They are not many config files to know in the end. Configuration ends up being no more difficult (for someone not addicted to point and click) than in Ubuntu.
- fast boot
- no crap forced upon you, for example PulseAudio. I have less problems with pure ALSA.
- does not disappoint. You know you have to fiddle with the config from the start.

Why ArchLinux Is Better Than Ubuntu

It has been now a week since I have installed ArchLinux on my home computer. I daily use Ubuntu 8.10 at work.

Since the Ubuntu upgrade from 8.04 to 8.10 I have had problems with my Xorg settings. I just found out the nvidia-settings utility does not manage to save the configuration anymore. So I have to lookup on google and try to fix it. And that annoys me. That annoys me because the promess of Ubuntu is that everything works out of the box. In reality, you have to mess with the configuration as much as with ArchLinux.

There are 2 negative points of ArchLinux when compared to Ubuntu:
- The install on a new computer takes a lot of time (not the 30min of Ubuntu) to have a decent desktop running. It can only be done by people ready to fiddle with config files0. But it is well documented in the Arch wiki. So ArchLinux is definately not newbie oriented.
- Some proprietary software might not be installed easily. For a long time Oracle was not trivial to install. Now there is an AUR file for it, so it is quite simple.

Now the positive side:
- good KDE 4.1.3 available
- more up-to-date packages
- "transparent" updates - no big breaking the system at each release.
- learn to use the useful configuration files. They are not many to use in ArchLinux. One feels much more in control on what's installed and what's happening. They are not many config files to know in the end. Configuration ends up being no more difficult (for someone not addicted to point and click) than in Ubuntu.
- fast boot
- no crap forced upon you, for example PulseAudio. I have less problems with pure ALSA.
- does not disappoint. You know you have to fiddle with the config from the start.

Saturday, November 08, 2008

KDE 4.1.3 (again) on ArchLinux

I tried another silly thing with Linux, ArchLinux. The setup is quite rough as you have to edit many config files manually. But if you know a bit your way around it takes only a few hours to have everything running well. The installation manual on the wiki is detailed enough to correct all eventual mistakes humans do.

I decided to try once more KDE 4 on it, as at first it was just a silly experiment: I was really not sure ArchLinux would be workable. In the end I am pleasantly surprised, KDE 4.1.3 is way way better than any other versions of KDE I have tried before. It is stable and quite pretty. It took the team a lot of time to get there but now I think KDE 4 is a very good window manager, pleasant to use.

It's a big change from older versions which were too unstable/had too few features to be of any use.

I am not convinced with ArchLinux compared to Ubuntu. The setup is much more complex, less packages are available. True you learn a bit more with ArchLinux. We will see if it can keep working well for a few years.

KDE 4.1.3 (again) on ArchLinux

I tried another silly thing with Linux, ArchLinux. The setup is quite rough as you have to edit many config files manually. But if you know a bit your way around it takes only a few hours to have everything running well. The installation manual on the wiki is detailed enough to correct all eventual mistakes humans do.

I decided to try once more KDE 4 on it, as at first it was just a silly experiment: I was really not sure ArchLinux would be workable. In the end I am pleasantly surprised, KDE 4.1.3 is way way better than any other versions of KDE I have tried before. It is stable and quite pretty. It took the team a lot of time to get there but now I think KDE 4 is a very good window manager, pleasant to use.

It's a big change from older versions which were too unstable/had too few features to be of any use.

I am not convinced with ArchLinux compared to Ubuntu. The setup is much more complex, less packages are available. True you learn a bit more with ArchLinux. We will see if it can keep working well for a few years.

Wednesday, September 17, 2008

Stupid Programmer Interviews

I have read a blog post a few days ago about someone thinking a good programmer interview question was:
How does a hash table work?
While it is a very interesting question, I doubt many programmers (even relatively good ones) can answer that question. If I look back and think of all the employees in all the companies I have known, I can count on one hand people that can answer that question. I can think of 3 or 4 I met in one company, and maybe another 1 or 2 in different companies.

And I don't think anyone would have been able to go deeper in the details like mentioning closed-addressed vs open-addressed possible implementations.

I am so negative, because a question about some important details of the inner working of the Java HashMap was raised at work a week ago. I was the only one (because I had read several times about hash tables) to be aware that the "equals" method of the key object was called every time you do a table.get(xxx) or a table.put(xxx, yyy). Others thought only the hashCode() method was used.

This kind of interview question creates a high bias towards people coming straight out of school if they have Hashtable in their program. For people with more experience, it is highly likely if they ever read about it that they forgot the details (and maybe more than the details).

This can seem shocking as hash tables are used almost everywhere these days, but it's a reality.

Stupid Programmer Interviews

I have read a blog post a few days ago about someone thinking a good programmer interview question was:
How does a hash table work?
While it is a very interesting question, I doubt many programmers (even relatively good ones) can answer that question. If I look back and think of all the employees in all the companies I have known, I can count on one hand people that can answer that question. I can think of 3 or 4 I met in one company, and maybe another 1 or 2 in different companies.

And I don't think anyone would have been able to go deeper in the details like mentioning closed-addressed vs open-addressed possible implementations.

I am so negative, because a question about some important details of the inner working of the Java HashMap was raised at work a week ago. I was the only one (because I had read several times about hash tables) to be aware that the "equals" method of the key object was called every time you do a table.get(xxx) or a table.put(xxx, yyy). Others thought only the hashCode() method was used.

This kind of interview question creates a high bias towards people coming straight out of school if they have Hashtable in their program. For people with more experience, it is highly likely if they ever read about it that they forgot the details (and maybe more than the details).

This can seem shocking as hash tables are used almost everywhere these days, but it's a reality.

Thursday, September 11, 2008

The Art of Multiprocessor Programming Book Review

I don't remember why I started to subscribe to the Java concurrency-interest list. I find that overall, it is an excellent mailing list.
There was a post at one point about the Dante Inferno's problem. It triggered my attention, so I decided to buy the book the post was referring to, The Art of Multiprocessor Programming by M Herlihy and N. Shavit.

The books starts with the basics, and is very didactic in its approach. I enjoyed to learn how locks work and how to build them almost out of nothing. The progression is good, starting with a half broken but simple lock and evolving to the more standard algorithm, like the Bakery Lock algorithm. The algorithms are extremely well explained. Later it explains the differences between spin locks (Bakery for example) and blocking locks, while presenting new algorithms for blocking locks.

What is described in the many chapters is mainly how to write the javax.concurrency.utils library, why, and what to add to it.

Here are the main subjects I found interesting even if they are not always well presented:
  • Bitonic networks: I had not read about it before and I found the subject fascinating. Go and click on the link if you don't know what I am talking about.
  • Skip Lists: while I found the subject to be very interesting, I found the skip lists were not presented in a very clear manner. I find the wikipedia page about Skip Lists and the original paper much better to understand skip lists. Fortunately the authors talk about how to make it more concurrent friendly, and that part is well explained.
  • Software transactional memory: I have the same opinion than with skip list, except the wikipedia page is very short on details, and the book does give much more details. We feel it is the end of the book and the authors took less time to present it an easily understandable manner. One need to read the chapter several times or to have read before about it to really understand.
I like books that make me learn new concepts. In The Art of Multiprocessor Programming, there are plenty of concepts, ideas I had never heard about before, even though most of it is probably well known to specialists in the field. So even if some rare subjects could be presented better, I recommend that book to anybody interested in concurrent programming.

The Art of Multiprocessor Programming Book Review

I don't remember why I started to subscribe to the Java concurrency-interest list. I find that overall, it is an excellent mailing list.
There was a post at one point about the Dante Inferno's problem. It triggered my attention, so I decided to buy the book the post was referring to, The Art of Multiprocessor Programming by M Herlihy and N. Shavit.

The books starts with the basics, and is very didactic in its approach. I enjoyed to learn how locks work and how to build them almost out of nothing. The progression is good, starting with a half broken but simple lock and evolving to the more standard algorithm, like the Bakery Lock algorithm. The algorithms are extremely well explained. Later it explains the differences between spin locks (Bakery for example) and blocking locks, while presenting new algorithms for blocking locks.

What is described in the many chapters is mainly how to write the javax.concurrency.utils library, why, and what to add to it.

Here are the main subjects I found interesting even if they are not always well presented:
  • Bitonic networks: I had not read about it before and I found the subject fascinating. Go and click on the link if you don't know what I am talking about.
  • Skip Lists: while I found the subject to be very interesting, I found the skip lists were not presented in a very clear manner. I find the wikipedia page about Skip Lists and the original paper much better to understand skip lists. Fortunately the authors talk about how to make it more concurrent friendly, and that part is well explained.
  • Software transactional memory: I have the same opinion than with skip list, except the wikipedia page is very short on details, and the book does give much more details. We feel it is the end of the book and the authors took less time to present it an easily understandable manner. One need to read the chapter several times or to have read before about it to really understand.
I like books that make me learn new concepts. In The Art of Multiprocessor Programming, there are plenty of concepts, ideas I had never heard about before, even though most of it is probably well known to specialists in the field. So even if some rare subjects could be presented better, I recommend that book to anybody interested in concurrent programming.

Thursday, August 28, 2008

OO Desillusion

I have read many inspiring books about object oriented programming. I find B. Meyer Object Oriented Software Construction one of the best in the lot. B. Meyer tries to explain in a progressive way why OO is better, by introducing it bit by bit. I have read different related design patterns book, the GoF one, Martin Fowler ones. I have been programming Java for about 10 years now. And yet, today, I feel unconvinced.

Maybe it is because I have been recently on different bigger projects, maybe it is because I have worked with different people. What I see today, is a tendency to overcomplexity. A simple example is you need a code to do only 3 different things in particular cases. Instead of using if-then-else, because it reminds you of the devils of procedural programming, you write 3 classes and 1 interface. Now the usual excuse for such a behavior is to say, we don't know, maybe there will be a 4th one, my code will make it easy to handle the 4th one. Often when there are requirements change, you don't expect at all where it will be, and it is not what a developer thought would change that actually changes. So the dev with the 3 classes has now to change its interface, update the 3 classes, and create a 4th one. The "procedural" guy has no such problem because he did not try to abstract something that did not need any abstraction in the first place.

Now on millions lines of code software, it is important to have a few basic principles in the overall design, to identify components that talk to each other, to define a global structure. But at the developer dimension, there is often no need for that, except in the few cases where it makes sense.

I do use design patterns sometimes, when I feel it is the simplest flexible way, but it is quite rare overall. There are 2 common jokes about design patterns. One is from people who don't know what they are. They often take the piss of architects doing design patterns all the time that in the end don't really know how to do things and spend a lot of time and money on crap. Other is from Pythonists and Rubyists. They say that you do not need design patterns if the language is done right.

The Java language, with the Generics, and the propositions for Java 7 is also evolving in the overcomplex side (ok, the Generics are probably much worse than Java 7 propositions). Soon people will be more confortable reading Haskell. Joke aside, Haskell while being different to read, has really something for it. It brings a new way of writing programs, moves the complexity somewhere else.

I still think lots of ideas in B. Meyer book are valid today. But an essential part must be missing. Overdesign seems to be too recurrent in OO projects.

OO Desillusion

I have read many inspiring books about object oriented programming. I find B. Meyer Object Oriented Software Construction one of the best in the lot. B. Meyer tries to explain in a progressive way why OO is better, by introducing it bit by bit. I have read different related design patterns book, the GoF one, Martin Fowler ones. I have been programming Java for about 10 years now. And yet, today, I feel unconvinced.

Maybe it is because I have been recently on different bigger projects, maybe it is because I have worked with different people. What I see today, is a tendency to overcomplexity. A simple example is you need a code to do only 3 different things in particular cases. Instead of using if-then-else, because it reminds you of the devils of procedural programming, you write 3 classes and 1 interface. Now the usual excuse for such a behavior is to say, we don't know, maybe there will be a 4th one, my code will make it easy to handle the 4th one. Often when there are requirements change, you don't expect at all where it will be, and it is not what a developer thought would change that actually changes. So the dev with the 3 classes has now to change its interface, update the 3 classes, and create a 4th one. The "procedural" guy has no such problem because he did not try to abstract something that did not need any abstraction in the first place.

Now on millions lines of code software, it is important to have a few basic principles in the overall design, to identify components that talk to each other, to define a global structure. But at the developer dimension, there is often no need for that, except in the few cases where it makes sense.

I do use design patterns sometimes, when I feel it is the simplest flexible way, but it is quite rare overall. There are 2 common jokes about design patterns. One is from people who don't know what they are. They often take the piss of architects doing design patterns all the time that in the end don't really know how to do things and spend a lot of time and money on crap. Other is from Pythonists and Rubyists. They say that you do not need design patterns if the language is done right.

The Java language, with the Generics, and the propositions for Java 7 is also evolving in the overcomplex side (ok, the Generics are probably much worse than Java 7 propositions). Soon people will be more confortable reading Haskell. Joke aside, Haskell while being different to read, has really something for it. It brings a new way of writing programs, moves the complexity somewhere else.

I still think lots of ideas in B. Meyer book are valid today. But an essential part must be missing. Overdesign seems to be too recurrent in OO projects.

Thursday, July 17, 2008

Suse 11 with KDE4

I was very disappointed by KDE 4.0 when I first tried it on an ubuntu machine. It was just unusable. I would not have even considered it as a beta.

I changed the system on my home laptop because Ubuntu with KDE 4 was there. I decided to go for something more roots. I had good memories of Gentoo when I tried it some years ago. Maybe I just became too old to appreciate it anymore. But after spending several hours on a Grub error 2 problem, seeing the live CD does not even use grub so you can't use the CD to boot from hard drive and fix the problem easily, wondering if the problem was a problematic Grub version with my drive or not (I never had problems with Grub and other distros on that same machine before), I decided to install OpenSuse 11.

I was surprised (and impressed by Suse) that KDE 4.xx shipped with OpenSuse was usable! Except the program menu, it's not worse than KDE 3.

Linus vs OpenBSD

Today's popular story is Linus Torvalds message to OpenBSD where he writes:
I think the OpenBSD crowd is a bunch of masturbating monkeys
 Beside that provoking sentence he has a valid point. Security bugs should not be more important than other bugs. Too often, management and psychology encourage making security bugs a very important issue and security people VIPs. I have seen this over and over.



Linus vs OpenBSD

Today's popular story is Linus Torvalds message to OpenBSD where he writes:
I think the OpenBSD crowd is a bunch of masturbating monkeys
 Beside that provoking sentence he has a valid point. Security bugs should not be more important than other bugs. Too often, management and psychology encourage making security bugs a very important issue and security people VIPs. I have seen this over and over.



Suse 11 with KDE4

I was very disappointed by KDE 4.0 when I first tried it on an ubuntu machine. It was just unusable. I would not have even considered it as a beta.

I changed the system on my home laptop because Ubuntu with KDE 4 was there. I decided to go for something more roots. I had good memories of Gentoo when I tried it some years ago. Maybe I just became too old to appreciate it anymore. But after spending several hours on a Grub error 2 problem, seeing the live CD does not even use grub so you can't use the CD to boot from hard drive and fix the problem easily, wondering if the problem was a problematic Grub version with my drive or not (I never had problems with Grub and other distros on that same machine before), I decided to install OpenSuse 11.

I was surprised (and impressed by Suse) that KDE 4.xx shipped with OpenSuse was usable! Except the program menu, it's not worse than KDE 3.

Tuesday, July 01, 2008

Java Compilation Performance / Processor Speed

I just found out my laptop was faster in default settings than my home desktop to compile a resonably sized project (5 min vs 6 min). I was surprised as I thought the disk in the desktop would make a big difference. The processor in my desktop is not that great (simple pentium e2180). My laptop has a 2ghz core2duo processor. In Ghz processor are of the same speed.

I tried to overclock my home pc to see what difference it could make, I made it run at 2.6Ghz instead of the standard 2Ghz. The compilation time dropped to 4.5 min.

The ration of processor speed (2.6/2) is almost the same as the ratio of compilation time (6/4.5). I am surprised by such a linearity of behavior.

Java Compilation Performance / Processor Speed

I just found out my laptop was faster in default settings than my home desktop to compile a resonably sized project (5 min vs 6 min). I was surprised as I thought the disk in the desktop would make a big difference. The processor in my desktop is not that great (simple pentium e2180). My laptop has a 2ghz core2duo processor. In Ghz processor are of the same speed.

I tried to overclock my home pc to see what difference it could make, I made it run at 2.6Ghz instead of the standard 2Ghz. The compilation time dropped to 4.5 min.

The ration of processor speed (2.6/2) is almost the same as the ratio of compilation time (6/4.5). I am surprised by such a linearity of behavior.

Wednesday, June 18, 2008

Firefox 3

I tried Firefox 3 twice before, while it was in alpha and beta. I was not impressed at all, it seemed buggy (normal for alpha) and I found the new location bar behavior unintuitive. It did not seem that much faster either. So I always quickly went back to Firefox 2.

I tried again recently, funnily, because of a bad Kernel update. One day, after a kernel update, my laptop started to run only at a max of 800Mhz, I did not notice it immediately. I thought wow Firefox 2.0 is really slow with gmail, maybe I should try Firefox 3 again. I did and worked a few days without noticing the processor speed difference that much. Firefox 3 at 800Mhz is as fast as Firefox 2.0 at 2Ghz. It is only after struggling with very long compilation time related to my work that I thought something was wrong.

As usual with Linux troubles, solution are strange but not too hard to find out. I just had to add a processor.ignore_ppc=1 kernel parameter for the kernel to behave properly again.

Yesterday I installed Firefox 3 on a MacBook, and I was really impressed by its speed. I felt faster than Safari. And now I got used to the new location bar behavior, I would not go back (I think the behavior improved after the betas as well).

Another interesting browser these days, especially for bloggers, is Flock 2 (based on Firefox 3).

Firefox 3

I tried Firefox 3 twice before, while it was in alpha and beta. I was not impressed at all, it seemed buggy (normal for alpha) and I found the new location bar behavior unintuitive. It did not seem that much faster either. So I always quickly went back to Firefox 2.

I tried again recently, funnily, because of a bad Kernel update. One day, after a kernel update, my laptop started to run only at a max of 800Mhz, I did not notice it immediately. I thought wow Firefox 2.0 is really slow with gmail, maybe I should try Firefox 3 again. I did and worked a few days without noticing the processor speed difference that much. Firefox 3 at 800Mhz is as fast as Firefox 2.0 at 2Ghz. It is only after struggling with very long compilation time related to my work that I thought something was wrong.

As usual with Linux troubles, solution are strange but not too hard to find out. I just had to add a processor.ignore_ppc=1 kernel parameter for the kernel to behave properly again.

Yesterday I installed Firefox 3 on a MacBook, and I was really impressed by its speed. I felt faster than Safari. And now I got used to the new location bar behavior, I would not go back (I think the behavior improved after the betas as well).

Another interesting browser these days, especially for bloggers, is Flock 2 (based on Firefox 3).

Tuesday, June 17, 2008

Trying Google AppEngine

I finally took some time to try Google AppEngine. It used to be easy to find free PHP hosting around 2000. It became a rarity. So writing small experiments for free on the web was difficult. Experiments are back thanks to Google with their AppEngine. Many aspects of it are quite interesting and show where they focus.

First it is all Python. It makes sense as I believe Guido v Rossum, Python creator, works for Google. Some people believe in a future Java application hosting. I don't see any reason why it could not become a reality. Making something like AppEngine is a big task, changing implementation language is not. In the meantime, it is not an excuse not to try it, as the Python standard library is fairly rich and Google provides additional libraries on top of it.

AppEngine offers the basic bricks for building web apps:
  • Persistence: they rolled out their own persistence layer. Is it because it is stored in BigTable? It is quite basic (no join), maybe again for the same reason. Still it is enough to write prototypes or do fun stuff.
  • View: one can use Django templates. They are not perfect but better done than what we have in the java world for templating.
  • Authentication: Google provide their authentication system transparently. It is amazingly simple to setup authenticated sites/pages.
  • URL Fetch: points toward service oriented architecture. Without it, making services and calling them would not be possible.
  • Other useful stuff like Mail, cache.

With such a list of libraries, one can easily imagine the server side of future apps for Android running on AppEngine.

The way code updates are pushed to the google servers is a bit reminiscent of Java web application deployment. However it is done with much finer granularity (file).

Overall I am happy with AppEngine. Yes it is similar to old PHP hosting, but it adds a lot of value by bringing few easy to use libraries, and natural integration with Google infrastructure. Compared to a PHP hosting, I think the biggest improvement is the database (dev use and admin use). For the dev it is integrated to the code. For the admin, it can be done transparently on the web. The most interesting is that it's FREE.

Trying Google AppEngine

I finally took some time to try Google AppEngine. It used to be easy to find free PHP hosting around 2000. It became a rarity. So writing small experiments for free on the web was difficult. Experiments are back thanks to Google with their AppEngine. Many aspects of it are quite interesting and show where they focus.

First it is all Python. It makes sense as I believe Guido v Rossum, Python creator, works for Google. Some people believe in a future Java application hosting. I don't see any reason why it could not become a reality. Making something like AppEngine is a big task, changing implementation language is not. In the meantime, it is not an excuse not to try it, as the Python standard library is fairly rich and Google provides additional libraries on top of it.

AppEngine offers the basic bricks for building web apps:
  • Persistence: they rolled out their own persistence layer. Is it because it is stored in BigTable? It is quite basic (no join), maybe again for the same reason. Still it is enough to write prototypes or do fun stuff.
  • View: one can use Django templates. They are not perfect but better done than what we have in the java world for templating.
  • Authentication: Google provide their authentication system transparently. It is amazingly simple to setup authenticated sites/pages.
  • URL Fetch: points toward service oriented architecture. Without it, making services and calling them would not be possible.
  • Other useful stuff like Mail, cache.

With such a list of libraries, one can easily imagine the server side of future apps for Android running on AppEngine.

The way code updates are pushed to the google servers is a bit reminiscent of Java web application deployment. However it is done with much finer granularity (file).

Overall I am happy with AppEngine. Yes it is similar to old PHP hosting, but it adds a lot of value by bringing few easy to use libraries, and natural integration with Google infrastructure. Compared to a PHP hosting, I think the biggest improvement is the database (dev use and admin use). For the dev it is integrated to the code. For the admin, it can be done transparently on the web. The most interesting is that it's FREE.

Monday, June 16, 2008

Option, Futures and Other Derivatives Book Review

Option, Futures and Other Derivatives is by far the most popular book in finance. You will find it in every finance company, on many desks.

It is a very good introduction for people not familiar with standard financial products. This kind of book is unavoidable to understand the basis. It goes also beyond with the chapters on pricing and hedging. These 2 chapters make one understand many other book. If one understands the Black and Scholze formula, one can easily approach many other pricing formula, as in a way, there are all similar in their approach.

Option, Futures and Other Derivatives Book Review

Option, Futures and Other Derivatives is by far the most popular book in finance. You will find it in every finance company, on many desks.

It is a very good introduction for people not familiar with standard financial products. This kind of book is unavoidable to understand the basis. It goes also beyond with the chapters on pricing and hedging. These 2 chapters make one understand many other book. If one understands the Black and Scholze formula, one can easily approach many other pricing formula, as in a way, there are all similar in their approach.

Structured Equity Derivatives Book Review

If one has to learn about equity derivatives, beside the classic Option, Futures and Other Derivatives from Hull, Structured Equity Derivatives by Harry M Kat is a must read.

His ideas are presented in a software developer friendly way, as his goal is to show how different equity derivatives products are behind the scenes, very similar.

I enjoyed the variety of exotic products presented and the very detailed way in which they are explained.

The book is filled up with graphs, which is a good thing. While browsing the book for the first time, I did not really grasp those graphs well. But after having read it, they do make sense and help visualize what's happening. With those graphs, volatility and other parameters don't look only like abstract variables in a formula.

Structured Equity Derivatives Book Review

If one has to learn about equity derivatives, beside the classic Option, Futures and Other Derivatives from Hull, Structured Equity Derivatives by Harry M Kat is a must read.

His ideas are presented in a software developer friendly way, as his goal is to show how different equity derivatives products are behind the scenes, very similar.

I enjoyed the variety of exotic products presented and the very detailed way in which they are explained.

The book is filled up with graphs, which is a good thing. While browsing the book for the first time, I did not really grasp those graphs well. But after having read it, they do make sense and help visualize what's happening. With those graphs, volatility and other parameters don't look only like abstract variables in a formula.

Thursday, June 05, 2008

Fedora Linux & Apple Bluetooth Keyboard

It took me a long time to have the Apple Bluetooth Keyboard (slim aluminium model) working well with Fedora 9. Thanks to the Ubuntu documentation, it is quite easy to establish a connection manually through hidd commands. It was unfortunately much more difficult to have it automatically recognized and not disconnected after a few minutes without use.

The following configuration should work with any other distro and probably other bluetooth keyboards as well.

2 configurations files need to be updated to make it work:
  • /etc/default/bluetooth should contain the following, with the mac address replaced by the one from your keyboard (hidd --search to see it).
BLUETOOTH_ENABLED=1

HIDD_ENABLED=1
HIDD_OPTIONS="--timeout 8 --connect 00:1D:4F:A7:15:CC --server"


  • /etc/bluetooth/hcid.conf should be appended with
device 00:1D:4F:A7:15:CC {
name "Apple Wireless Keyboard";
auth enable;
encrypt enable;
lm master;
}


The 2 tricky parameters are "lm master" (makes it connect automatically), and "--timeout 8" that makes it not disconnect contrary to what the option tells. Without the option the timeout of the keyboard is about 11 minutes. If the computer timeout is lower, the connection will be reestablished automatically, thus the value of 8.

Jun 16th update: I still had disconnections, the only way I found to get rid of them was to patch the kernel. I find surprising it was needed, I thought there would have been enough people complaining that the patch would have already been applied in Fedora kernel.

Fedora Linux & Apple Bluetooth Keyboard

It took me a long time to have the Apple Bluetooth Keyboard (slim aluminium model) working well with Fedora 9. Thanks to the Ubuntu documentation, it is quite easy to establish a connection manually through hidd commands. It was unfortunately much more difficult to have it automatically recognized and not disconnected after a few minutes without use.

The following configuration should work with any other distro and probably other bluetooth keyboards as well.

2 configurations files need to be updated to make it work:
  • /etc/default/bluetooth should contain the following, with the mac address replaced by the one from your keyboard (hidd --search to see it).
BLUETOOTH_ENABLED=1

HIDD_ENABLED=1
HIDD_OPTIONS="--timeout 8 --connect 00:1D:4F:A7:15:CC --server"


  • /etc/bluetooth/hcid.conf should be appended with
device 00:1D:4F:A7:15:CC {
name "Apple Wireless Keyboard";
auth enable;
encrypt enable;
lm master;
}


The 2 tricky parameters are "lm master" (makes it connect automatically), and "--timeout 8" that makes it not disconnect contrary to what the option tells. Without the option the timeout of the keyboard is about 11 minutes. If the computer timeout is lower, the connection will be reestablished automatically, thus the value of 8.

Jun 16th update: I still had disconnections, the only way I found to get rid of them was to patch the kernel. I find surprising it was needed, I thought there would have been enough people complaining that the patch would have already been applied in Fedora kernel.

Wednesday, May 14, 2008

DecimalFormat Is Broken

A friend of mine recently noticed that the good old DecimalFormat class is "broken". If you try to parse a string that is not a number but is starting with a number, the DecimalFormat.parse will return what it managed to parse.

The correct behavior should be to throw a parse exception IMHO. Judging from an old post in the Sun bug tracker, The folks at Sun don't think it really is, they call the default mode of parsing the "lenient" mode. It accepts bad inputs. Then why throwing ParseException at all and why not return 0/NaN when the first character is not a number? Why accepting 1toto2 as a number and not toto2?

In reality it can really create unexpected problems. For example, in France, 0.1 is 0,1 because of the Locale conventions. If a user enters 0.1 in a French Locale, a method using DecimalFormat.parse will interpret it as 0 without throwing any exception.

Note that DateFormat does not have that problem, at one point Sun added setLenient flag to be able to be in non Lenient mode. It would be very simple to do it with DecimalFormat, I did it myself as an exercise. In DecimalFormat.subparse, the 2 last break statements should stop processing in lenient mode. Lines 1528 to 1531:
sawExponent = true;
}
break; // Whether we fail or succeed, we exit this loop
}
else {
break;
}

become:

sawExponent = true;
} else {
if (isLenient()) {
parsePosition.index = oldStart;
parsePosition.index = oldStart;
return false;
}
}
break; // we succeed, we exit this loop

}
else {
if (isLenient()) {
parsePosition.index = oldStart;
parsePosition.errorIndex = oldStart;
return false;
}
break;
}

DecimalFormat Is Broken

A friend of mine recently noticed that the good old DecimalFormat class is "broken". If you try to parse a string that is not a number but is starting with a number, the DecimalFormat.parse will return what it managed to parse.

The correct behavior should be to throw a parse exception IMHO. Judging from an old post in the Sun bug tracker, The folks at Sun don't think it really is, they call the default mode of parsing the "lenient" mode. It accepts bad inputs. Then why throwing ParseException at all and why not return 0/NaN when the first character is not a number? Why accepting 1toto2 as a number and not toto2?

In reality it can really create unexpected problems. For example, in France, 0.1 is 0,1 because of the Locale conventions. If a user enters 0.1 in a French Locale, a method using DecimalFormat.parse will interpret it as 0 without throwing any exception.

Note that DateFormat does not have that problem, at one point Sun added setLenient flag to be able to be in non Lenient mode. It would be very simple to do it with DecimalFormat, I did it myself as an exercise. In DecimalFormat.subparse, the 2 last break statements should stop processing in lenient mode. Lines 1528 to 1531:
sawExponent = true;
}
break; // Whether we fail or succeed, we exit this loop
}
else {
break;
}

become:

sawExponent = true;
} else {
if (isLenient()) {
parsePosition.index = oldStart;
parsePosition.index = oldStart;
return false;
}
}
break; // we succeed, we exit this loop

}
else {
if (isLenient()) {
parsePosition.index = oldStart;
parsePosition.errorIndex = oldStart;
return false;
}
break;
}

Tuesday, April 29, 2008

Using MiG Layout For Better Swing Development

I have forgotten a few libraries in my Better Swing Development article, and notably MiGLayout.

GridBagLayout is too verbose, and still feels too clumsy. This is why a while back I wrote a small tool to help visualize various GridBagLayouts for people who are not used to it. But it would have been much simpler to use a better layout instead.

MiGLayout is good, I managed to have good results without almost any practices on not so simple layouts. It also makes the code more concise.

Related to my previous post about SwiXml, and as SwiXml does not yet support MiGLayout, I was thinking how easy it would be to achieve something relatively similar. With proper code conventions it is quite easy to describe the GUI outside a Java file, for example, for an easy start in a Beanshell file.

The beanshell file would contain components construction, and MiGLayout of them afterwards, that's it. All listeners and component behaviours would be kept in java classes. With this kind of code split. The beanshell file is then extremely simple, as simple as the SwiXml.

MiGLayout also has plenty of extra functionalities like "hidemode 1" that can help automatically redoing the layout if a component becomes visible/invisible.

Using MiG Layout For Better Swing Development

I have forgotten a few libraries in my Better Swing Development article, and notably MiGLayout.

GridBagLayout is too verbose, and still feels too clumsy. This is why a while back I wrote a small tool to help visualize various GridBagLayouts for people who are not used to it. But it would have been much simpler to use a better layout instead.

MiGLayout is good, I managed to have good results without almost any practices on not so simple layouts. It also makes the code more concise.

Related to my previous post about SwiXml, and as SwiXml does not yet support MiGLayout, I was thinking how easy it would be to achieve something relatively similar. With proper code conventions it is quite easy to describe the GUI outside a Java file, for example, for an easy start in a Beanshell file.

The beanshell file would contain components construction, and MiGLayout of them afterwards, that's it. All listeners and component behaviours would be kept in java classes. With this kind of code split. The beanshell file is then extremely simple, as simple as the SwiXml.

MiGLayout also has plenty of extra functionalities like "hidemode 1" that can help automatically redoing the layout if a component becomes visible/invisible.

Friday, April 25, 2008

_the_ Google 1998 paper

I have just read "the anatomy of a search engine" from S. Brin and L. Page. For those who don't know, it is _the_ Google paper. I have read other google labs papers in the past. What I like in this one is that you can follow how they came into having the Google ideas, how they assembled their ideas.

I should have read that a long time ago.

_the_ Google 1998 paper

I have just read "the anatomy of a search engine" from S. Brin and L. Page. For those who don't know, it is _the_ Google paper. I have read other google labs papers in the past. What I like in this one is that you can follow how they came into having the Google ideas, how they assembled their ideas.

I should have read that a long time ago.

Fedora 9 Already Stable


I "upgraded" my home computer to Fedora 9. "upgraded" because I reinstalled the OS instead of using the upgrade procedure. I have had so many issues with "partial" upgrades in the past (with any distro).

Although it is the preview/RC1 version, Fedora 9 is already as stable as a release IMHO. No issues so far, it feels more polished than Fedora 8. OpenJDK 1.6 is there. Firefox 3 is there. Not a single problem with kernel 2.6.25 (while I had plenty with the 2.6.24 ones).

Even Linus's wife uses it!

Fedora 9 Already Stable


I "upgraded" my home computer to Fedora 9. "upgraded" because I reinstalled the OS instead of using the upgrade procedure. I have had so many issues with "partial" upgrades in the past (with any distro).

Although it is the preview/RC1 version, Fedora 9 is already as stable as a release IMHO. No issues so far, it feels more polished than Fedora 8. OpenJDK 1.6 is there. Firefox 3 is there. Not a single problem with kernel 2.6.25 (while I had plenty with the 2.6.24 ones).

Even Linus's wife uses it!

Thursday, April 24, 2008

SwiXml Review

Externalizing the screen layout is a natural step for many applications. It can be because a customer might want a slightly different presentation, or just for the sake of clearly separating layout code, or for using a kind of screen generator. Back in 2003, I wrote a small utility to help with GridBagLayout, nothing fantastic, but there was the feature of saving a generated layout in XML (or Beanshell) and using it in an application.

SwiXml saves a bit more than a layout as it instantiates the components as well, allowing to represent a hierarchy of components in XML. But it does not more than that. The "no generation" approach is interesting, I bet the author thinks the XML should be kept concise enough to be used easily without using a kind of generator. the XML is almost a mirror of Java code, but fortunately makes layouts more compact and easier to read. I tried version 1.51, and while it is quite well done, its documentation is a bit lacking and to me an important functionality is missing:

There is no "component" tag by default. One needs to explicitely name the class of component we want to add. I think there could be a component tag that instantiate an 0 parameter constructor by default, using reflection for example. The class of component to instantiate would be found through the field name.

Fortunately SwiXml is quite well done and this is not that big of an issue since you can just interpret new tags with 1 line of code:
engine.getTaglib().registerTag("datecombobox", DateComboBox.class);

for a Jide DateComboBox.

I said documentation was lacking, because in my first non Hello World trial, I wanted to use the standard constant names for GridBagConstraints (RELATIVE,REMAINDER, FIRST_LINE, LAST_LINE, ...). Putting <gridbagconstraint anchor="FIRST_LINE">did not work. By reading the code, I found out you could achieve it but you have to do <gridbagconstraint anchor="GridBagConstraint.FIRST_LINE">.

In the end SwiXml left me with a good impression. It is non intrusive, and handle well enough what it is done for. One major drawback, you can only use either BorderLayout or GridBagLayout or FormLayout (from JGoodies).

SwiXml Review

Externalizing the screen layout is a natural step for many applications. It can be because a customer might want a slightly different presentation, or just for the sake of clearly separating layout code, or for using a kind of screen generator. Back in 2003, I wrote a small utility to help with GridBagLayout, nothing fantastic, but there was the feature of saving a generated layout in XML (or Beanshell) and using it in an application.

SwiXml saves a bit more than a layout as it instantiates the components as well, allowing to represent a hierarchy of components in XML. But it does not more than that. The "no generation" approach is interesting, I bet the author thinks the XML should be kept concise enough to be used easily without using a kind of generator. the XML is almost a mirror of Java code, but fortunately makes layouts more compact and easier to read. I tried version 1.51, and while it is quite well done, its documentation is a bit lacking and to me an important functionality is missing:

There is no "component" tag by default. One needs to explicitely name the class of component we want to add. I think there could be a component tag that instantiate an 0 parameter constructor by default, using reflection for example. The class of component to instantiate would be found through the field name.

Fortunately SwiXml is quite well done and this is not that big of an issue since you can just interpret new tags with 1 line of code:
engine.getTaglib().registerTag("datecombobox", DateComboBox.class);

for a Jide DateComboBox.

I said documentation was lacking, because in my first non Hello World trial, I wanted to use the standard constant names for GridBagConstraints (RELATIVE,REMAINDER, FIRST_LINE, LAST_LINE, ...). Putting <gridbagconstraint anchor="FIRST_LINE">did not work. By reading the code, I found out you could achieve it but you have to do <gridbagconstraint anchor="GridBagConstraint.FIRST_LINE">.

In the end SwiXml left me with a good impression. It is non intrusive, and handle well enough what it is done for. One major drawback, you can only use either BorderLayout or GridBagLayout or FormLayout (from JGoodies).

Thursday, April 17, 2008

Better Java Swing Development

It has been a while since I have looked at the different options for building GUIs in Java. I like the approach taken by Eclipse, they provide not only GUI components, but a complete GUI application framework. Several years ago, I have stolen ideas from it (how they manage plugins) and applied it for Swing applications. This worked out quite well. The Netbeans platform now offers a more interesting alternative if you have to do Swing. The major drawback when compared to Eclipse, is that since the beginning Eclipse was all about making a platform, while Netbeans copied that idea only relatively recently and is less active about making it so. IBM uses Eclipse foundations for many of their products successfully.

Unfortunately on many projects, a Swing application is already there and all you have to do is add more screens, more forms. What I am trying to see here, is what could help Swing development is those cases.

JGoodies


JGoodies is old now, but can be quite useful in creating nice looking forms quickly. It is basically all around a layout better tailored to forms that the can do everything GridBagLayout.
It can help but it does not make a significant difference vs good practices with the GridBagLayout.

Jide Software


Jidesoft provides much more than JGoodies, but is not free (except the Jide Common Layer). I have used it in the past and found their API quite clean and easy to use. They offer more elaborated Swing components that should be part of the JDK. They started to go to the platform area only recently with their Jide Desktop Application Framework, which is not free either. I am not sure I would base an application around an unfree framework.

SwiXAT


It is a recent BSD licensed project based on top of Swix. It is basically MVC for Swix, with command binding in XML. I need to look more into it, it seems to provide an "application framework" as well where you have to launch your app through a SwixAt class (which IMHO sucks). I hope it is not a requirement and that only parts of it can be used and integrated into an existing application. I will hopefully have time to try it more concretely and will blog about it. In any cases it looks interesting.

SwiXml

An Apache licensed project, it seems like a decently used way of laying out swing components in XML, inspired by XUL. It might just be enough. Or is it just too similar to  Java code translated to XML? I need to investigate this more.

JavaFX

JavaFX is probably the serious alternative to SwiXml. I like the idea of a better grammar to lay out and assemble components instead of using XML. Unfortunately it seems a bit invasive to start using for a part only of an application

I took a quick look at Swing Application Framework (JDNC2 redone once again). While it has interesting use of annotations, it seems very far from what Eclipse offers. And I don't feel like it will improve working with Swing a lot. I think except JavaFx, Sun seriously fucked around during many years with Swing. IBM has been much more focused and effective.



Better Java Swing Development

It has been a while since I have looked at the different options for building GUIs in Java. I like the approach taken by Eclipse, they provide not only GUI components, but a complete GUI application framework. Several years ago, I have stolen ideas from it (how they manage plugins) and applied it for Swing applications. This worked out quite well. The Netbeans platform now offers a more interesting alternative if you have to do Swing. The major drawback when compared to Eclipse, is that since the beginning Eclipse was all about making a platform, while Netbeans copied that idea only relatively recently and is less active about making it so. IBM uses Eclipse foundations for many of their products successfully.

Unfortunately on many projects, a Swing application is already there and all you have to do is add more screens, more forms. What I am trying to see here, is what could help Swing development is those cases.

JGoodies


JGoodies is old now, but can be quite useful in creating nice looking forms quickly. It is basically all around a layout better tailored to forms that the can do everything GridBagLayout.
It can help but it does not make a significant difference vs good practices with the GridBagLayout.

Jide Software


Jidesoft provides much more than JGoodies, but is not free (except the Jide Common Layer). I have used it in the past and found their API quite clean and easy to use. They offer more elaborated Swing components that should be part of the JDK. They started to go to the platform area only recently with their Jide Desktop Application Framework, which is not free either. I am not sure I would base an application around an unfree framework.

SwiXAT


It is a recent BSD licensed project based on top of Swix. It is basically MVC for Swix, with command binding in XML. I need to look more into it, it seems to provide an "application framework" as well where you have to launch your app through a SwixAt class (which IMHO sucks). I hope it is not a requirement and that only parts of it can be used and integrated into an existing application. I will hopefully have time to try it more concretely and will blog about it. In any cases it looks interesting.

SwiXml

An Apache licensed project, it seems like a decently used way of laying out swing components in XML, inspired by XUL. It might just be enough. Or is it just too similar to  Java code translated to XML? I need to investigate this more.

JavaFX

JavaFX is probably the serious alternative to SwiXml. I like the idea of a better grammar to lay out and assemble components instead of using XML. Unfortunately it seems a bit invasive to start using for a part only of an application

I took a quick look at Swing Application Framework (JDNC2 redone once again). While it has interesting use of annotations, it seems very far from what Eclipse offers. And I don't feel like it will improve working with Swing a lot. I think except JavaFx, Sun seriously fucked around during many years with Swing. IBM has been much more focused and effective.



Thursday, February 28, 2008

Fedora 8 vs. Ubuntu 8

I had the bad idea of trying (K)ubuntu 8.04 on my home computer. It worked for a few days, but as Ubuntu 8 is still in alpha, changes tend to break everything easily. At one point Wine stopped working, then the DVD, then the sound. I had crashes with USB plug/unplug. It was time to go back to a stable distro. I went back to Fedora 8.

I found out that I had missed some positive sides of Fedora 8 before. It compares quite well with the future Ubuntu 8. Both include pulseaudio. Pulseaudio in Fedora 8 is very well integrated, works well by default. I had to manually tweak things with Ubuntu, probably because it is an alpha.
Both have a relatively new kernel (2.6.23 for Fedora 8, 2.6.24 for Ubuntu 8).
Packages I use everyday are as new in both Fedora 8 and Ubuntu 8.

Fedora 8 is also more stable than it used to be on my machine. Fedora people do their job very well at fixing various bugs after a release.

2 drawbacks of Fedora:
  • the package management. I know by experience that rpm+yum is more problematic with dependencies than apt.
  • Sun Java not installed by default (IcedTea instead). Being a Java developer, the reference is Sun JDK. Plus Sun JDK is open enough for me.
Other than that, Fedora 8 is excellent. I feel it has more features than Ubuntu: pulseaudio already well integrated, SELinux, Firewall by default.

Don't make the same mistake, don't install an alpha linux distro. It used to work without problems back in the days. I have used Gentoo, Slackware with custom kernel without troubles. Nowadays it seems quite risky to go without a distro that has not been well tested.

Fedora 8 vs. Ubuntu 8

I had the bad idea of trying (K)ubuntu 8.04 on my home computer. It worked for a few days, but as Ubuntu 8 is still in alpha, changes tend to break everything easily. At one point Wine stopped working, then the DVD, then the sound. I had crashes with USB plug/unplug. It was time to go back to a stable distro. I went back to Fedora 8.

I found out that I had missed some positive sides of Fedora 8 before. It compares quite well with the future Ubuntu 8. Both include pulseaudio. Pulseaudio in Fedora 8 is very well integrated, works well by default. I had to manually tweak things with Ubuntu, probably because it is an alpha.
Both have a relatively new kernel (2.6.23 for Fedora 8, 2.6.24 for Ubuntu 8).
Packages I use everyday are as new in both Fedora 8 and Ubuntu 8.

Fedora 8 is also more stable than it used to be on my machine. Fedora people do their job very well at fixing various bugs after a release.

2 drawbacks of Fedora:
  • the package management. I know by experience that rpm+yum is more problematic with dependencies than apt.
  • Sun Java not installed by default (IcedTea instead). Being a Java developer, the reference is Sun JDK. Plus Sun JDK is open enough for me.
Other than that, Fedora 8 is excellent. I feel it has more features than Ubuntu: pulseaudio already well integrated, SELinux, Firewall by default.

Don't make the same mistake, don't install an alpha linux distro. It used to work without problems back in the days. I have used Gentoo, Slackware with custom kernel without troubles. Nowadays it seems quite risky to go without a distro that has not been well tested.

Friday, February 08, 2008

Windows Vista Is Crap!

It has been already 1 year since Windows Vista is out. In my new company, I had a new computer with Vista on it. I quickly installed Ubuntu in dual boot. I was happy with Ubuntu for my work, until I received many Excel files OpenOffice was not able to read properly. I decided to give a try to Vista. My first impression of it when I had the computer was quite negative. I was not able to find things that used to be easy to find. It seemed slow and not very interesting.

As I thought I had to use it, I managed to make it a bit more pleasant by adopting the old Windows 95 style instead of the default colors and effects everywhere. I dislike the standard effects because it seems that they are only there to distract you from what you want to do with the computer, and don't help you to do things. I have used Windows a long time before, and installing Total Commander and Opera made Vista a bit more responsive for some tasks. Explorer is really slow and bloated.

Still on the big Java project we are working with, it took 14 minutes to (clean and) build the first time. I struggle to find out why it was so slow. Under Ubuntu, the same command took 5 minutes. As I thought it was swapping to disk, I decided to order more RAM so that I have 3GB (the build process takes around 1GB). If I build it many times in a row, because of the file cache, I can have the build in 4.30 min but it never happens in real life. In real cases it always takes at least 14 minutes, event with 3GB. And it still seems to swap !?! Now I am not even sure of anything, the fact is I did not manage to make it faster. I tried messing with various registry parameters for the cache/memory with no success. This article is completely wrong about Vista memory being much better managed. It is really awfully managed. That frustrated me how a new OS can be 3x slower, until I heard about gnumeric. Gnumeric is able to read all kinds of difficult Excel formulas, and all my Excel documents worked under Ubuntu.

So after 2 weeks of experiencing the slowness of Vista, and the first blue screen (BSODs are back with Vista), I switched back to Ubuntu. Other than being  awfully slow, Vista does not have that many drawbacks, but it does not have anything compelling either when compared to XP (except a maybe better security system).

Windows Vista Is Crap!

It has been already 1 year since Windows Vista is out. In my new company, I had a new computer with Vista on it. I quickly installed Ubuntu in dual boot. I was happy with Ubuntu for my work, until I received many Excel files OpenOffice was not able to read properly. I decided to give a try to Vista. My first impression of it when I had the computer was quite negative. I was not able to find things that used to be easy to find. It seemed slow and not very interesting.

As I thought I had to use it, I managed to make it a bit more pleasant by adopting the old Windows 95 style instead of the default colors and effects everywhere. I dislike the standard effects because it seems that they are only there to distract you from what you want to do with the computer, and don't help you to do things. I have used Windows a long time before, and installing Total Commander and Opera made Vista a bit more responsive for some tasks. Explorer is really slow and bloated.

Still on the big Java project we are working with, it took 14 minutes to (clean and) build the first time. I struggle to find out why it was so slow. Under Ubuntu, the same command took 5 minutes. As I thought it was swapping to disk, I decided to order more RAM so that I have 3GB (the build process takes around 1GB). If I build it many times in a row, because of the file cache, I can have the build in 4.30 min but it never happens in real life. In real cases it always takes at least 14 minutes, event with 3GB. And it still seems to swap !?! Now I am not even sure of anything, the fact is I did not manage to make it faster. I tried messing with various registry parameters for the cache/memory with no success. This article is completely wrong about Vista memory being much better managed. It is really awfully managed. That frustrated me how a new OS can be 3x slower, until I heard about gnumeric. Gnumeric is able to read all kinds of difficult Excel formulas, and all my Excel documents worked under Ubuntu.

So after 2 weeks of experiencing the slowness of Vista, and the first blue screen (BSODs are back with Vista), I switched back to Ubuntu. Other than being  awfully slow, Vista does not have that many drawbacks, but it does not have anything compelling either when compared to XP (except a maybe better security system).

Tuesday, January 22, 2008

The 2008 Java Web Framework

One of my first web framework was a custom one, based on the book Web Development with Java Server Pages. That was in 1999, when Struts was not yet known. But it was web-MVC, very near from what Struts gave later, without the custom tag stuff (custom tags were not yet part of JSP specifications).

Until 2007, Struts was IMHO the most used web framework and the default choice, even though many contenders appeared, with more features, better code. 2007 saw the maturity of some of these framework. As similar framework to Struts, I particularly like Stripes, because the API is very lean. Some component frameworks got a lot of buzz as well, Tapestry some time ago, and today Wicket. I tried both, and while they are very interesting, and can be very productive for some tasks (web application more than web site), I am not convinced they are the tech of 2008. Web Applications are better done with Flex, or GWT.

The major news in the past few years has been Ruby On Rails. Everybody tried to replicate it in every language (with their own twist):  Django in Python, Lift in Scala, ErlyWeb in Erlang, Cake in PHP, Grails (along with now abandonned Sails, and less populair Trails) in Java. And some people fought for making the point they had the idea before Rails. But Rails is what made Rails-like development popular.
After trying Rails soon after it was out (way before 1.0) and more recently (just before 2.0), I was amazed by the progress of Rails. I was impressed in 2004 about Rails, because the approach was new and effective. I disliked a bit the choice of Ruby. In the end in the project we ended up rewriting the persistence layer because our application was very specific. And I ported the app very quickly to Java. In 2007, I was even more impressed, and did not need to dwelve into arcanes of Rails anymore, but merely using it was enough to do lots and lots of things.

In 2008 the Ruby On Rails mentality will continue to prevail. In the Java world, Grails is the most likely to benefit from it. But I would not be surprised if there was another new Rails-like contender in the game (Rails on JRuby?). It could also be something based around Spring as their current MVC solution is not very good and very old fashioned.