Archive for August, 2006

Trying Subversion

I finally setup Subversion to a windows server in our company. Apache web server is used for http-based access to source control system. I had a problem during Apache on win32, Subversion integration which says that the module mod_dav_svn can not be found when the mod_dav_svn.so file was in \Apache\modules. It was a crazy and dummy mistake. Solution was moving libdb43.dll file to \Apache\modules directory, problem has no relation with mod_dav_svn.so file. Apache error message is just misdirecting!

My Java IDE, Intellij IDEA, has tools to access Subversion, no need to search for SVN plugins. SVN is easy to set up and use. The usage of TRUNK-BRANCH-TAG pattern for release management is very easy to configure and use. From now on I can access the sources from anywhere independent of location and whether the local connection has a firewall since I have HTTP-based connection to SVN through Apache. I like open-source ideas which makes my life easier:)

Leave a Comment

When to write code comments? Comments must be written?

I saw many developers who are writing comments/copyright information while writing their codes. These innocent commments seem harmless at the first hand. But I believe that no comments must be written during development phase. Comments must be deferred until the last minute when everything is ready for production. Because:

  • Comments decrease the readibility of the source code during development phase. Developer does not need a comment in order to understand his own code. If he needs comments, that means the code is not clean and simple enough. So refactoring and cleaning must be the first action, instead of writing comments. Uncle Bob Martin wrote a good article about clean code.
  • During development phase, requirements may change. When requirement changes, the code handling the requirement also changes. If there is a comment for the code, it must also change. As a result, the chained dependency brings extra cost to project development time.

So in general, I believe clean code is more important than adding comments. If a necessity really forces for writing comment, for instance for an API, it may be written. But before adding it, everything must be tried in order to remove the comment from code.

So why most developers write comments to his code?

I believe one of the reason for this is that the developer is aware of the fact that there is something complex in the code and assumes that comments will make everything fine. So comments are mostly written as an excuse to the outcomer for the ugly code.

Another reason is the study resources. Usually developers learn new techs by going over the samples distributed with the technical writings. Most of these writings include comments in every piece of code. So a new java student learning from a book sees comments with every getter/setter method which is not necessary. As a result, he uses the same technique in his own developments and everywhere is covered with comments.

Leave a Comment

Google Techtalk Videos

Do not worry if you can’t attend the seminars of famous names from software industry. Google is sharing the videos of the tech seminars given inside the company.

Leave a Comment