Hi All,
Recently I started to go through the MifOS code to fix a bug assigned to
me.
Looking at the code I would like to make some comments and want everyone
to *seriously* follow the general coding standards.
I have noticed :
i) Most code does not have javadoc comments, it will be helpfull for
others to understand the code when they work on it.
Specially for opensource projects there should be 2 lines of comments
for every logical statement. Dont just think like a
coder when writing code, think as a analyst, this will help you to
write more comments.
ii) Proper naming for java classes. I saw some class names are too long
while others are too short with lots of shortnames.
Also the class name should be meaningfull and the name should reflect
what it does.
Ex. There is a class called AccountActionDateEntity. Now this class
holds the information about the actions taken on an account
so the name AccountActionEntity would be better option than
AccountAction"Date"Entity.
iii) Bullet (ii) also applies to method names.
iv) Logging : Some classes log too little and other too much. Its upto you
as to what logs you want to view when you want to fix a bug/issue.
Also the logging level needs to be checked before writing a message
to a log.
Ex : When when logging something at debug level.
if(log.isDebugEnabled()) {
log.debug(".......................", e);
}
This practice will help in not using resources used to generate the
log statements which will end up not being logged.
The MifosLogger does not provide the interface to check if the log
levels are enabled or not, maybe we will need to do so.
I would suggest that when you are fixing some bug and pass thru some
complicated code and you understand the logic of it then just add the
comments on it if they dont exist.
Thanks and regards
*ravi-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/