Re: Marketing Python - An Idea Whose Time Has Come
Posted: Mar 3, 2006 9:26 AM
No doubt marketing is important but what actually makes you choose one programming language over another for a given project?
Here's what informed some of my recent choices. No doubt pros choose differently; I'm an enthusiast.
Simple web application for my department: both Java and Ruby offer excellent and very easy to use libraries or frameworks for web and database applications, and there are great books for learning this; e.g. Howard Lewis Ship's "Tapestry in Action". I looked into Python and found lots of interesting stuff (like CherryPy) and some downright scary stuff (like Zope), but as a beginner I didn't think I'd be able to work out how to write a well-designed application. I also found a lot of distracting stuff which was mainly python fans sniping at other approaches (un-marketing python).
My next web project: will involve REST or similar. Having had a quick look I can't find a java library/framework that won't require major investment to configure. Python and Ruby on the other hand both have libraries that are explained in one chapter of a book for beginners. So far it looks like Ruby's standard library has the edge but if I want to integrate with my existing java project, jython might be better than jruby (although jython docs tend to be old and I'm not sure which libraries will work with jython).
Email filter script linked to database: There are probably many choices here but python has nice libraries for email and the DB API is slick; they're all well documented in "Beginning Python" (Norton et al). Plus the standard Python documentation of email libraries is excellent (although more simple examples would help). In fact, the python's standard documentation is very much more appealing to me than any other language's I've seen.
Simple GUI applications: I'm going to be picky an insist on good licence and looks, and I want a result in a weekend. I look at Ruby and don't find too much documentation, and I look at Swing and it's just too much. Python, by contrast, has easy to use, well documented libraries and there are several helpful articles plus this topic is well covered in python books. I like pyGTK which has great documentation included and I can use glade (a GUI designer) to ease some of the pain without loosing track of how the thing works. Including choice of langauge and libraries, it takes a weekend to build a GUI for a very simple app even though I don't know python so well and don't know GUI programming. Nice work python people! Next please help me not to have to worry about threads in more complex apps.
Non-trivial database stuff: this is *very* terrifying for an amateur and here my priority is to do it right (e.g. use transactions) while needing to know as little as possible about any specific database. Documentation is absolutely vital. Java's Hiberanate and Spring come out tops, particularly because of HQL (the hibernate query language) and the way Spring enables you to configure transactions independently of writing code. The reference manuals for both are excellent, plus we have the "Hibernate in Action" and "Spring in Action" books. These give me confidence that I'm not missing something important.
XML: I want to produce and consume it without having to understand it, and it takes about 2 minutes for me to realise I especially don't want to have to think about SAX or DOM. Although the documentation is somewhat tedious for a hobbyist like me, Java's JAXB 2.0 is surprisingly easy to get started with: I create classes, it creates a Schema (whatever that is) and lets me validate XML and convert it directly into objects and back to XML again. It has a very intuitive API and the examples on the JAXB website are clear and simple. Nice work Java people! Next please explain how the annotations work with simple examples.
Organising projects: I'm not a pro, I need help on how to organise and test larger projects. Here an IDE is just the thing, but I don't want to have to spend too long learning an IDE because I need to get on and program. Luckily I can use one ide (eclipse) for java, python, jython and ruby, although it seems to work best with java.
Beginning programming: I want to get my little sister started on programming this summer, but which language to start with? The choice depends on books which explain good design, general ease of use including especially how errors are reported, and languages that enable you to do a lot without payment. This is a really tough one: python and ruby have command lines; Python's standard documentation is most readable; Python and Java are ahead on intermediate books; as far as I can tell java's got a slight edge on easy of use and error reporting because the autocomplete, javadoc integration and live syntax checking in eclipse works so well. Hmm.
Sorry for the long post, got a bit carried away. Anyway, here's how to evangelise me:
* don't un-market python (no sniping)
* even more documentation of libraries, simple examples, articles and books please
* make it easier to compare competing libraries quickly (e.g. which postgresql library)?
* explain how to do Jython with Hibernate, Spring, JAXB2 and tapestry
* document a slick approach to doing REST or similar, including saving state between requests (don't make me think about GET/POST, sessions etc)