views:

1068

answers:

14

To clarify: I've been programming in C# for 5 years now, doing both Windows and Web development. I don't intend using Python for GUI development (I pretty much like WPF and Windows Forms).

Will I be more productive (deliver projects faster) with Python for console and web projects?

Does Python standard library allow developers to write code faster than .NET class library?

Thanks a lot.

+3  A: 

Good Programmers are productive in any language. IMHO

But this is a very subjective topic

Brian Hedler
But that's not the question... The question is, will Programmer A be *more* productive in language X than he/she is in language Y? I'm certainly less productive in, say, bash shell than I am in python, though I do consider myself "productive" in shell scripting.
Kevin Little
@Kevin Little sorry to hear that, have you considered that maybe you are not a good programmer?
Brian Hedler
@BrianYou missed the point, Python is a fully featured language with more capabilities and less limitations than bash.
mP
You both missed the point. Sometimes I use my left hand, but it takes longer.
Brian Hedler
@Brian So you're saying a good programmer is productive in any language, but not with either hand?
spelling it out for you: On the rare occasion that I masturbate with my left hand .... it takes longer. As in shell scripts = a rare occasion = nothing to do with productivity
Brian Hedler
@Brian: you measure productivity with a very odd metric.
Beska
+1  A: 

My answer is YES... for your question 1

You will gain more flexibility, because you can have more accessibility to lower level..

But it will not provide you "faster code" as you expected. I think .NET is optimized for rapid application development but not Python

Chathuranga Chandrasekara
+3  A: 

In my experience productivity is usually tied more to available libraries and tools than the language itself. So look at the available libraries/tools and find a good match for the tasks you're going to solve.

In my (limited) experience with Python it is quite effective for console apps and for those kind of tasks I prefer it over C#, which can be a bit verbose.

Brian Rasmussen
+12  A: 

There's no easy answer to this question. It really depends on what you're trying to accomplish and what paradigms you prefer to utilize.

If your question is will you benefit from experimenting with Python, then the answer is almost certainly yes, as it is for almost every programming language. Even if you don't end up finding a common, practical deployment for it, you'll be better off for the experience, you'll learn some new things, and you'll become a better developer all-around. There's nothing wrong with having favorites, but restricting yourself to one language or one set of concepts is a very unwise choice, and only serves to stunt your professional growth.

That said, I believe you'll find good utility for Python. It includes many important modules and many others are easily available, and for the most part these follow the Pythonic ideals of obviousness. It's something that makes it easy to hit the ground running ... generally it's much easier to use than Perl or PHP for similar tasks, and it has consistent conventions and a good community.

The real way to learn whether this will increase your productivity or be practically deployable in your particular work is to spend a couple of weekends fiddling around and creating a small proof-of-concept. You'll probably be surprised how far you can get, but however these things turn out, you'll be a better developer for the experience, and that alone is worth the investment.

cookiecaper
Yeah I think Fred Brooks's "No Silver Bullet" concept applies well. No modern language/framework combo will give you a particularly substantial leg up over any other.
jhs
+3  A: 

You will probably be more productive in Python when you get the hang of it:

http://shootout.alioth.debian.org/u32q/benchmark.php?test=all&lang=csharp&lang2=python&box=1

Your source code will be approximately 3x smaller. However the code will probably be slower than C#.

I believe the .NET library has a more comprehensive Windows related library while Python's library is more general purpose.

Unknown
Then again there is IronPython which gives you the best of both worlds
Peter Lillevold
I don't have much experience with IronPython, but I suppose it would give you the best of both worlds.
Unknown
+1: First you have to learn Python as deeply as you already know C#. Then you can actually compare the two and determine which is more productive. Until you know Python deeply, it will be less productive because you'll still be learning.
S.Lott
+11  A: 

You'll be very happy and productive with IronPython for most tasks and C# in the minority of cases where you need it for performance. Buy "IronPython in Action", slurp it down, and you'll never look back!

Alex Martelli
I really hope Microsoft will continue to support it.
Unknown
+1  A: 

Depends on the kind of goal you are trying to accomplish.

C# with VS.NET is very good at GUI & Web

Python is very productive for prototyping, text processing, automation.

With proper framework skill python can be productive in Web also.

Sake
Python already is very productive for web.
Geo
Very productive indeed - check Django
gath
+2  A: 

