22 points · by prakash · 18y ago · 44 comments
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.
You really can't overestimate how big a deal this is.
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.
Is there a programming language which doesn't have an Emacs mode?
I thought about writing one, but then came to my senses.
I wrote an ed mode for Emacs once, though...
But I think it is the same with JavaScript, Ruby, FreeBSD, PosgreSQL and many more hip foobars; In contrast, Java, PHP, many (not all) Microsoft products, Linux (partly) allured so many bad coders that it is simply boring to work through their code.
While I dearly love Python, I don't know enough about Haskell to adequately answer this. The article makes it sound like Haskell is doing all the same right things as Python -- although this apparently isn't paying off yet, so the article must be overlooking some factors.
Ironically, I may be switching from Python to Lua now, for the same reason.
Agreed. I find it quite a bit more elegant overall, and I decided to just jump in and do my throwaway scripts in Lua and see how much of a difference that makes. If I like it enough to write a few small libraries along the way, everybody wins.
Lua has tail-call elimination, coroutines, closures, and lambdas. I'm pretty sure Python has none of these, except for (possibly) a limited form of coroutines. (The Python lambda is too crippled, its closures are broken.) Lua is also one of the most deliberately portable languages I've seen, too. I have a hunch it would be a great language for bootstrapping a Lisp or Scheme compiler, though I haven't tried this yet.
All I can remember about Tcl from my months of using it is the ugly, ugly loops:
for {set i 1} { $i <= 100 } { incr i } {
puts "Well, that wasn't ugly syntax!"
}
Incidentally, Fortran, for all its other ugliness, has the best for loop I know: do i = 1, 100
write(*,*) "Hooray, Fortran!"
enddo