19 points

I once worked with a senior dev who wrote all his array iteration for loops with no condition e.g “for int i = 0 ;; i++” and added an “if i == array.length then break” type condition to the end of every block… And he genuinely didn’t see this as a problem at all.

permalink
report
reply
12 points

This was something I did in school to fuck with the teacher. He said all he cared about was output so as long as the code all worked, we could make it as stupid as we want. He taught us really good basics though. Really encouraged us to learn more about coding ourselves so that we could make the next best shitpost for the class. My favorite was creating stupid arithmetic functions. What the fuck is i++? I only know the function increaseIByOne

permalink
report
parent
reply
14 points

It really needs a fourth block that just says “Python”.

(For those who don’t get the joke, in Python the way that one exits a loop over an iterator is to keep going until the iterator throws an exception. It sounds dumb at first, but in truth, that’s only if you think that exceptions are incredibly heavyweight compared to other operations.)

permalink
report
reply
6 points
permalink
report
parent
reply
13 points

Wait till you find out you can do everything with recursion

permalink
report
reply
5 points

Haskell has entered the chat

permalink
report
parent
reply
2 points

This is the way

permalink
report
parent
reply
1 point

Not in every language, though.

permalink
report
parent
reply
7 points

If you think about it, while-true is just goto

permalink
report
reply
6 points
*

Segmentation fault (core dumped) is fun guys

permalink
report
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 3.7K

    Monthly active users

  • 1.5K

    Posts

  • 35K

    Comments