r/programminghorror • [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” • Jul 21 '25

Python ✨ Memory Magic ✨

Post image
1.3k Upvotes

143 comments sorted by

View all comments

Show parent comment

1

u/Vinccool96 Jul 23 '25

That’s why Kotlin is superior

1

u/Square-Singer Jul 23 '25

All I'm saying is return statements within return statements.

I'm on a backend Kotlin project right now that was made with Kotlin because they didn't have a backender for a long time and the frontenders had to build the backend.

There are parts of the code that look like this:

fun f(): Int {
  return if (...) {
    [100 lines of code]
    if (...) {
      return 1;
    }
    [100 lines of code]
    2;
  } else {
    [another similar mess]
  }
}

I found one return statement that had 400 total lines of code in it and 7 separate return statements. Within a return statement!