DISQUS

DISQUS Hello! /var/log/mind is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

/var/log/mind

Dhananjay Nene’s free (as in free speech) opinions on all things related to Software Engineering
Jump to original thread »
Author

How I ended up selecting Python for my latest project

Started by Dhananjay Nene · 11 months ago

I have 8+ years experience on C++ and Java each and at least consider myself an expert on the latter and used to consider myself one on the former a long time back. For any programmer it is a difficult choice to move away from the platform and the environment in which one has both [...] ... Continue reading »

28 comments

  • thanks for sharing! Very interesting post, I like how you present factual data and your personal thought. Very inspirational.

    This is a very good demonstration that for any project, one should take some time to think of the best tool to use (not necessarily the one we're used to).
  • PLEASE look at Merb, Ruby will make you so happy!
  • I can tell you have done your homeworks and I came to the same conclusions one year ego. Nevertheless I would love to hear your opinion about web2py.
  • @Massimo Given the broad range of languages I covered, it simply was not feasible to look at every single framework. web2py was not something I looked at so would be unable to formulate an opinion. However what I did like about django was its modular and layered design, fairly broad feature coverage, performance metrics, community size, the various independently developed contrib modules / djangosnippets.org and the substantial yet efficient use of metaprogramming in its db.model and admin modules. If I do get around to checking out web2py I shall most certainly ping you on the same.
  • I do understand when you say:” Rails however seemed limited to simpler use cases” and that is ActiveRecord fault, maybe you shod try using Datamapper or Sequel for your model layer, that will give you some more flexibility specialty in legacy data models, the normal way to evaluate them is using Merb frame work.
  • I can understand one of your concerns about Ruby and doing justice to the language, getting caught in re-factoring, etc. Actually, I think we all go through that with Ruby by its very nature. However, its expressiveness and meta strengths keep us. We all need to exercise a little self-discipline...

    Rails may "seem" limited, but I don't think it is and coupled with Ruby, the sky's the limit. You can mix-out pretty much anything and there are many other libraries which meet needs and "roll right in".

    Nice post. Thanks!
  • I'm going through a similar language/platform selection process now - with many of the same constraints as you had. I too was leaning toward Python. One very significant hurdle with Python is that my application will be heavily text search driven and I haven't yet found a search toolkit with even close to the power that Java Lucene has. Using PyLucene would introduce the same resource problems as using Java for the web framework. In my case, the cost of more expensive hosting may be less than the cost of using a non-Lucene search option.
  • Whatever happened to Pylons?
  • smacko, Xapian might be an option. It's C, so you still might have problems on a hosted machine, but it should be comparable to Lucene and has a *very* nice Python wrapper with xappy.
  • This comment is from cies. Unable to extract it from its resting place at my is_human wordpress plugin. Hence reposting on original author's behalf. (Just enabled the new plugin - need to figure out what to do in such cases).

    By cies on June 9th, 2008

    i\'d like to second the \'dude\' poster.. maybe you want to look at merb + datamapper. it is addmittedly not as tested as django but the setup of this framework makes a lot of sence (re-using ruby\'s gem framework for it\'s components and plugins, very loosly coupled, you can choose stuff like HAML and fly, many deployment options (including mod_passenger now more to come (jruby?)), ruby syntax all the way, super small mem footprint, eventbased, thread safe, ok i stop now) anyway, django looks nice as well nice write up.
  • I gave a hard look at Ruby on Rails for a latest project. It sounded cool but then there is a huge learning curve and finally had to settle with my well known territory, .NET
  • Good write up. Yeah I unfortunately have come to the same conclusions. With Python + Django you'll be writing an app with potential for high speed AND high productivity. Not as cute as ruby, but without the deathly magic of rails, and faster. So it wins, as much as I hate to say it [and I love Ruby and work on it all day!]
    Maybe maglev will change all this. Hope so :)
    -R
  • Hi there,
    I recently went through a very similar process, coming from a Java background. I also settled on Python and Django for similar reasons.

    If you are interested, I wrote it up here:
    http://jetfar.com/django-python-frameworks-and-...

    Although perhaps not as succinctly as yourself.

    BTW: I'm very happy with the outcome.
  • @jt


    {I can understand one of your concerns about Ruby and doing justice to the language, getting caught in re-factoring, etc. Actually, I think we all go through that with Ruby by its very nature. However, its expressiveness and meta strengths keep us. We all need to exercise a little self-discipline…}

    I just might be able to get the self-discipline ... if only I had the time to get there :). As I move towards dynamic languages - python seemed more manageable a shift in the given time frames than Ruby. I loved Ruby syntax and especially all its nifty features but found Python easier to read.


    {Rails may “seem” limited, but I don’t think it is and coupled with Ruby, the sky’s the limit. You can mix-out pretty much anything and there are many other libraries which meet needs and “roll right in”.}

    My assessment was that everything was doable .. but the cost factor here was much higher compared to hacking through django.

    {Nice post. Thanks!}

    All the encouragement helps. Thanks.
  • @Finebanana

    Ahh ! I skipped that bit about Pylons - didn't I ? I didn't find anything worrisome about Pylons - but what I knew for certain was that I would need an extended admin interface and would need to hack through the models. Pylons does not really get into those spaces much. Django offered a more comprehensive set of capabilities all nicely interdependent on each other (especially admin and models).
  • @elhumano

    I preferred the everything in one box capability of django. I would like to keep framework changes to the minimum, and rather than having to study multiple frameworks and figure out how to change these in an appropriately interdependent way - made sense to have a single framework with all capabilities. Just makes it a little easier I guess.
  • @Rich

    Nice post. The contrasting between mod_python and fastcgi in the context of hosting environments is quite helpful. Glad to know you liked the post.
  • You might consider either Jython or IronPython (the latter runs Django too). Who says you can't have your cake and get full.
  • You want complexity in your app, but at the same time want to use the rather primitive admin?

    SQLAlchemy is by far the weapon of choice for serious applications, and Pylons is as pythonic as you can get when it comes to frameworks.

    These two together offer a control and explicitness which far surpasses the rest.
  • @Nick

    And pray what would be the non-primitive UI that would be on offer from Pylons and/or SQLAlchemy ? Maybe I need to be educated but I did not see a another good UI forms tool in python which helps automatically generate forms (even if primitive per your characterisation) from the object model.

    No disrespect to other frameworks - but isn't it just too naive to disregard something for being primitive when that at least helps you get half way. I am grateful for everything that helps me move forward and I try to move further down the road myself from that point onwards.
  • Nice comparison, I especially like the reasons given.

    Most interesting is that the "traditional" web-language (PHP) seems no longer leading the pack of NEW apps by a great lead, and instead is constantly challenged by both python and ruby.
  • @michael
    Thanks, I'll check out Xapian.
  • Danny...its been a long time I have gotten into multiple evaluations/adoptions. This was a very good compilation of analysis and view points. Definitely enjoyed reading it. :)
  • Hi there,

    A very interesting peek into the thought process of arriving at the choice of tools for a particular implementation. This must be the same even if it is your first site or the latest one because these frameworks are bing actively developed. I noticed many people are thinking of using pylons and web.py, I hope my recent writeup on Python Web programming frameworks might help: http://www.arunrocks.com/blog/archives/2008/06/...

    Cheers
  • I agree with Nick.

    I very recently underwent a very similar process to Dhananjay and ended up on Python/Pylons.

    Django was cut out because it simply isn't built with the same philosophy as Pylons. This difference does matter to me and the complex applications I build. Basically, Django = Rails and Pylons = Merb. If your app is truly complex, Pylons loosely-coupled architecture of components will be quite a plus. Django's pluggability is useful to get to market quicker if you aren't doing anything innovative. If you want to whip a site up for blogging, just plug it in.

    Lastly and more specifically, for most complex online apps I build, the idea of "automatically generate...forms from the object model" happens rarely. Often, the UI is as complex as the underlying layers and automated form generation is simply not feasible except on a few CRUDish pages on the fringe of the app. My guess is you may think your app is complex, but it actually isn't, from the UI POV. (The underlying layer(s) may be, but then Django's admin cruft doesn't matter.)
  • @alphadog,

    In the days since I realised more some of the issues you've pointed out wrt django and pylons a little bit more.

    wrt the gui, I have in the past had the opportunity to build a complex gui on top of an object model. Its an exceptionally complex task. Which is why I do not believe django as is is going to work at all ... what I was saying is that django gives me a much stronger starting point to start introducing all the additional complexity.
  • Dhananjay,

    You have got it right!
  • I've been programming PHP on the job for 6 years... and I hate every day of it. I picked up Python for my personal projects 2 years ago, comparing it with what was available at the time. A friend of mine uses Ruby/Rails exclusively at his workplace (pretty rare), and has the same sentiment as the post's author. Mainly, it has very simple use cases, and more complexity in the application requires a lot of work-a-rounds and hacks in Rails.

    I performed a fairly thorough evaluation of the Python web frameworks and also concluded that Django would be best for a particular project I've been working on. This project required a comprehensive and powerful full-text search engine, as well as a javascript/ajax driven pdf-like browser. Hardly any of it used simple plug-ins (no blog drop-ins here.) Django very easily handled all of the "extra" stuff I threw at it. For example, there is nothing in Django's ORM that natively handles PostgreSQL's tsearch2 full-text engine. But writing the code inside of the Django framework to make this work was intuitive and easy.

    I'm delighted with my choice, and look forward to using Python/Django for most future web applications. BTW, writing this application in Python with Django took FAR less time, code, and complexity than would have been necessary with PHP. My code is actually a pleasure to read! (for me, anyways ;)

    Thanks for the post!!

Add New Comment

Comments are closed for this post.
Returning? Login