Tagged: Code

Why comments in the code are not always good! 8

Why comments in the code are not always good!

Why comments in the code are not always good! (1) Because they are not updated. When ever the code is changed, the comments should also be changed. But it may happen like the code is updated but not the comments which may confuse the next developer. (2) Maintenance problem. Highly commented code is...

Generic toString Method for Simple Java Beans 7

Generic toString Method for Simple Java Beans

I have seen developers writing toString method in each of their bean class. The purpose is to print the bean variables for logging or debugging purposes. I thought of reducing their effort by writing a generic toString method to have in their base bean class. It works for simple bean classes. Its no-brainer...

Using ANT to fix end of line problem in scripts or text files 0

Using ANT to fix end of line problem in scripts or text files

One of the ant tasks which has been overlooked is the one related to files. ANT can do some really useful things for us. When development environment is windows and deployment environment is *nix we always face the problem of ^M characters. The text files edited and saved in windows will have special...