views:

479

answers:

13

Why did you start using Python?


I was using Perl for my programming needs, and was often frustrated. I hated reading other people's Perl code and basically would often result to re-writting entire functions rather than trying to debug someone else's code.

Also, coming back to code I'd written months before was a headache. (admittidly I was still pretty much a beginning programmer)

I first ran across Python when reading this article: http://www.wired.com/culture/education/news/2002/09/54916

The team chose Python as their programming language because they could write cleaner, faster code more easily in it. But Haynes was the only one in the group who had coded in that language before, so the other four students had to learn Python as well as solve the various technical and interface problems.

This quote got my attention, and I gradually picked up Python.

Almost 6 years of Python and I have yet to feel the frustration that drove me from Perl.

UPDATE

Great responses everyone thanks!

A: 

I saw a presentation at a local Linux Users Group in CT on the Python language. It included code samples, and the presenter was clearly enthusiastic about how easy it was to create solid, functional code with it. At the time I was a beginning programmer and my only real experiences up to that point had been working in C, so this sounded very attractive. I didn't drop C, but I did start investigating Python, running through some online tutorials. I found the syntax to be very natural, visually appealing, and I was writing usable code in a matter of hours. Compared to my experiences with C this was a walk in the park and it really encouraged me to continue programming.

Years later, I program in many different languages at different times but I always fall back on Python as the language I 'think in' for solving a problem. All this time later it still feels the most natural and I am frequently struck by how clean and readable Python source code is. I pride myself on good code style generally, but Python is the only language I use that subtly enforces that in others and therefore makes random code easier to pick up on.

Jay
A: 

I was/am a .Net developer, and a co-worker showed me some of the crisp syntax of Python. I wasn't immediately enamored, but within a few months I fell in love. I liked the cross-platform aspects coupled with the dynamic type system and the ability to essentially code in pseudo-code.

After that, while I have never used it in a job (except for a few optional cases, as a background tool), I benefitted from it greatly. I finally groked the concept of Polymorphism because of Python (despite having coded in VB.Net for a few years by that time), and ultimately (because of Turbogears) understood the Model View Controller paradigm, which wasn't so intuitively obvious in the .Net world for some reason.

torial
A: 

I was developing an SDK with a SOAP and XMLRPC interface a number of years ago, and was creating example programs in various languages (I think it was C++, Java, VBScript, Perl, and Python). As soon as I started using Python I wondered why I had not given it much consideration before! Up until that point, all my scripting was in Perl. Now, all my scripting is in Python.

I wrote a Perl script a couple of weeks ago and was frustrated by the obscure syntax (especially for the data structure I was working with) and the obscure error messages when you do something wrong.

Greg Hewgill
All of the error messages are listed in perldiag. It's not really obscure, and each message comes with a couple of paragraphs describing what you might have done wrong.
brian d foy
One of my difficulties is that perl can ignore undefined variables, and keep going on happily. use strict can help some, but if you don't start with using it, it's often not worth introducing it.
monkut
+1  A: 

For several years, I had the practice of learning one new "Language of the Year". Not to the point of becoming an expert and not with the idea of using it professionally, but at least getting to a "working knowledge" level, enough to figure out what were the "big ideas" behind the language.

Python was my LotY around 1998 or so (just after Rebol). I was surprised by how easily it "stuck" in my head compared to other languages. Besides the assembler and BASIC of my youth, and the C and C++ of my professional career, I'd gone through Perl, Java, and Rebol before then, and Python just stayed at the top of my mental stack, to the point that I was able to "think in it" more easily than the others.

I've dropped off the LotY practice since then (the last one was Common Lisp a few years ago; I half-heartedly tried Haskell this year but didn't put enough effort into it). But Python still sticks in my head.

It's nothing like perfect, but it has a nice, wide sweet spot.

Tim Lesher
+1  A: 

I just started fooling around with it. Then I got into learning the reflective aspects of the language, and then the list comprehensions, and then the generators... every new feature made me more of an avid python fan. It's just always been easy to write code in.

Claudiu
A: 

Basically I am more productive and my code runs faster. I can tackle a much wider range of problems and have fewer lines of code to maintain.

