44 points

I’m Bill I don’t comment my code (except complex parts), instead I try to make code clear, including using proper variable and function names and try to keep functions short. I don’t think I ever got lost in my own code in my 20+ years of experience. Even got complements about it.

The programming language is meant for humans to read/write, if you need to put comments to understand your code then your code sucks.

permalink
report
reply
32 points

Commenting is an art. Too much and it is outright misleading after the first hotfix. Too little and only the original developer can maintain it

But uncommented code is a dick move. And, more importantly, it means you can’t punt bug fixes to the intern

permalink
report
parent
reply
18 points

Use comments to describe the philisophy of the code, the why. And any non obvious extended relationships. Risk. Etc.

Comments on function are typically a waste of space.

permalink
report
parent
reply
10 points

When writing basic business code, structuring the code well and having good naming standards means you shouldn’t need a ton of comments, but you should still have some. Plus, using structured function content blocks gives you intellisense in some languages and IDEs, which is important for code reuse in teams.

However, when I was doing scientific programming I’d have comments for almost every line at times where I put the mathematical formula and operations the line represents. Implementing a convolution neutral network with parameters to dynamically scale the layers or MPI stochastic simulations is much different than writing CRUD functions or basic business logic.

permalink
report
parent
reply
2 points

I think that makes you Phil, not Bill. Thanks for the good work you do Phil.

permalink
report
parent
reply
1 point

Comments are there to make your ctrl + f’s faster

permalink
report
parent
reply
33 points

Bill never revisits his code.

Bill is a contractor smart.

permalink
report
reply
15 points

NGL that is one of the best parts about being a contractor.

So many hackjobs. Sorry maintainers.

permalink
report
parent
reply
5 points

We all envy you more than we hate you

permalink
report
parent
reply
13 points

A technical debt escapist.

permalink
report
parent
reply
12 points

Bill changes jobs every two years to outrun the crushing weight of institutional responsibility.

permalink
report
parent
reply
25 points

Comments are lies that will happen sometime in the future

Comments are always overlooked if gode gets refactored. Language servers can’t/won’t parse them and they’re easy to overlook.

If you name your functions/variables clearly, put complex logic into clearly named functions and keep the same level of abstraction in every function (which never exceeds roughly 50 lines), you hardly need any comments, if any.

Comments are for behavior that’s not possible to convey clearly through code.

permalink
report
reply
7 points

If a block of code needs a comment, then you can easily move that block into a function and summarise the comment into a name for that function. If you can not easily move a block of code into a function, then you may need to rethink your design.

This isn’t always true of course, but it’s a good mindset to have.

permalink
report
parent
reply
20 points

Bill writes spaghetti code.

Bill is not smart.

Don’t be like Bill.

permalink
report
reply
13 points

Wow this job has massive amounts of unnecessary stress, I wonder what the cause can be.

The cause is me, 6 months ago.

(Written for comedic purposes only. Managers are my single source of stress)

permalink
report
reply
3 points

Me: writes code^1, doesn’t comment

Me, six months later: what idiot wrote this shit?!

  1. Only developer on project
permalink
report
parent
reply
3 points

Time to plan a 3-day workshop with yourself at the pub to get it together

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 7.2K

    Monthly active users

  • 954

    Posts

  • 36K

    Comments