Tagged: Code

The Bad Code Offset 7

The Bad Code Offset

All of us at one time or the other written bad code. Now we cant go back and correct it, but we can offset it by buying “The Bad Code Offset“, just like how big companies buy “carbon offset”. The money spent on buying “The Bad Code Offset” is sent to these five...

Logging uncaught exception (redirecting from sysout to logger) 0

Logging uncaught exception (redirecting from sysout to logger)

Uncaught exceptions in Java are handled by the System. The JVM usually logs the exception into the System.err and then shuts down. But in case of web applications its different. It logs the printstack trace to server console and then continues. Even though most of the time System.err is redirected to a file...

My code contribution during foss.in/2008 jFotoNotes 2

My code contribution during foss.in/2008 jFotoNotes

I am attending FOSS.IN/2008 virtually through twitter (unfortunately I could not attend due to work pressure). Here is my contribution to the FOSS world as part of FOSS.IN/2008. Go to jFotoNotes project page jFotoNotes is java implementation of famous FotoNotes in php. A variation of FotoNotes is also used by flickr. Fotonotes is...

WordPress Comment Plugin for Indic Languages 7

WordPress Comment Plugin for Indic Languages

Last few days I have been reading more books, coding more scriptlets than twittering or blogging here. I am yet to decide on coffee project of this month. I might send it to Wikimedia Foundation as I don’t have any other project in my mind. Two weeks back I was at Google Developer...

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...