this post was submitted on 09 Oct 2026
869 points (97.7% liked)

Programmer Humor

33565 readers
1010 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
[–] cows_are_underrated@feddit.org 2 points 1 day ago* (last edited 1 day ago) (2 children)

Hear me out, but whatever lunatics at python decided that brackets and semicolons are unnecessary, have made a catastrophic mistake with it. I start using another editor that uses different amount of spaces for tabs and suddenly my code no longer runs. Its also absolutely horrible when you chase down a bug for an hour just to realise, that one additional/missing tab changed the scope of your code and broke your entire script.

[–] rumschlumpel@feddit.org 2 points 1 day ago

4 spaces is best and everyone else is wrong IMO

[–] 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 1 day ago* (last edited 1 day 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)
}