By using this site, you agree to our Privacy Policy and our Terms of Use. Close

Forums - General - Does anyone here know java?

nightsurge said:
HappySqurriel said:

I have worked professionally as a C# and Java developer and I have worked with C++ (and heavily used C++ in school) ... The differences between these languages are (pretty much) irrelevant, and the underlying principles that lead to good design are what is really important.

 

Good you can answer a very big question of mine.  Something that's been annoying me for ages now.

In the professional setting, how big of a deal was commenting, and how thoroughly did you have to do it?  It seems like each new CS professor I have, they introduce a different guide for commenting, and they all place differing levels of importance on it.  One class didn't require much at all.  One class wanted comments every single line.  The current class I'm in wants us to use JavaDoc and that seems like the most commenting and way more than necessary....

My personal opinion, and it seems to be fairly well spread throughout the industry, is that if your code needs a lot of commenting to explain what is being done it is probably too complicated or it is poorly structured. Certainly, if you're producing interfaces of some sort the functions should be well documented on how they're supposed to be used and what they do, but if your code is well broken up and your classes, functions and variables are well named commenting is not really all that necessary.

Why heavy-weight commenting is necessary in school is because (since you're just learning) your code is not well structured, your class, variable and function names are not well named and the professor/TA has to figure out how your (probably broken) code works in order to assign a grade to it.