this post was submitted on 28 May 2025
698 points (96.2% liked)

Programmer Humor

23545 readers
2024 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
 

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
[โ€“] driving_crooner@lemmy.eco.br 6 points 1 day ago (1 children)

Does everyone call the function of the script main? I never use main(), just call the function what the program is supposed to do, this program calculates the IBNR? The function is called calculate_IBNR(), then at the end of the script if name = 'main': calculate_IBNR(test_params) to test de script, then is imported into a tkinter script to be converter to an exe with pyinstaller

[โ€“] Whelks_chance@lemmy.world 3 points 16 hours ago

All of mine are called do_thing() because after a few days of working on it, the scope creep always means the original name was wrong anyway.