Public Group

#### Archived

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

# Commenting above or below the line?

This topic is 5309 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 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 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 viewglOrtho( 0.0,w,h,0.0,0.0,100.0 );   // left, right, bottom, top, non-important, zNear, zFar

##### 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 on other sites
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 on other sites

glOrtho(left, right, bottom, top, near, far);

--
Dave Mikesell Software & Consulting

1. 1
Rutin
25
2. 2
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 14
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631757
• Total Posts
3002141
×