Earlier quoted context omitted.
It’s only weird syntactically. Python tends to lean towards intuitive, natural language by default. I would have assumed they’d have created a syntactically straightforward alternative, like: __this_file__ == “__launch_file__” or similar. I understand python values “only one way” of doing things, but it would be helpful for readability.
No, the “readable” shortcut would have been if __main__: There are no magic strings to remember and the IDE can help you look up variables.
I honestly think one of the main reasons why python is so successful is as simple as:
print "Hello world!"
...and later: print("Hello world!")
It might not seem like much, but when you're asking someone to pick up a language outside of a classroom setting, it's just much more intuitive than: echo "Hello world!";
or: console.log("Hello world!");
or god forbid: public class GFG{
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
These little things matter in the long run, even if they don't seem like they matter when you're already fluent.