Re:WTFPython – Understanding Python through surprising snippets
by XuMiao on Monday December 23, 2019 @04:55AM
(#21862579)
Python does have a lot of problems, but it's so far the most flexible language like English.
High level programming language is meant to communicate, not to dictate the computation. Python happens to be easy to understand by humans.
Re:WTFPython – Understanding Python through surprising snippets
by yoloClin on Tuesday December 24, 2019 @12:25AM
(#21870082)
I don't disagree with anything you've said, but in my opinion strongly typed function definitions/returns are about communication rather than dictation - I'd rather the compiler tell me that I'm passing an unexpected argument type rather than the runtime executor.
But to contradict your point, there's also a fair amount of Python which is a dictation - Guido even called his job role 'Benevolent dictator for life'. I really hated some of the guidelines as a new programmer but after dealing with them for some time I understand that consistency is far more important than preference in many/most/all cases.
Re:WTFPython – Understanding Python through surprising snippets
by cutler on Monday December 23, 2019 @07:03AM
(#21863110)
Ruby rates much higher on the Englishness scale.
Re:WTFPython – Understanding Python through surprising snippets
by GordonS on Monday December 23, 2019 @06:35AM
(#21862988)
Hmm, I'm not really a fan of indentation based control flow, but I see the appeal of condensing code vertically.
I primarily work with C#, but I've gradually come to like the "K&R"/Javascript style (where the 1st brace is at the end of the first line), precisely because it helps condense code vertically.
If anything, the one thing I hate about Python3 is dynamic typing - inferring datatypes in function bodies is great but strongly typed (and _enforced_) parameters and return values would clean up a lot of the problems I have seen, and created in the past.