this post was submitted on 13 Dec 2025
643 points (97.6% liked)

Programmer Humor

27898 readers
2178 users here now

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

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] OshaqHennessey@midwest.social 63 points 4 days ago (4 children)
function myFunction() {
  try {
    x = new Random().nextInt();
    if (x != 10) {
     throw "not 10";
    }
    else {
      return (10)
    }
    catch(err) {
      myFunction()
    }
  }
}

x = myFunction()

Commit notes: Added error handling

[–] NikkiDimes@lemmy.world 4 points 4 days ago (1 children)

SyntaxError: Unexpected token 'catch'

[–] OshaqHennessey@midwest.social 9 points 4 days ago

Coding on mobile is hard

load more comments (2 replies)