views:

590

answers:

13

I'm already a professional J2EE developer by day, and Rails developer by night. I'm planning on adding Python to my list of skills. I'm already convinced a language is just a tool, so I'm not interested in a religious war. I agree with the Pragmatic Programmers that learning one language/year is a good thing for your professional development

So, in your considered opinion, what kinds of applications does Python hit the sweet spot? And why? What advantages does it have, and why do these advantages outweigh the costs in adopting Python?

ADD: I also plan on learning a pure functional language like Scheme.

+13  A: 

Since you already know Ruby/Rails, I would actually argue to skip Python and go in a direction that will expand your skill set at a more fundamental level. Languages like Erlang (concurrency/message passing), Lisp (more hardcore meta programming then Ruby plus arguably the most powerful form of code is data and data is code), Haskell (more pure functional programming), or the like.

And this is coming from someone who uses python for personal development, but skips Ruby for similar reasons to the above, just coming from the opposite direction you are.

Runevault
While I'm a big Python fan, I agree with Runevault. There are certainly applications where Python is a bit better than Ruby, but overall they will tend to be strong in the same areas. Learning a language that's really different will expose you to fundamentally different concepts.
Chris Upchurch
I disagree with Renevault. Python and Ruby share a lot of similar ideas, yes, but that makes solving the same problem in both languages a worthwhile experiment. Python has its own idioms and approaches that could introduce you to seeing problems in a different way. Besides, learning it would be easy
Cristian
+7  A: 

Python is great for developing Google AppEngine apps :)

Chris Marasti-Georg
+5  A: 

Python is great for almost everything:

  • GUI
  • Web
  • Database
  • Sysadmin tasks
  • Munging text

Is there a specific type of application you are interested in that someone can explain Python's usefulness for?

Corey Goldberg
What about GUI desktops? Or scientific computing?
Alan
great for both.. check out wxWindows, Tk, SciPy
Corey Goldberg
+3  A: 

What I love about Python is that it is incredibly quick to get going and test stuff out. The command line interpreter lets you easily write out a quick script to see if it works.

I like the lightweight syntax of it. Mandatory whitespace is weird at first, but you get used to it. I don't like all the curly braces and semicolons in more "traditional" languages anymore (and the excessive wordiness of VB.NET is right out).

I love the web frameworks for it. I've been playing with Django and Pylons recently, and they're both pretty good. I was able to get some useful web apps up very quickly with them.

Of course, the same could be said (more or less) about Ruby too.

swilliams
+3  A: 

Honestly, I haven't found anything Python isn't good for in the past couple years of heavy use. It's dynamic and not compiled to native code, so CPU-bound programs will suffer... but on the other hand it is actually easy to extend it with native code, and there are numerous very complete C extensions for crypto, math, JSON, etc.

OTOH, you already know Ruby which I think has a similar feature set. Unless you feel that it's lacking in some way, I don't know of any good reason to learn Python other than for your own edification.

Dan
A: 

Python is a nice language for devoloping programs where easily readable code is dire, and for most general purpose apps where speed isn't of the utmost importance. It's also a great language for beginners, and supports many paradigms.

+1  A: 

Python is suitable for many areas so I would say pretty much everything except low level drivers etc

Excellent for GUI development using wxPython/PyQT

Excellent for web development , it has lots of easy to use frameworks e.g Django, Turbogears and if you wish you can write your own in no time :)

Excellent for scientific computing, sounds wrong but python can be wrapped around any available C/C++ library and can be used as a glue It has great numeric library NumPy

Python can also be wrapped around Java using JCC so you can use lucene search

Python works on .Net platform and is available for silverlight so it will owrk on client side too

So in short Python interfaces with most of popular languages/platforms well and has wide range of available libraries.

Anurag Uniyal
A: 

I/O-bound applications for sure. If the interpreter is not your bottleneck, then Python is a superior general purpose language to C++. The only concern would be low-level programming - bit manipulation, memory access, etc. It's possible (ctypes, etc), but unnatural in Python.

The bonus is if you decided to go with cPython and you end up with a hairy CPU-bound algorithm, you could write it in C/C++ and wrap it (Boost.Python!) as a Python extension.

Jeremy Brown
A: 

There is an active and vibrant amateur game development community working in Python, centered around PyGame and Pyglet, with a bi-yearly week-long development competition called Pyweek. The fall competition just finished, so you could make the spring competition a goal for your learning.

David Eyk
Nitpick: bi-yearly (or more properly biennially) means "every two years." Pyweek is semiannual, meaning it happens every half-year, or twice a year.
Iceman
A: 

Anything where you can use list comprehensions in Python. This is the feature I miss more than any other when I'm programming in Java, etc.

Steve Losh
+1  A: 

In response to your "ADD: I also plan on learning a pure functional language like Scheme."

Scheme is a great first functional programming language to learn, and it really gives you a new outlook and appreciation for recursion. A great fun to read book to pickup for learning Scheme is The Little Schemer.

Ian
Agreed: the book you mention plus SICP seem to be sure winners.
Alan
A: 

Python is dynamically typed and that makes it perfect for problems where you only have a vague idea of the goal. You can slowly begin getting the ball rolling and you can see the direction of the ball early on. Then you can slowly prod it a bit at a time until it reaches the goal.

In general, a system like J2EE does not support this kind of development to the same extent. You need a more specific plan up front unless you want to redefine bug chunks of the code completely.

jlouis
A: 

Maya is starting to use python more and more, so tool scripting could be a good field to get into.

savannah