What caused me to use Python was that I wanted access to really fast and stable maths capabilities and found numpy and scipy. I wrote a fairly complex algorithm in record time and I was sold. Since then I have ported half of my code base over to python rather than have to write a lot of boilerpoate maths code myself.

Beyond the maths I have really simple solutions to a lot of server side code that I had previously written in Java.

The only downside I know of with python is the fiddly setup on hosted Linux boxes and the interplay between it and certain management software (e.g. Yum, hsphere). Often a host will not support the same python version and upgrading is a major obstruction. But that's not the fault of the language per se, more the environments which have been built around it.

Simon
+1  A: 

I frustrated to C++, then wrote few first python programs and found it good. At times I tend to switch a language, but I've ended up to move back to python this far.

It's not that python is not frustrating, but it is certainly less frustrating than C with classes and other plagues! Today preferring C for things that do not run properly interpreted, and python for those I don't end up writing in any other language from some specific reason. (yeah, hanging out with haskell guys and tinkering with weird languages, while programming python)

Cheery
A: 

It was at the release of the 2.0 version. I was still in my quest of the ideal language, while at that time it was more a "quest of the language which suck less", and after years of Turbo Pascal and Delphi it was more logical than, say, Perl, C++ or Forth. Also, I needed a cross platform tool to write helping scripts for a deploiement platform and it was a good match.

edomaur
+1  A: 

I have worked with corporate IT (strategies, policies, bureaucracy and that stuff) for many years and lost much of the contact with the real development. When I started to telecommute two years ago I suddenly realised that I freed up so much time when I didn't have to attend each and every meeting in the office. I then felt that I could make much better use of that time by re-learning how to program again. I knew I didn't want to start off with Java and I was generally sceptic to .Net with the large IDE:s as I always feel that I want to be in control.

I had heard of Python, Perl, Ruby but never used any of them so I just picked one of them more or less by random and it happened to be Python. And what a blast it was, everything I seemed to remember from programming early on in my career just seemed to work in Python and the existence of an interactive shell really helped me gain speed quickly. Now, two years later I have taken up C# as well and can join in in any of development projects we run in the company to review code or have very in-depth discussion with the developers. Python really helped me regain my previous programming knowledge.

Mingus Rude
I have to agree, I think python has helped be greatly in understanding programming in general. Although it could be a natural evolution as my experience increases... :P
monkut
+1  A: 

Because I hated programming, but had to program. Python had always sounded distasteful because of its whitespace issue, and because of some bad company (zope and yum, to name a few) that gave me a bad impression of the language. Still, lots of people were talking about it, so I had to at least give it a try.

It was weird at first, and still is - I guess because I'm learning new things.

The thing is, the only programming language I really knew at the time was PHP (I'm Zend Certified for PHP4 and 5), and I hated coding. I hated programming, because it was such a chore. It was a pain to figure out how to do what I wanted, and it was a pain to do it, and it was all around a huge frustration and waste of my time. I didn't realize what I didn't like was PHP, and that it had soured me on the whole affair.

I tried Python because I needed to code something. I started using Python because it made programming fun again.

Dan Udey
+1  A: 

Why I had to learn Python? Because my sister wanted me to help her with her Python assignments, thats why!

I never touched Python ever again…

Spoike
Fair enough, initially when I started my mind was still in perl mode and I did get frustrated when things didn't work as I expected them. I often ended up writing strange round-about python code. Since I've found if my code gets "strange/difficult" there's probabaly a better way.
monkut
+1  A: 

I stumbled across ESR's Why Python? article. I gave it a try. First with the tutorial, and then Dive Into Python. It clicked with me over VBScript, VBA, VB6, and Perl.

projecktzero
Me too! I heard Python was like Perl, but without the confusing parts and more structured. The whitespace turned me off. I came back a couple year's later, read ESR's article, and then read DiveIntoPython... and now I use nothing but python practically :)
Dan
A: 

I originally became interested in dynamic languages after reading this article on Strong Typing vs. Strong Testing which uses Python as its primary example. As a developer in the .NET/C# world, I took a brief look at IronPython but not much came of it.

Much later I was getting frustrated with writing windows command line bat files and using NAnt for build scripts. I decided to give Python another try (CPython this time) and it completely changed not just my development habits but my whole perspective on programming in general.

Ray Vega