3 ms·
I've seen many scripts wrapping steps inside a main() function and calling it just after declaration. If the justification is to localize variables which shoul
by txutxu 13y ago
I've seen many scripts wrapping steps inside a main() function and calling it just after declaration.
If the justification is to localize variables which should be global, and still will look like "global" to the rest of the program, it's ok.
But this is mainly used without sense, by personal tastes, and usually only makes sense to the author and does not have any real benefice.
I prefer the concept "consistency is to not read unuseful steps", instead of "add unuseful steps for consistency". That's how I think when I read code.