In many languages, theThe syntax function_name(arg1, arg2, ...) is used widely across various programming languages to callinvoke a function. When we want to call the function without any arguments, we must do function_name().
I find it strange that a compiler or interpreter would require () in order to actually detect it as a function call.Why is it necessary for the compiler or interpreter to require () to recognize it as a function call? If something is known to beinherently callable, why wouldn't function_name; be enoughsuffice to execute it?
On the other hand, in someIn certain languages we, you can do:execute a function or command using syntax such as function_name 'test'; or even function_name 'first' 'second'; to call a function or a command. Bash is one example. Some constructs (e.g., 'echo' or 'include') operate this way as well, like in PHP.
I thinkCould parentheses would have been better if they were only needed to declarereserved solely for establishing the order of priorityprecedence, and in other places weremaking them optional. For example elsewhere? For instance, doing if expression == true function_name; should bewould've been as valid as if (expression == true) function_name();.
An especiallyA particularly interesting case is writingthe use of 'SOME_STRING'.toLowerCase() when clearlyin JavaScript, where no arguments are neededrequired by the prototype functionmethod. Why did thelanguage designers decideopt against the simpler 'SOME_STRING'.lower design in this case?
Disclaimer: Don't get me wrong, I quite lovegenuinely appreciate the syntax design of the C-like syntaxesinspired languages! I'm just asking formerely curious about the reasoningrationale behind itthis design choice. Does requiring () haveprovide any actual advantagesgenuine benefits, or does it simply make theenhance code more human readablereadability for humans?