3 ms·
I'd argue that Python goes beyond legibility of code since most of the Python community seems to have settled on very similar coding standards. Not just silly
by mdasen 18y ago
I'd argue that Python goes beyond legibility of code since most of the Python community seems to have settled on very similar coding standards. Not just silly things like 4-space indents, but the way the code is written. It makes it really easy to pick up foreign Python code.
The explicit over implicit here also helps. Yes, it is a pain when dealing with only your code (why do I have to keep doing self.var_name when Java just lets me say var_name), but when dealing with foreign code, it means you have explicit scope.
I'd also argue that Python's import is just wonderful. Where many languages like their secret-sauce methods, Python's explicit imports makes it incredibly simple to find where a name is coming from. While Java has the convention of import java.util.*, Python has the convention of from math import log - which imports the name log into your file. So, you see log used in the file, you can easily look at the import to see where it's coming from - and yes, it isn't hard to imagine identical names in different libraries and you shouldn't need to know that something with the same name is defined in two places that usually aren't used together. Want the whole math library, just import math and then use math.func() so that you still know where everything is coming from!
For what it's worth, I think Python's syntax is a bit ugly, but it's standard! Python code never looks that foreign and having foreign code look familiar to you is just wonderful. It might not matter when you have your 1-person project, but when dealing with the code of other's, it's wonderful.
- silentbicycle 18y agoIt makes it really easy to pick up foreign Python code. You really can't overestimate how big a deal this is.