I don't think so. You will certainly be more productive in the language you're most familiar in. So if you want to be more productive, I suggest you stick to what ever language you had the more experience. However, if you want to write cleaner, more concise code, python may be a better choice. This however says nothing on which language to choose, it rather depends on the kind of problem you're tackling. For me, if I'm tackling windows-only GUI programming, it's very likely I will choose C#. I may choose python if I wanted to write cross-platform application or solving AI problems. That's just what I think.

Hao Wooi Lim
+2  A: 

Bruce Eckel says he's 5-10 times more productive in Python than in Java. I think C# is more productive than Java, but is still more verbose than Python.

The main difference between Python and C# is that Python can be considered as a scripting language. It's excellent when you have to automate something (build scripts, renaming thousands files, ...). Of course it can be used for large programs as well.

I could give you a list of resons that make me think Python is a cleaner language. But I use it because it boosts my productivity, not just because it's a beautiful language (and there are some things I don't like about Python, too). As Eric S. Raymond says:

My second [surprise] came a couple of hours into the project, when I noticed (allowing for pauses needed to look up new features in Programming Python) I was generating working code nearly as fast as I could type. When I realized this, I was quite startled. An important measure of effort in coding is the frequency with which you write something that doesn't actually match your mental representation of the problem, and have to backtrack on realizing that what you just typed won't actually tell the language to do what you're thinking. An important measure of good language design is how rapidly the percentage of missteps of this kind falls as you gain experience with the language.

When you're writing working code nearly as fast as you can type and your misstep rate is near zero, it generally means you've achieved mastery of the language. But that didn't make sense, because it was still day one and I was regularly pausing to look up new language and library features!

This was my first clue that, in Python, I was actually dealing with an exceptionally good design. Most languages have so much friction and awkwardness built into their design that you learn most of their feature set long before your misstep rate drops anywhere near zero. Python was the first general-purpose language I'd ever used that reversed this process.

http://www.linuxjournal.com/article/3882


About this question:

Does Python standard library allow developers to write code faster than .NET class library?

Will I be more productive (deliver projects faster) with Python for console and web projects?

Python's library is much more compact than .NET (it "fits your brain"). But currently the curses module hasn't been ported to Windows, so it may be difficult to write complex console UI.

Bastien Léonard
+1  A: 

You'll benefit from dynamic typing. Once you get the hang of it, you won't want to go back to a static typed language.

Geo
A: 

Yes!

However, you should beware. Once you start liking Python, it kind of makes you lazy :P. You can easily become very unappreciative of other programming languages where you have to be more verbose.

+8  A: 

In my experience, yes.

I come from a C#/.NET background myself. Started programming in .NET in abt. 2001, and at about the same time was introduced to Python. In 2001, my time spent in C# vs. in Python was about 90% C# / 10% Python. Now, the ratio is 5% C# / 95% Python. At my company, we still maintain a product line based on .NET. But all new stuff is based on Python.

We have created non-trivial applications in Python.

In my experience, what makes me more productive in Python vs. C#, is:

  • It is a dynamic language. Using a dynamic language often allows you to remove whole architectural layers from your app. Pythons dynamic nature allows you to create reusable high-level abstractions in more natural and flexible (syntax-wise) way than you can in C#.
  • Libraries. The standard libraries and a lot of the open-source libraries provided by the community are of high quality. The range of applications that Python is used for means that the range of libraries is wide.
  • Faster development cycle. No compile step means I can test changes faster. For instance, when developing a web app, the dev server detects changes and reloads the app when the files are saved. Running a unit test from within my editor is just a keystroke away, and executes instantaneously.
  • 'Easy access' to often-used features: lists, list comprehensions, generators, tuples etc.
  • Less verbose syntax. You can create a WSGI-based Python web framework in fewer lines of code than your typical .NET web.config file :-)
  • Good documentation. Good books.
codeape
Thanks, good sharing
Valentin Vasiliev
+2  A: 

My favorite aspect of Python is the interactive nature of using it. I can easily test ideas and concepts without fully implementing them in my solution. In my opinion, you will be more productive (deliver projects faster) with Python for console projects. If you use IronPython you have interactive access to the .NET libraries.

http://ironpython.codeplex.com

ecounysis
I agree with you completely. The testing of concepts before implementation is really cool. I wonder how many languages have this!
gath
+1  A: 

If I had a Python IDE/debugger as good as Visual Studio I'd be more productive in Python. But I always find .NET wins when it comes to auto-completion, debugging, source control integration, etc.

Or have they improved things with the latest IronPython - I haven't used it in a while?

Marc
Slow startup is still issue #1 with IronPython
Valentin Vasiliev