Comments by "Edward Cullen" (@edwardcullen1739) on "The World's Most Popular Programming Language" video.
-
"Whitespace indentation"
What, something that every professional developer worth his salt does as a matter of course?
Are you serious?
Coming from C, the asymmetry (no closing braces) took me about 2 weeks to get over, so I have sympathy for those who struggle with this, but my god! Complaining about indentation? Have you ever worked with other programmers?!?!
Static typing can be useful, but this argument is a crutch for poor documentation and communication between teams.
Also, if module boundaries are pain points, then simply treat arguments as "user input" and act accordingly.
Even when you have static typing, you still need null reference checks and complex inputs will need validating anyway, regardless of typing, so, where's the difference?
3
-
1
-
1
-
1
-
Couple of things:
"Python is the second best language for any project."
BDFL has stated "if you're worried about performance, why are you using Python?"
In this sense, Python should be used for prototyping, to understand the problem and work out how to solve it correctly. Once you have a correct solution, translating that to a performant language is trivial in comparison (plus, you have a reference implementation to test against).
Given we rarely get it right first time ("Plan to Throw One Away"), the only "performance" that matters, is getting to a correct solution.
Not strictly a Python issue, but comments in code are just like unittests: done right, with the right intent, they are GoodThing™ and should be encouraged.
Good comments give a different view of the code.
I've had many people say "you don't need comments or documentation when you have the code", but if I just want to use your code, why should I be forced to spend my time delving into your code? (which may or may not be a pleasant experience in and of itself...)
Documentation forms part of the user interface. If there is a numerical argument, I should not need to read beyond the doc comment to know what the acceptable range is.
People make the argument that "comments don't get updated". I consider this a feature, not a bug.
When there's a mismatch between stated intent in a comment and what the code does, then something, somewhere has gone wrong, potentially seriously so, therefore questions need to be asked. (And Mk1 re-education devices applied... 😉)
1