Mobile Site

Usability, the Soul of Python

An Introduction to Programming Python Through the Eyes of Usability

Jonathan's Corner (Sitemap) > Orthodox Books Online, and More > Technology > Usability, the Soul of Python: An Introduction to Programming Python Through the Eyes of Usability
Previous  1  2  3  4  5  6  7  8  9  10  Next
Printer-Friendly Version

Python's core library is documented extensively, searchably, and well at http://docs.python.org/library/ (be advised that python.com, besides being easy to type when you really mean python.org, is a famous porn site), and Python's core library is your best friend. The code samples peppering this chapter are intended to simply illustrate basic features of the language; once you get up to speed, it's not so much that you'll have better ways of doing what that code does, as that you'll have better ways of avoiding doing that, using Python more like a magic wand. I will not be attempting to provide select highlights from the core library because that would easily be a book in its own right. But we are saying that the Python core library is among a good Python programmer's most heavily used bookmarks.

I advocate, when possible, moving from unadorned, "bare metal" Python to what might be called "Python++." Let me explain what I mean by this and why it is more Pythonic.

The move from C to C++ is a move made by extending the core language to directly support objects, templates, and other features. There have been some efforts to extend the Python core language: easy_extend is intended to make it Pythonically easy to tinker with and extend the language syntax. However, I have never heard of production use of these extensions Pythonically saving time and effort while making programmers more productive.

What I have heard consistently is that using a good library really does qualify as a move from "unadorned Python" to "Python++". A StackOverflow user asked, "Have you considered using Django and found good reasons not to?" And people listed legitimate flaws with Django and legitimate reasons they use other alternatives, but one developer got over thirty upvotes with a response of, "Yeah, I am an honest guy, and the client wanted to charge by the hour. There was no way Django was going to allow me to make enough money." For the web, frameworks like Django, TurboGears, and web2py offer significantly greater power with less work in more truly Pythonic fashion. Python's standard library does come with its cgi module, and it is possible to write webapps with it, but using the cgi module and the standard library to implement a social networking site with all the common bells and whistles would take months or years. With Python + Django + Pinax the time is more like hours. If you use Python, you don't have to reinvent the wheel. If you want a social network and you use Django and Pinax, you don't have to reinvent the internal combustion engine either, or power steering, or antilock brakes, because they are all included in standard packages for a car or truck. If your goal is an online store instead of a social network Pinax will not likely be of much help, but Django + Satchmo will. Both of them provide ready-made solution to routine tasks, whether user avatars with gravatar support, or a shopping cart with that works with any of several payment gateways.

This is true if you are developing for the web; if you are in another domain, similar remarks could be made for NumPy or SciPy.

I do not wish to discourage anyone from using different frameworks than I have mentioned, or suggest that there is something wrong with thinking things out and choosing TurboGears over Django. Web2py in particular cuts out one very daunting hurdle to new programmers: a command line with a steep learning curve. However, I do advocate the use of a serious, noteworthy "Python++" framework and not the standard library alone: the cgi module works entirely as advertised, but the difference between Python + Django + Pinax and just Python with the cgi module is comparable to the difference between Python with the cgi module and programming on bare metal in C.

I may further comment that fundamental usability is the same whether the implementation is Django, TurboGears, web2py, or for that matter Python with the cgi module or C working with bare metal. It would not be a surprise if Ruby on Rails or PHP developers were to look through this and find it speaks to how they can create a better user interface.

Summary

What is it that is attractive about Python?

Perl has been rightly called "Unix's Swiss Army Chainsaw," and perhaps nothing else so well concisely describes what it is that Perl has to offer. Java might be compared to the equipment owned by a construction company, equipment that allows large organizations and a well-organized army to erect something monumental. C would be a scientific scalpel, molecular sharp: the most exacting precision you can get unless you go subatomic with assembler or machine language, but treacherously slippery and easy to cut yourself with, something like the scientific-use razor blades which came in a package labelled: "WARNING: Knife is extremely sharp. Keep out of children."

It is my suggestion that Python is a lightsabre, and wielding it well makes a graceful foundation for usability.

Ajax Without JavaScript or Client-Side Scripting

So, You've Hired a Hacker (Revised and Expanded)

Usability for Hackers: Programmers, Anthropology, and Making Software More Usable

Within the Steel Orb

Top

Jonathan's Corner (Sitemap) > Orthodox Books Online, and More > Technology > Usability, the Soul of Python: An Introduction to Programming Python Through the Eyes of Usability
Previous  1  2  3  4  5  6  7  8  9  10  Next
Printer-Friendly Version