Tuesday, October 2, 2007
As you probably know we've just finished Eclipse Summer School workshops. It was great time, but now we are back to work. Recently I'm working on new PDE enhancement called "Convert jars to Plug-in Project". How it works, you can select jars in your project and transform them into plug-in project. You can also decide to change references in other project, that contains that jar's, to the new project.
It still needs some work but you can take a look and put your comments in bugzilla.
But this is only context to issue I want to share with you :).
As we all know laziness is a bliss and good programmer is a lazy one. I decided to put it into life when working on this bug. I needed to filter a list of jar files to finds a duplicates. Two jars are the same when have the same manifests (this is only an assumption for this project). This is a great occasion to use TreeSet. I've written a comparator for jar files but I didn't know what to do when two manifests are different. I followed the rule from the beginning of this paragraph and decide that when two manifest are different then result of comparison is jar1.hashCode() - jar2.hasCode(). Of course it couldn't work and I've spent a hour to find what is going on.
So I decide to change my paradigm of good programmer: "good programmer is lazy one but have to know what he is doing".