8 ms·
Special characters, clear visual markers of scope etc. that Python lacks is part of the appeal of Perl to me. I feel like a dyslectic when I read Python (proje
by vgy7ujm 9y ago
Special characters, clear visual markers of scope etc. that Python lacks is part of the appeal of Perl to me.
I feel like a dyslectic when I read Python (projects of significant size) due to it being much less visually helpful and that the idea of simplicity falls apart when the problems are not trivial and when multiple devs have touched the code over multiple years.
YMMV of course but that is why your POV is not objective and I disagree.
- toyg 9y agoThe visual marker of scope is there and it's massive: indentation. You can write bad code in every syntax, but when a language carries jokes about being "write-only" and the other has a reputation for being anal about indentation (the single most helpful scope-marker in any syntax), I don't think you can argue about objectivity when discussing readability. This said, I'd like to see scientific comparisons, which are lacking. Some studies suggest terse languages using more special characters are more readable to experienced programmers than ones with simpler syntax, which seems to match your experience. That might well be true; but when applied to the real world, this still means than only a minority will ever prefer that style over a simpler one. As the number of coders naturally rises, this will only become more and more true over time.
- newen 9y agoBro, literally every language does indentation. Python just does indentation badly by making it syntactically significant. Also. If you're going to come back to me with the argument that it forces people to use indentation, I've got some news for you. Literally everyone uses indentation. And if you somehow come across code written by the rare soul that doesn't use indentation, all I've to do is select the entire code and click "re-indent". Which, btw, in python is a chore to fix badly indented code with tabs and spaces mixed in together. And it's even more work to properly copy-paste python code, even in good editors.
- mixmastamyk 9y ago> everyone uses indentation. Yes, if you don’t you’re incompetent. If you do, the markers are then redundant. Mixed indentation hasn’t been allowed in years. Any good editor will show mixed indentation, guides, and indent properly with the tab key, get one. Sounds like your knowledge of Python is about a decade behind. Not to mention those were nonissues from my experience even back in the day.
- newen 9y agoThese issues are only there because python has significant whitespace. These issues should not have been there in the first place. Ideally, I shouldn't need to use an editor geared specifically for python code to copy-paste some python code and run it. I have had no issues with the majority of other languages when copy-pasting some code and reindenting. Only in python have I had issues with it. Even in elpy-mode in Emacs, I have had issues. Another is Jupyter/IPython, a widely used python IDE for data scientists, where this problem crops up all the time. So lay off with the superior attitude.
- emmelaich 9y agoWhen I started writing C a million years ago I thought to myself -- why the f$# does the compiler need to be told twice what the structure of my code is? Once with {} and once with indentation. It's not as if anyone half-sensible is going to write good code with bad indentation. With that thought in mind, I am pathetically grateful for Python.
- hedora 9y agoPython was designed for doing quick throw away prototypes. Perl 5 was designed to support devops before that was a word. If you are writing a large code base in either, there is a good chance you are doing something horribly wrong. (I still prefer perl though)
- deleted 9y ago[deleted]
- vgy7ujm 9y agoIndentation + characters for scope is a lot more visual IMO than just using indentation with no clear end marker.
- cutler 9y agoIf Python's identation-based scope is so obvious why does the language have to resort to "global" and "nonlocal" all over the place? Python is a crippled language hiding behind a veil of readability.