4 ms·
Python forces you to write indented code, that's basically nothing to do with readability.
by Avshalom 5y ago
Python forces you to write indented code, that's basically nothing to do with readability.
- 999900000999 5y agoHypothetically your on a team with a bunch of junior devs. Your doing a PR review, assuming this dev is sloppy, would you rather it be in C++ or Python ? I didn't like Python or Ruby at first, but now whenever I need to write a small tool, it's Python. Before Python I was using JavaScript, but I've fallen in love with how clean Python is
- dragonwriter 5y ago> Your doing a PR review, assuming this dev is sloppy, would you rather it be in C++ or Python ? I'd rather it be in Python because I haven't touched C++ with any seriousness since the 1990s. But not because of formatting (in either case, I’d prefer a standardized code formatter be in use, which gets you a lot farther than Python’s whitespace sensitivities alone.)
- 999900000999 5y agoWhen did you start as a developer, are you still an individual contributor or did you have to move into management? I really do want to program, until I retire because I really hate trying to manage people.
- dnautics 5y agoAm I wrong in remembering that python indentation a choice made loosely, "to force noob programmers to write well-organized, legible code"?
- dkarl 5y agoI think GvR observed that beginning programmers often got confused when the indentation of their code didn't correspond to the syntactic nesting implied by brackets, etc. They found the indentation to be more salient and easier to interpret, so he designed the language to cater to that.
- dnautics 5y agoThanks for confirming. Sorry for the crudeness.
- int_19h 5y agoThe use of indentation for program structure predates Python; it comes from ABC: https://en.wikipedia.org/wiki/ABC_(programming_language) https://en.wikipedia.org/wiki/ABC_(programming_language)
- dnautics 5y agoNobody said python was first. In fact "making the choice" weakly (but not absolutely) implies that someone else did it before
- int_19h 5y agoSorry, I wasn't clear enough: ABC is not just some random language - it's one that GvR worked on before Python, and he specifically said in several interviews that it's where Python originated from. As you correctly surmised, ABC was a teaching language, hence the choice to go with indentation.
- dnautics 5y agoThanks for the clarification, that is fascinating!
- seanmcdirmid 5y agoIn visual studio (not code), there is an extension to render braces as very small, almost invisible. So with that extension and standard IDE enforced indentation (depending on those braces you can barely see), C# code almost looks like python code.