224

Also, do y'all call main() in the if block or do you just put the code you want to run in the if block?

you are viewing a single comment's thread
view the rest of the comments
[-] fushuan@lemm.ee 11 points 2 days ago* (last edited 2 days ago)

I'm gonna repeat what I wrote in another comment. You are comparing the default interpreted way of running python~~g~~ to a compiled language. When you compile a python program into a wheel, you define the entry points of the code on it, and they point to functions like main() or whatever you define.

You aren't complaining that a index.js doesn't automatically run the main function when run by node, or that bash doesn't also have a default main function execution. Interpreted languages oriented to scripting won't have the same rules as compiled languages.

programming languages aren't usually cursed, what's cursed is the way some people decide to structure their programs. I've seen some stuff.

[-] hdnsmbt@lemmy.world 6 points 2 days ago

pythong

Glad to see I'm not the only one who can't type python without Sigmund waving hello.

[-] fushuan@lemm.ee 1 points 2 days ago

It's my fucking keyboard. I'm all in for open source and stuff but it's too much, I had to go back to proprietary ones because the other ones just suck for multi language inputs :(

[-] itslilith@lemmy.blahaj.zone 3 points 2 days ago

Some programming languages are indeed cursed (e.g. JavaScript). But for the most part I agree, it's what people do with it. But what's cursed with python is what idioms have become common place.

load more comments (-1 replies)
this post was submitted on 28 May 2025
224 points (96.7% liked)

Programmer Humor

35897 readers
1334 users here now

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

Rules:

founded 5 years ago
MODERATORS