this post was submitted on 09 Oct 2026
845 points (97.6% liked)

Programmer Humor

33550 readers
673 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 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] desmosthenes@lemmy.world 3 points 1 day ago (1 children)

python, haskell, lua, typescript, babel, shell (newline), I dunno what else nowadays - the compiler will insert them need be

[โ€“] cows_are_underrated@feddit.org 3 points 20 hours ago* (last edited 19 hours ago)

The reason I dislike the missing of semicolons and brackets is because it causes bugs (that's more of a problem of missing braces to declare the scope of your code) and also takes away control from the programmer.

Missing braces:
I had more than one instance where I accidentally deleted the intendation in a python script that caused undefined behaviour in my code and it took quite a lot of time to track that down. If the programming language would have forced me to properly defined the scope of my code by introducing brackets, that bug would have never been possible.

Semicolons:
The main thing I like about semicolons is that it allows you to properly space out your code over multiple lines for visual clarity. E.g.:

void my_function(int arg1, int arg2, int arg3){
  //some code
}

int main(){
  my_function(
    1, //arg1
    3, //arg2
    8 //arg3
  );
}

Python should allow this too, since the arguments are being defined inside brackets, but other languages have no similar functionality (e.g. shell, but that is a little bit unfair, since you can't even specify arguments) forcing you to put everything into a single line.

Rust even allows you to leave out the semicolon on the last statement of a code scope in order to return the result of the statement:

fn main() {
    let condition = true;
    let number = if condition { 5 } else { 6 }; 
    //number turns into 5, since the value is being returned due to the missing semicolon.

    println!("The value of number is: {number}");

    let number = if condition { 5; } else { 6; }
    // this should return null (if it even compiles)
}