3 ms·
I really don't think Python is less maintainable because of its punctuation style. I worked on million lines of code systems in Python and lack of punctuation w
by laurencerowe 3y ago
I really don't think Python is less maintainable because of its punctuation style. I worked on million lines of code systems in Python and lack of punctuation was never a problem. I think you could make a much stronger argument about lack of static type checking, which Python now offers, similar to TypeScript.
The only real pain point with indentation based languages like Python is when copying and pasting code you have to take care to put things at the right level. Tools like prettier mean this is pretty much a non-issue now for punctuation based languages. But there's still a lot of line noise to ignore when reading code.
- feoren 3y agoThat's good to hear, actually. I'm sure it can be done well. I've worked on much smaller Python codebases that were unmaintainable, and the lack of punctuation was one of the problems. A very common source of bugs was things being at the wrong indentation level. You'd have: def outermost(): def middle(): def innermost(): ... (six hundred lines of code) ... return something_from_innermost def another_func(): Uh oh. Is "another_func" at the right indentation level? It's very hard to tell what scope it's at. Yes, this is awful code style, and it still would be difficult even with visible punctuation, but at least you could count the '}'s to see what the programmer actually intended. Here, it's very difficult to know how many scopes just closed. They all opened five screen-heights ago! I am aware that it's easy to write hard-to-follow code in any language, but visible punctuation always helps.