> As far as languages go, Python is probably one of the most readable ones out there.
I could not disagree more. Python (as most people write it) has many things that make it less readable:
1. Semantic whitespace (absolute disaster for readability, almost as bad as YAML)
2. Choosing to "save keystrokes" by removing helpful visual cues that other languages have, like parentheses, semicolons, and brackets -- these things make scanning much easier
3. As most people write it, very few line spaces, making Python look like an unbroken run-on sentences instead of nice blocks of code
I've been writing and maintaining code for 26 years, and I've worked a lot with C#, JS/TS, Python, and PHP. I know other languages but haven't spent as much time with them.
Out of those, PHP is ironically the most readable because of its $ variables, and then the order is C#, TS, JS, and then Python. Python is hard to scan and just looks like a brick wall at first glance.
with open('foobar.txt') as file_object:
content = file_object.read()
How can you honestly look at any of that and claim Python isn't far more readable. It literally reads like English. "With open foobar.txt as file object, content equal file object read". Compare that to whatever monstrosity the ifstream string stream << rdbuf crap is...
I could not disagree more. Python (as most people write it) has many things that make it less readable:
1. Semantic whitespace (absolute disaster for readability, almost as bad as YAML)
2. Choosing to "save keystrokes" by removing helpful visual cues that other languages have, like parentheses, semicolons, and brackets -- these things make scanning much easier
3. As most people write it, very few line spaces, making Python look like an unbroken run-on sentences instead of nice blocks of code
I've been writing and maintaining code for 26 years, and I've worked a lot with C#, JS/TS, Python, and PHP. I know other languages but haven't spent as much time with them.
Out of those, PHP is ironically the most readable because of its $ variables, and then the order is C#, TS, JS, and then Python. Python is hard to scan and just looks like a brick wall at first glance.