Skip to content

Comment on Python at Netflixparent

Comments

I have to say that after doing a python project I totally don't get why people love it so much. The syntax is slightly cleaner, but the lack of threading, first-class functions and dependency management tools make it waste at least as much time as it saves. I honestly don't believe in the concept of a programming language being able to make code more or less readable. A Java project with a POM file can be up and running on any OS in about 5 minutes.

Ummm, not sure where you're getting your information but Python has threads (http://docs.python.org/2/library/threading.html), first-class functions (http://en.wikipedia.org/wiki/First-class_function), and dependency management tools (google for pip, easy_install, etc.)

Sorry, I should have said "lack of true threading in CPython" by which I mean the GIL limitation. And lambda expressions are lame compared to what you can do in JavaScript/Perl/Scala. And the build tools suck compared to Maven which is saying a lot. Maven is cross-platform and install-free. It takes a long time to makes head and tails of pip, easy_install and virtualenv and it still does less than Maven.

>And lambda expressions are lame compared to what you can do in JavaScript/Perl/Scala.

Python lets you pass functions other ways than using lambdas, you know. If you've defined a function with the standard "def foo" style, you can pass "foo" as an argument.

Even the standard "1-line lambdas LOL" limitation can be circumvented by defining the function elsewhere and making the lambda a call to it.

Lambda expressions are not necessarily first-class functions (I mean, they are in Python, but so is any other old function).

First class functions simply mean that a language treats functions as it would nearly any other data type, namely that they may be passed as parameters, bound to variables, and returned from other functions.

Python's poor handling of lambda expressions do not invalidate that functions are first-class citizens.

What do you use "true" threading for? Are you multiplying matrices? If so use Numpy. Are you downloading data and accessing database? If so, you threading, threading in Python works great for that. If you hit memory size issues, switch to gevent or eventlet for green threads.

I have been building large projects in Python for the last 10 yeas and never really thought "Hmm I wish I had more powerful lambda functions". You can always just have regular function and pass that around. Why do you need lambdas so much?

I think he was talking about threads that run on multiple processors.

Also, packaging is a whole different can of worms (but hopefully will be sorted by distutils2!).

Python doesn't have first class functions?

I often get the idea that people confuse anonymous and first class functions (apparently because they discover the latter expressed in terms of the former).

It has its share of warts, but doesn't lack any of those things you mention.

Java shines at the huge end, but for most everything else python is a more productive choice as it is so much more concise. Perhaps you are not yet using it optimally?

a) python-pip combined with virtualenv gives very good requirement support.

b) python does have first class functions?

c) threading still happens, you just can't take advantage of multiple cores. This isn't as big of a problem as you'd think though, you can still write very fast code.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.