37 points

Whos the fucking idiot that wro… oh it was me.

permalink
report
reply
6 points

This is me with code I write now

permalink
report
reply
17 points

Writing really good comments is an under-appreciated skill.

permalink
report
reply
7 points
*

// don’t know anymore, just leave this block alone

permalink
report
parent
reply
16 points

Even though comments are very helpful, often it’s even enough to name variables and methods/functions really good. At least do that. You don’t want i, j and value. Believe me. You want rowCount, colCount and deliveryOption instead. You just may not know it now, but you will, when it has to be changed in a few months.

permalink
report
parent
reply
1 point

Where comments are useful most is in explaining why the implementation is as it is. Otherwise smart ass (your future self) will come along, rewrite it just to realize there was indeed a reason for the former implementation.

permalink
report
parent
reply
10 points

Comments are good when you’re doing something weird to handle an edge case or something. But yeah most of the time clear variable names, and extracting complicated code to a dedicated and clearly named function, are enough.

There are only two hard things in Computer Science: cache invalidation and naming things.

Phil Karlton

permalink
report
parent
reply
9 points
*

I was once like “🤨… what drugs was I on when I wrote this 🤨”. Comments didn’t help, I must’ve been under the influence of something, it didn’t make any sense.

The weird thing is, it works 😂.

permalink
report
reply
2 points

You gotta comment what drugs you were on when you wrote the code

permalink
report
parent
reply
1 point

Darn, forgot to do that.

permalink
report
parent
reply
25 points

Considering last year was six days ago…I agree.

permalink
report
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

  • 7K

    Monthly active users

  • 1.2K

    Posts

  • 41K

    Comments