Sunday, December 6, 2009

How to write logical comments in java?

i know we put // but do we write comments before the logic or after?



How to write logical comments in java?

Doesn't really matter, as long as they are their. If you write them before say :



//The logic below does this



and if you write them after say:



//the logic above does this



It's often better to write them before so that someone reading the code will know what a piece of code does before actually reading it, which will save precious time trying to decipher it if it was after the actual code



How to write logical comments in java?

either way, both are correct.



sometime, we might be unsure if a certain function would work or not. It would be preferably write the comments later. But if you're certain that your function would work. then writing the comments before the logic will still to.



How to write logical comments in java?

either way , but it makes much more sense to write it before !!

No comments:

Post a Comment

 
commericial loan