9 Replies - 1601 Views - Last Post: 27 June 2012 - 06:27 AM

Poll: The Use of Proper Grammar in Code Comments and Documentation (14 member(s) have cast votes)

Do you use proper english grammar when writing comments in code?

  1. Yes (11 votes [78.57%])

    Percentage of vote: 78.57%

  2. No (2 votes [14.29%])

    Percentage of vote: 14.29%

  3. Sometimes (1 votes [7.14%])

    Percentage of vote: 7.14%

  4. Whenever I feel like it (0 votes [0.00%])

    Percentage of vote: 0.00%

Vote Guests cannot vote

#1 masoug  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 181
  • Joined: 30-December 09

Proper Grammar in comments.

Posted 12 May 2012 - 05:38 PM

I don't know about anyone else, but I like to keep my comments in code nice and consistent. Call me a nerd, but somehow I like to have comments with periods and capitalization in the right place. I wonder if anyone else tends to do this?

-Masoug
Is This A Good Question/Topic? 0
  • +

Replies To: Proper Grammar in comments.

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3712
  • View blog
  • Posts: 5,964
  • Joined: 08-June 10

Re: Proper Grammar in comments.

Posted 12 May 2012 - 05:56 PM

** Moved to Software Development **
Was This Post Helpful? 0
  • +
  • -

#3 sepp2k  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2089
  • View blog
  • Posts: 3,182
  • Joined: 21-June 11

Re: Proper Grammar in comments.

Posted 13 May 2012 - 04:08 AM

No, I don't use English grammar in my comments - I use Yoda speak:

// Print a string to the screen this method will. Not call it with a null argument you shall.
Was This Post Helpful? 1
  • +
  • -

#4 masoug  Icon User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 181
  • Joined: 30-December 09

Re: Proper Grammar in comments.

Posted 15 May 2012 - 02:54 PM

View Postsepp2k, on 13 May 2012 - 04:08 AM, said:

No, I don't use English grammar in my comments - I use Yoda speak:

// Print a string to the screen this method will. Not call it with a null argument you shall.


"May the source be with you."
Was This Post Helpful? 2
  • +
  • -

#5 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 1940
  • View blog
  • Posts: 4,028
  • Joined: 11-December 07

Re: Proper Grammar in comments.

Posted 17 May 2012 - 04:31 PM

*
POPULAR

I prefer to use comments to improve the grammar of my code.

		/*Define an*/ int/*eger variable to be used as the*/ counter/*.*/;
		/*Set the*/ counter = 0/*.*/;
		
		/*Repeat*/ while /*the*/(counter <= 10)/*.*/ {
			/*Calculate the*/ int/*egral*/ answer /*as*/ = 2 * counter/*.*/;
			/*With the default*/ System. out/*put stream, */.print( /*a formatted*/	String. /*with the*/ format("2 x %d = %d\n", /*substituting the*/ counter, /*and*/ answer))/*.*/;
			/*Update the*/ counter /*making it*/ = counter + 1/*.*/;
		}
		/*Make sure the default*/ System. out/*put stream is */ .flush()/*ed.*/;


Was This Post Helpful? 8
  • +
  • -

#6 sepp2k  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 2089
  • View blog
  • Posts: 3,182
  • Joined: 21-June 11

Re: Proper Grammar in comments.

Posted 17 May 2012 - 04:48 PM

Haha, that's awesome. Literate programming 2.0.
Was This Post Helpful? 0
  • +
  • -

#7 fromTheSprawl  Icon User is offline

  • Monomania
  • member icon

Reputation: 513
  • View blog
  • Posts: 2,056
  • Joined: 28-December 10

Re: Proper Grammar in comments.

Posted 17 May 2012 - 05:54 PM

Yes, it's a must. Especially if you're working with complex computations and multiple methods that almost look the same with each other. Or lose your sanity. Your choice.
Was This Post Helpful? 0
  • +
  • -

#8 turboscrew  Icon User is offline

  • D.I.C Addict

Reputation: 100
  • View blog
  • Posts: 615
  • Joined: 03-April 12

Re: Proper Grammar in comments.

Posted 19 May 2012 - 01:29 AM

View Postcfoley, on 18 May 2012 - 02:31 AM, said:

I prefer to use comments to improve the grammar of my code.

		/*Define an*/ int/*eger variable to be used as the*/ counter/*.*/;
		/*Set the*/ counter = 0/*.*/;
		
		/*Repeat*/ while /*the*/(counter <= 10)/*.*/ {
			/*Calculate the*/ int/*egral*/ answer /*as*/ = 2 * counter/*.*/;
			/*With the default*/ System. out/*put stream, */.print( /*a formatted*/	String. /*with the*/ format("2 x %d = %d\n", /*substituting the*/ counter, /*and*/ answer))/*.*/;
			/*Update the*/ counter /*making it*/ = counter + 1/*.*/;
		}
		/*Make sure the default*/ System. out/*put stream is */ .flush()/*ed.*/;



COBOL reinvented? :lol:

I tend to use both full sentences, but also "spoken language" and other notations.

/* Positive? */
if (x < 0)
{
  /* No can do */
  print_error();
}

Was This Post Helpful? 0
  • +
  • -

#9 ankurwase  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 10
  • Joined: 12-June 09

Re: Proper Grammar in comments.

Posted 26 June 2012 - 11:58 PM

Speaking Language :)
Was This Post Helpful? 0
  • +
  • -

#10 anonymouscodder  Icon User is offline

  • member icon

Reputation: 126
  • View blog
  • Posts: 710
  • Joined: 01-January 10

Re: Proper Grammar in comments.

Posted 27 June 2012 - 06:27 AM

Of course. This poll is kinda stupid.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1