News for hackers. Stuff that matters.
Re:Just why did people start using Python anyway? by olefoo on Thursday October 09, 2008 @02:21AM (#327554)
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.
Re:Just why did people start using Python anyway? by mdasen on Thursday October 09, 2008 @08:14AM (#327731)
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.

Re:Just why did people start using Python anyway? by silentbicycle on Thursday October 09, 2008 @08:18AM (#327733)
It makes it really easy to pick up foreign Python code.

You really can't overestimate how big a deal this is.

Re:Just why did people start using Python anyway? by DaniFong on Thursday October 09, 2008 @04:45AM (#327635)
I'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.
Re:Just why did people start using Python anyway? by prakash on Thursday October 09, 2008 @08:24AM (#327734)
So, Chapel. Erlang, CUDA, etc. aren't as readable as Fortress?
Re:Just why did people start using Python anyway? by DaniFong on Thursday October 09, 2008 @01:54PM (#328071)
Yes. 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.
Re:Just why did people start using Python anyway? by dustineichler on Thursday October 09, 2008 @03:10AM (#327582)
yeah 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.