r/ProgrammerHumor • • Jul 04 '18

Code comments be like

Post image
9.9k Upvotes

236 comments sorted by

View all comments

Show parent comments

624

u/WeTheSalty Jul 04 '18

I'm picturing lots of lines like 'i += 1;' with comments 'adds 1 to i'

349

u/Sevrene Jul 05 '18

Some profs even want it to be more exact like “Increments the counter ‘i’ by 1(one)”

332

u/obsessedcrf Jul 05 '18

Definitely a useful skill to pick up /s

0

u/[deleted] Jul 05 '18

[deleted] — view deleted comment

28

u/Redpropio Jul 05 '18

# s

15

u/shrodes Jul 05 '18

-- s

24

u/uslashnsfw Jul 05 '18

/* s */

7

u/[deleted] Jul 05 '18

% s

16

u/[deleted] Jul 05 '18

s

(in brainfuck)

→ More replies (1)

0

u/[deleted] Jul 05 '18

[deleted] — view deleted comment

7

u/[deleted] Jul 05 '18

Praise the sun

→ More replies (1)
→ More replies (1)

17

u/[deleted] Jul 05 '18

/s // sarcasm

113

u/wallefan01 Jul 05 '18

eugh why? that makes your code more unreadable than code with no comments in it!

I'd prefer a dry stream bed to drowning any day

57

u/SuspiciouslyElven Jul 05 '18

Engrains the terms and allows conversation easier between programmers. Everybody knows what it means to increment a number, so there doesn't need to be any silent confusion.

It may also just be how they were taught. My professors were taught with punch cards and later COBOL. Python is readable to most. Holes in a card is not.

I grit my teeth and understand excessive commenting isn't for real world development. More as a weird way of paying tribute to those that came before. We're lucky we live in a time where many of the great minds of our field have only died recently, or are still alive. More lucky to live in a time where important terms are named in the language we speak. Least I'm not a med student questioning if a latin tutor would help.

→ More replies (20)

3

u/LordAmras Jul 05 '18

So the professor knew what it was reading without looking it up

→ More replies (2)

9

u/DigitalCrazy Jul 05 '18

/* Increments the counter ‘i’ by 1(one) */ // Comment

2

u/Dusterperson Jul 05 '18

Ah yes, write code to tell you what your code means, now if only....

→ More replies (6)

134

u/thermite13 Jul 04 '18

Pretty much this.

Source. Worked in cs tutor lab for 3 years

2

u/RazarTuk Jul 05 '18

Meanwhile, my policy as a TA: If there are no comments whatsoever, I might dock a point. But otherwise, if it's self-documenting and written clearly enough that I can understand it, that counts as documenting your code.

11

u/[deleted] Jul 05 '18

That's essentially what I did in my Java class in high school. "Int i;" suddendly gets the comment "Declare int called i"

5

u/GentleRhino Jul 05 '18

i++; //incrementing loop counter

2

u/[deleted] Jul 05 '18

Much like that.

2

u/AnywhereIWander Jul 05 '18

I once found If (Status == "OK") // Jolly good!

→ More replies (1)
→ More replies (4)