Wednesday, October 24, 2007

Less code or what?

My philosophy of coding is less code is always better*. That is, less code needs less effort to maintain and in case of bugs you need to examine less code to spot where a bug lives. This is important when a legacy code is being maintained. It is usually acceptable to disable a legacy code to implement a new feature or fix an existing bug. During this process, some code usually becomes redundant and it should be thrown away. However, this is scary. I haven't seen a lot of developers that feel comfortable by deleting other people's code. I understand this to some extent. On the other hand, leaving a redundant code in place is scary too. Redundant codes confuse developers. Experienced developers usually come to this question of why the hell this code is there and they usually spend days to find out well sloth is a real sin. This is when people should throw code away. Throw your redundant code away, and by code I mean any form of code, either Java code or SQL statement.

 

 

 

 

* This excludes crazy untraceable codes that break code usage searches and, therefore, prevent refactoring tools from functioning. One example is Java Reflection API which may save few (hundred) lines of code but it lets your code live as shadows.

Monday, October 15, 2007

Free IntelliJ IDEA upgrade

Today I got my free IntelliJ IDEA license upgrade. Yet another reason to love IntelliJ IDEA.

Thursday, October 4, 2007

IntelliJ IDEA 7 - method does not exist and more

For a while I was getting annoying errors in IDEA early release distributions thorough their EAP, and this was becoming an issue as the errors were disabling basic functions like code highlight. I was quite concerned that IntelliJ quality is going down but at the same time I didn't think I was right to say it because those distributions are not really meant to be stable. However, after a few tinkering here and there I realized I was getting those error because I was extracting new releases on previous releases and apparently it was not the best thing to do. One still may keep the bin directory but it is not too bad of an idea to do a clean install each time.

In any events, IDEA 7 has a nice Spring and Hibernate support. I have been enjoying code completion for HQL queries and Spring beans. Every now and often I can see a minor false-positive error detected in my HQLs but I have a feelings these things will go away in the main release of version 7. No matter what, I still prefer to stay a customer. I can't find my way in Eclipse. Therefore, that's not really an option for me.