this post was submitted on 28 May 2025
39 points (91.5% liked)

Programming Humor

3211 readers
1 users here now

Related Communities !programmerhumor@lemmy.ml !programmer_humor@programming.dev !programmerhumor@kbin.social !programming_horror@programming.dev

Other Programming Communities !programming@beehaw.org !programming@programming.dev !programming@lemmy.ml !programming@kbin.social !learn_programming@programming.dev !functional_programming@programming.dev !embedded_prog@lemmy.ml

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
[–] stupidcasey@lemmy.world 1 points 1 month ago

Ok, here me out, this actually makes more sense NONO!, put your pitch forks down.

Think about it, defining the entry point like any other function is rather confusing and doesn't distinguish it's importance and different function in coding, the entry point is more than just where the program starts, well it is but the entry point sometimes needs to be redefined because the hardware or software requires it, for example when running C on an X86 processor you have to redefine the entry point like so:

void _start() {
}