General YPN >> Programing standarts.
Posted by nonama on 20:51:00 02-19-2002
i think we should make programing standars. i mean everybody says there are no lollipop thing, but when i submit a code i get ratings like comments needed or something. so what is needed? huh?


aurimas
Posted by fsvara on 21:14:00 02-19-2002
comments are always good... no need for some standard for that.
Posted by Mintegra on 21:20:00 02-19-2002
It would be cool if someone would write a utility like javadoc for C. Or is there already one?
Posted by SilentStrike on 22:30:00 02-19-2002
Doxygen... http://www.doxygen.org

It generated the docs that are linked from the main page of my game, bomberlan. http://bomberlan.sf.net , incase you want to see what the produced docs look like. The Parser module is pretty well commented, while stuff in the Game module is nearly bare, so the source docs are pretty bad for the Game module as of now.


[ This Message was edited by: SilentStrike on 2002-02-19 22:33 ]
Posted by sacah on 04:29:00 02-20-2002
I beleive it was me who said comments needed, Im sure you have read lotsa code that had comments throughout code, thats all, its just what you feel would make it easier for someone else to look at and understand. There are no standards, everyones dif. just do what you feel, it will be better than nothing.
(-:
Posted by Peter on 07:07:00 02-20-2002
well I always note on comments if I think there's a need for it.. one good "standard", if any, is that people should be able to understand what you're doing, even if they aren't at your skill level...
Posted by KaGez on 12:36:00 02-20-2002
well, if you submit a code snippet, it's absolutely nothing worth if nobody understands it. Therefore, even if it's a program with sources, I will ofcourse rate things - especially code snippets - better if they are well commented, so that you can understand em, even without checking 1000s of dependencies between variables ...
[addsig]
Posted by fsvara on 12:42:00 02-20-2002
to much documentation isn't good either, tho...
something like
/* Print hello world to the screen */
printf("Hello World\n");
is exaggerated and actually quite annoying.

So, there's no standard, and i think it would be pretty hard to make one... Cause maybe a beginner would actually like printf("hello world") to be explained in a comment

So, my idea of a "standard" for comments would be simply: If you think it's not clear at first sight, comment it.
The, i also like putting a comment as the first line in a function that briefly explains what the fucntion does, what it returns and stuff, so that you dont have to read the entire function to understand what it is used for in othe rparts of the code.