3 ms·
Because one of the major problems of writing code in collaboration with other programmers is communicating the meaning of existing code. And python is one of th
by olefoo 18y ago
Because one of the major problems of writing code in collaboration with other programmers is communicating the meaning of existing code. And python is one of the few languages out there that had an explicit goal of being legible.
- dustineichler 18y agoyeah i second this point. i'm a fairly large perl project at work and it makes me want to poke my eyes out. python on the other hand always makes me smile. it's simple and elegant.
- DaniFong 18y agoI'll point out that it is for this exact reason that we're using Fortress: for scientific code, it's so much more readable it's amazing.
- prakash 18y agoSo, Chapel. Erlang, CUDA, etc. aren't as readable as Fortress?
- DaniFong 18y agoYes. The baked in use of units is incredibly helpful (best use of any static typing I've seen, I tell you), but the biggest thing is that the LaTeX formatting and larger character set allows code to look like what it does. The code and the formulas look like the very same thing because they are the same thing.
- deleted 18y ago[deleted]
- mdasen 18y agoI'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.