Archived

This topic is now archived and is closed to further replies.

d0hboy

Commenting above or below the line?

Recommended Posts

Ok, I have to admit this is retardedly trivial, but what looks better in terms of coding / style convention?
// set a 2D parallel projection view
//		 left	right	bottom	top		zNear	zFar
glOrtho( 0.0,	w,		h,		0.0,	0.0,	100.0 );
 
OR
// set a 2D parallel projection view
glOrtho( 0.0,	w,		h,		0.0,	0.0,	100.0 );
//		 left	right	bottom	top		zNear	zFar
 
It didn''t really dawn on me the difference until I played around with it and wondered what an industrial strength coder would do.

Share this post


Link to post
Share on other sites
I think it''s like you want it. If you prefer above, then do above. If u work with other people, tell them to pick one convention, then it is easier for everybody to read.

Kiruagon

Share this post


Link to post
Share on other sites
It really doesn''t matter, just as long as you are consistent throughout all your code. So if you want to go with the lower one (which does look pretty ok) you need to do it throughout all source files, otherwise confusion might arise.

Then later, if you get employed at a company that has their own convention of writing comments then you''ll have to stick to it.

If you ask me, I''d do it like this if I had to know the various variables:


// set a 2D parallel projection view
glOrtho( 0.0,w,h,0.0,0.0,100.0 ); // left, right, bottom, top, non-important, zNear, zFar

Share this post


Link to post
Share on other sites

//pretty!;)

glOrtho( 0.0, /* left */
w, /* right */
h, /* bottom */
0.0, /* top */
0.0, /* zNear */
100.0, /* zFar */
);




------------------------------------------------------------
// TODO: Insert clever comment here.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
drowner :hehe.. I''ve seen something like that as well.. In fact, in many ways that''s usually preferred.. But that could be just me..

In the end, it all comes down to follow your team''s coding style.. If you are all by yourself, then it''s whatever you feel like.

Share this post


Link to post
Share on other sites