Why Python?

add to del.icio.us with other 0 users
For long I have been wondering "Why Python?" - why is python gaining popularity? Why do many prefer python for all sorts of work? Myself being a Java fan (some of my friends say fan-atic) it makes it more interesting to me to understand the reason behind its uprising.

I am a software engineer mainly working on enterprise systems with Java. One of my hobby is to write scripts for anything that I (might) have to repeat in near future. I usually prefer shell scripting for writing scripts. But for some particular tasks, like converting seconds to ISO8601 formatted date string, multi-threaded http request and response handling with file i/o; I needed something extra for these as shell script was becoming overly complicated.

From all the buzz about Python I said myself let me give it a shot and check it out. I have to admit that I was astounded, stupefied , awed at how simple and powerful it was to achieve all that I needed for my use case. It took me just about to 3 hours to get Python 2.5, IDLE installed and write my first 2 programs which the do the following tasks-
  1. Take seconds as input from command line argument and print its ISO8601 equivalent.
  2. Take URLs as input and take 'n' samples for their response-time and total duration while all URLs should perform these tasks in parallel.
Not only have I learnt new languages earlier, I was also a Lab Instructor and Teaching Assistant for programming courses, from my experience to say that I will get these things done within 2 hours without having even read ANY article on Python or knowing nothing about it in the past, I have to say that its awesome (Please let me know if you feel I was slow). It was down to simplicity of the language compounded with fluent syntax and excellent documentation. Within the time mentioned I learnt and used Objects, Collections, Classes, Control flows (if, for), Exception handling, File I/O and Threads. If you are interested to checkout what I achieved you can checkout them out here.

From what I read later, I learnt that its equally simple to build UIs with Python and with some Googling I learnt of Google App Engine, which just makes developers life easy (at least thats what its there for).

I plan to do more work Python in near future and learn it and master it. If you have not yet tried Python, then I recommend to do ASAP and enjoy it.....
Share/Save/Bookmark

9 comments:

  1. It is good to read your feedback about Python. It is really a powerfull language for all propouses. Welcome to Python!

    ReplyDelete
  2. That's a question that is still in my mind. And I still didn't found the answer.
    Some years ago I had a brief exposure to python but I didn't found compelling reasons to keep using it.
    Some time ago I decided to give it another opportunity, and started developing a desktop application. At least for now, I didn't found any major advantage over Java. The code I'm writing ends being very similar to the one I would write in Java, except I don't have the benefit of using a powerfull code completion as the one provided by Eclipse. Maybe I'm using the wrong approach due to my Java background.
    I'm especially annoyed with the need of using self to access instance attributes.
    I agree that it's a language with some interesting features, but I still didn't found the need to use them.
    Anyway I will keep using it for my application, hoping to be enlightened.

    ReplyDelete
  3. Welcome to the nice python world. Fantastic how you write you satisfaction about skype. 2 hours is really good. I required an afternoon to read the python tutorial and starting to program. After that I was infected. :-)

    ReplyDelete
  4. Ahh.. sorry I mean python ... not skype..

    ReplyDelete
  5. @Christiano, @kai
    I am so in intrigued by it strength that I just discovered that this is the language I can integrate with my tools in order to allow user side scripting to add some dynamism. Hopefully will blog about it soon...

    @joao
    It depends on what we are trying to achieve with any language I guess. For my case I found Python to be extremely useful for quick development for staffs that I did not need to compile and place somewhere just to get it to run in trial and error way. Plus I got everything done. May be for your use case Java is the best option, why dont you try Python with Jython to code Swing? Then you will be able to have a better idea. I just bought "Beginning Python" it has a whole chapter dedicated to it :).

    The book also goes about using python to code servlets :). Try the book it could be enlightening :). Hope you enjoy it too.

    ReplyDelete
  6. Hi!
    As a Python enthusiastic it's really nice to read your post :-)

    @joao
    For people with Java background a good post is "Python is not Java" http://dirtsimple.org/2004/12/python-is-not-java.html

    As christiano said, welcome to Python :-)

    ReplyDelete
  7. nice post imran bhai,
    so far i can remind i last tried python in 2002. i had the same impression.

    but these days i really love ruby and i feel i can almost do anything (except unicoded text related stuffs). i write server related scripting in ruby.

    if i didn't find ruby i suppose to look back to python again.

    ReplyDelete
  8. @Hasan bhai
    Ruby is fantastic, but I sort of prefer Python, no compelling reason yet, but I think its versatility to do anything is a deterministic feature.
    Will have to try to Scala as well, but only once I am tired with Java, Python and Shell Scripting :).

    ReplyDelete
  9. I also tried Python but not explored it completely, I hope to go through more and understand its real strength as you did.

    ReplyDelete

Search