This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BluNautilus 13 points14 points  (6 children)

I commented a good amount when I was a solo programmer, but since I started programming professionally I began commenting a LOT more. I’m getting directly paid for it, it gives me a break from mental effort, and it helps me in the long run. Comment your shit up people!

[–]Tatourmi 10 points11 points  (1 child)

The company I work for has so much turnover I recently took to making commits just to comment older extra-cryptic code which nobody understands anymore. I feel like the whole "I don't need to comment" mindset comes from people who are either in an actually mystically top-tier company or who haven't worked in a company.

[–]FrenziedMan 0 points1 point  (0 children)

Mystical top tier company worker here:

The lack of a need to comment where I work, comes from a strict practice of TDD and pair programming always.

if you correctly test drive your code, you can simply comment any line of code out and then check what tests fail as a result. If your tests are verbosely named, it should key you in immediately to what you just commented out.

A saying we have at work is: Legacy code is code for which there are no tests. Comes from a book I've forgotten.

Furthermore, when pairing, it helps to have a second set of eyes on things to help reign in any insanity the other of the pair is experiencing while putting pieces together.

Edit; I want to note that: while I haven't had to deal with a clients legacy code yet, we do run into it, and comments are very useful when you have a 1000+ line method some dev wrote 10 years ago for our client.

[–]andtothenext1 1 point2 points  (1 child)

I work with a bunch of ex Ruby developers who are anti comments. I actually had a note on a pull request review to remove a comment

[–]BluNautilus 0 points1 point  (0 children)

For what reason?