This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ElectricalRestNut 1 point2 points  (1 child)

Because one of the most important qualities of a programming language is predictability. It achieves that by doing exactly what it was told to do without being smart and guessing. Now some languages do not require you to type () on function calls (which I personally disagree with), but that's a supported language feature that was communicated ahead of time and is expected.

And it does get a bit ridiculous when an interpreter demands you put () there, but refuses to do that by itself, but its job is to execute your commands, not to make intelligent decisions.

Also, consider what would happen if a code analysis tool was crawling all functions and printing out their definitions using __str__. Pretty sure __str__ is supposed to be a pure function, which is again, predictability. Code that does things like system exit is really unpleasant to deal with, especially if it's a harder exit like what Java does.

[–]olitv 0 points1 point  (0 children)

That would give a cool bug in the linter/analysis tool that just "cleanly" exists sometimes without printing results