Whether to use punctuation in comments or not?
-
Ah! So that is what that comment was in my colleague's code. I thought he was trying to draw a frame from The Simpsons.
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
Heh. I've also used ASCII logos, and that ASCII-art version of the cover from Fear and Loathing in Las Vegas... Whatever best describes the code, ya know? ;)
----
I don't care what you consider witty, but at least I do not blather on posting nonsense like Jim Crafton.
-- Stringcheese, humbled by Crafton's ability to string together multiple sentences
-
// Yes.
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
// No But then you knew I was going to say that, eh? ;P
// Seriously though, I don't put periods at the end of my comments, but I will
// .. for a sentence break in the middle of one. Why? I really have no idea,
// .. it has always been that wayThen again, I am one of those weird people who still uses two spaces after a period for readability.
Ðavid Wulff What kind of music should programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milk -
And if you can work some ASCII art in, all the better.
/* /\
//\\
//\\
//\\
||
|| */regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
Cool! I actually *do* have ascii art in all my projects source code comments at some point or another. I figure it will amuse someone some day down the road since no one else ever looks at the great majority of my code anyway. It serves a useful purpose in denoting blocks of commonly related code such as separating the Microsoft auto generated form code in c# winform projects from my own code:
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
//( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
"I don't want more choice. I just want better things!" - Edina Monsoon
-
I would be thankful if someone tell me the answer. What is the standard usage? In the easiest, I mean I would like to know whether to put . at the end of my comment or not:)
If you program in, say, C# do you sometimes put a semi-colon at the end of a statement and sometimes not? No, because the compiler rejects the code as being incorrect. In my opinion, the same standard for quality and accuracy should be applied to comments as well. Why write beautiful code and then decorate it with ignorant boogers?
:josh: My WPF Blog[^] The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it. - Michelangelo (1475-1564)
-
// No But then you knew I was going to say that, eh? ;P
// Seriously though, I don't put periods at the end of my comments, but I will
// .. for a sentence break in the middle of one. Why? I really have no idea,
// .. it has always been that wayThen again, I am one of those weird people who still uses two spaces after a period for readability.
Ðavid Wulff What kind of music should programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milkGood idea actually though I tend to just indent paragraphs. So far I've written half my life story into my code...
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
-
Good idea actually though I tend to just indent paragraphs. So far I've written half my life story into my code...
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
Paul Watson wrote:
So far I've written half my life story into my code...
awesome
----------------------------------------------------------- Completion Deadline: two days before the day after tomorrow
-
I would be thankful if someone tell me the answer. What is the standard usage? In the easiest, I mean I would like to know whether to put . at the end of my comment or not:)
If it's a sentence, write it like a sentence. If it's fragment, don't end it with a period. Marc
-
Good idea actually though I tend to just indent paragraphs. So far I've written half my life story into my code...
regards, Paul Watson Ireland & South Africa
Shog9 wrote:
And with that, Paul closed his browser, sipped his herbal tea, fixed the flower in his hair, and smiled brightly at the multitude of cute, furry animals flocking around the grassy hillside where he sat coding Ruby on his Mac...
-
If you program in, say, C# do you sometimes put a semi-colon at the end of a statement and sometimes not? No, because the compiler rejects the code as being incorrect. In my opinion, the same standard for quality and accuracy should be applied to comments as well. Why write beautiful code and then decorate it with ignorant boogers?
:josh: My WPF Blog[^] The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it. - Michelangelo (1475-1564)
Josh Smith wrote:
Why write beautiful code and then decorate it with ignorant boogers?
Variety is the spice of life? :-D
-
Josh Smith wrote:
Why write beautiful code and then decorate it with ignorant boogers?
Variety is the spice of life? :-D
hlmechanic wrote:
Variety is the spice of life?
In that case, I think I'll write all my comments in a mixture of ebonics and textspeak...
// yo bi4tch! dis cod3 be 4xin d4 us3r if d4 foo w4nn4 s4v3 dis shiznit?
:josh: My WPF Blog[^] The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it. - Michelangelo (1475-1564)
-
Cool! I actually *do* have ascii art in all my projects source code comments at some point or another. I figure it will amuse someone some day down the road since no one else ever looks at the great majority of my code anyway. It serves a useful purpose in denoting blocks of commonly related code such as separating the Microsoft auto generated form code in c# winform projects from my own code:
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
//( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
"I don't want more choice. I just want better things!" - Edina Monsoon
-
If you program in, say, C# do you sometimes put a semi-colon at the end of a statement and sometimes not? No, because the compiler rejects the code as being incorrect. In my opinion, the same standard for quality and accuracy should be applied to comments as well. Why write beautiful code and then decorate it with ignorant boogers?
:josh: My WPF Blog[^] The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it. - Michelangelo (1475-1564)
-
Cool I luv the idea;). Do you know any simple program that creates me bigger texts(e.g. 3 lines by height) in ascii?
There are dozens of them online, here's the first one that google returned: http://www.network-science.de/ascii/[^] There are also plenty that can turn a gif or jpg into ascii which you can then paste in your comments as well. The possibilities are endless. ;)
"I don't want more choice. I just want better things!" - Edina Monsoon
-
I would be thankful if someone tell me the answer. What is the standard usage? In the easiest, I mean I would like to know whether to put . at the end of my comment or not:)
Full on English in function headers and comments and fair better english than here :) i still need to get a plug in for VS 2005 for my spelling mistakes however It does help you and other people in say 6months time when you need to review/update/repair/toubleshoot a big project. so if its a poll i vote yes :)
-
// No But then you knew I was going to say that, eh? ;P
// Seriously though, I don't put periods at the end of my comments, but I will
// .. for a sentence break in the middle of one. Why? I really have no idea,
// .. it has always been that wayThen again, I am one of those weird people who still uses two spaces after a period for readability.
Ðavid Wulff What kind of music should programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milkDavid Wulff wrote:
two spaces after a period for readability.
No school like the old school... That's exactly how I was taught back in the mid 80's. Two spaces after a full stop, one after a comma.
------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!
-
Paul Watson wrote:
So far I've written half my life story into my code...
Half my life story is my code... :~
You must be careful in the forest Broken glass and rusty nails If you're to bring back something for us I have bullets for sale...
-
// No But then you knew I was going to say that, eh? ;P
// Seriously though, I don't put periods at the end of my comments, but I will
// .. for a sentence break in the middle of one. Why? I really have no idea,
// .. it has always been that wayThen again, I am one of those weird people who still uses two spaces after a period for readability.
Ðavid Wulff What kind of music should programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milkDavid Wulff wrote:
I am one of those weird people who still uses two spaces after a period for readability.
I still think it's weird. What flummoxes me is that you and CG are otherwise good users of English, but both have a practice that I find rather strange - you using two spaces after a full stop, and Christian using a space before a question mark.
Cheers, Vıkram.
After all is said and done, much is said and little is done.
-
I would be thankful if someone tell me the answer. What is the standard usage? In the easiest, I mean I would like to know whether to put . at the end of my comment or not:)
-
David Wulff wrote:
two spaces after a period for readability.
No school like the old school... That's exactly how I was taught back in the mid 80's. Two spaces after a full stop, one after a comma.
------------------------------------------- Don't walk in front of me, I may not follow; Don't walk behind me, I may not lead; Just bugger off and leave me alone!!
-
David Wulff wrote:
I am one of those weird people who still uses two spaces after a period for readability.
I still think it's weird. What flummoxes me is that you and CG are otherwise good users of English, but both have a practice that I find rather strange - you using two spaces after a full stop, and Christian using a space before a question mark.
Cheers, Vıkram.
After all is said and done, much is said and little is done.
I would never put a space before punctiation, only after. The purpose of double spacing after periods is to aid skim reading because it more clearly breaks up large blocks of text. It is a left over from mono-spaced typewriter days, bit it still applies with today's typefaces and you will find it in newspapers, posters, adverts, etc -- anything that is designed to be quick and easy to read.
Ðavid Wulff What kind of music should programmers listen to?
Join the Code Project Last.fm group | dwulff
I'm so gangsta I eat cereal without the milk