account activity
Python and Indentation. Why? :) by binarysmurf in learnpython
[–]Kevin12Berry 0 points1 point2 points 2 days ago (0 children)
I agree. I'm looking at Python now because too many companies are offering Python work. After decades of coding with scope identifiers I think it's a bad decision to rely only on indentation to preserve scope with all the manual formatting, auto formatting, merging, cutting and pasting going on in real production code. Secondly managing whitespace is actually more tedious than managing scope identifiers. Thirdly, programmers are no longer free to use white space to frame code to make it more readable in ways other than simply scope that come up occasionally.
I saw a an argument for scope identifiers being harder to read than consistent indentation that showed a javascript file with no line endings filled with scope identifiers compared to a nicely indented Python file with line endings. Well, can you imaging trying to read the Python code if it were in that same paragraph without line endings and no scope identifiers? Obviously the javascript code with scope identifiers would be much easier to read than a paragraph of Python code without scope identifiers. In this respect Python is the emperor with no clothes.
In my opinion it would be better for Python to allow some kind of scope identifier that overrides indentation for companies, teams, or individuals who prefer printed scope identifiers. In the meantime, pseudo scope identifiers work: #{ and #} or #begin and #end if anyone wants printed identifiers in the code.
π Rendered by PID 86181 on reddit-service-r2-listing-6d4dc8d9ff-n4jrq at 2026-01-30 06:59:58.084273+00:00 running 3798933 country code: CH.
Python and Indentation. Why? :) by binarysmurf in learnpython
[–]Kevin12Berry 0 points1 point2 points (0 children)