3 ms·
This article really complicates a simple concept: EVERY program needs a main(). Period. Whether it is called "main()" or ".ORG", or it is just an address given
by staycoolboy 6y ago
This article really complicates a simple concept: EVERY program needs a main(). Period. Whether it is called "main()" or ".ORG", or it is just an address given to a linker map, or simply a hex address in a BIOS boot sequence. There is no avoiding it: one instruction must come first.
Python, Perl, Ruby, Bash and every other scripted interpreted language IMPLICITLY wraps "main" around your program based on the context, otherwise it wouldn't know where to start.
I find this article obfuscating a simple point.
EDIT: When I say .ORG, I'm referring to the standard assembly language designation for "execute this instruction first", and not ICANN. ;)
- munk-a 6y agoYup - and even the most obfuscated language's main (PHP) has a single entry point - that entry point is just in apache[1] which figures out which of your bazillion PHP files to execute. This article is bordering on nitpicking. 1. Or whatever other webserver - and actually you can directly invoke PHP via CLI, but I'm ignoring those for the most common way people tend to use it.