Tagged as django

23 Mar 2008
51ixby6bw0l

I've been reading: Pro Django: Web Development Done Right

Disclaimer: I don't actually own a paper copy of this, I'm just in the process of working through it online at djangobook.com. But while I'm at it I just wanted to jot down a few thoughts that are fresh in my mind.

I'd looked at django briefly a while back but had been slightly put off by the templating mini-language along with a few other minor quibbles. Lately though, I've been feeling the need to give it a second look. After getting some practical experience with Rails, and seeing the backlash against it play out, I've been catching recurring glimpses of django waiting in the wings and rehearsing lines for its role as understudy.

I had planned on ordering the book in the near future but just started in on the online version out of impatience. Unfortunately, it's turned out to be a relatively disappointing experience. The djangobook website looked like a pretty promising venture when it appeared. Chapters would be posted as they were written, and comments were enabled on a per-paragraph basis, setting many eyeballs to work as cheaply labouring editors and technical reviewers.

I read a couple of the first chapters as they arrived and then left it alone until now, with all chapters accounted for and the finished book finally published. I don't know what happened in the interim, presumably comments were made, some were taken into account, and the odd revision was made to the text on the basis of these. From the dates on the comments that remain, it appears that any from prior to the release of the physical book have now been cleared out leaving a blank slate alongside the finalised copy.

This is where things start to disappoint for me. The book was released late last year, and in the intervening months a respectable new crop of comments has sprouted up throughout. Unfortunately, a hefty portion of these are pointing out easily avoidable errors. Scan through the text online and wherever you find a paragraph with upwards of 4-5 comments, you'll find a legitimate complaint. There are simple typos and stylistic issues. There are problems with the over-arching structure of the book. And then there are installation showstoppers where instructions aren't working in a given environment and readers have had to Google for fixes.

Where clarity is lacking or mistakes have been made in the text the comments are invaluable. Comments that aren't available in the printed book. The book whose copy had already been finalised. The book which is already on sale.

Ok, books are published with errors. Ok, the authors are developers and not professional writers. They're just trying to take some time out of their already busy work lives for a healthy stint of product evangelization. There are excuses that can be made. But it seems to me that there is some confusion as to the distinction between the frozen in time print edition and this living breathing web edition.

Is it done now? Are we going to see further updates? Are their political issue issues because the publisher doesn't want to impair book sales with a web version that's a superior product? (Although it already seems to be by virtue of the comments alone). Where there are legitimate complaints in the comments it seems like the majority would be fairly quick and easy to fix. So what's the situation? The waters are muddied further by the presence on the website of an errata page. Presumably it's targeted at readers of the print edition but, again, without a formal statement clarifying the distinction we're left to guess.

Aside from the print/web divide there are also issues with the structure of the book in general. It doesn't feel like much thought has gone into the examples used. We start out building pages which format the time, then we build a database centered on books, then we populate one table only to try out the admin interface using another, next we create a search form for a (still empty) table before skipping off to do a contact form...

When you're trying to follow along at home it's just a little too scatter-brained for my liking. Either do a tutorial, or go with a reference, but don't sit on the fence. And either way, if you're giving code examples please try to avoid them being reliant on things that you could've easily walked us through in earlier chapters. If I can't type something in and try it out there and then it disrupts the flow of my reading and has me skimming ahead for the next example I can use.

I think the Pragmatic Programmer's AWDwR has faults of its own, but the structure of the first half of that book is good demonstration of what I'm talking about. It steps you through the majority of what you need to know using an online book store metaphor and maintaining consistency throughout, even adding in a bit of meta-story about the client-developer relationship during production. It may sound like hand-holding, but that kind of attention to detail really makes for smooth learning as you step through the code example-by-example.

The other alternative, of course, is to get out of my way and give me a reference so I can put the pieces together myself. And yes, before you mention it, I know about the documentation at djangoproject.com. Maybe that will be a better fit for me in the long run, it's just a shame to see such issues with the chosen ambassador for what's obviously a pretty cool technology.

0 comments

15 Feb 2008
13 Jan 2008
12 Jan 2008

Deploying Web Frameworks

There was a lot of chitter-chatter this last week about the new web frameworks and the situation with regard to their performance and ease of deployment in shared hosting environments:

  • A Dreamhost employee bemoans the lack of support for shared hosting in Rails.
  • David Heinemeier Hansson responds with his standard "scratch your own itch" riposte.
  • Alex Payne chips in with the view that shared hosts are toy environments anyway.
  • James Bennett points out that this is indicative of a broader issue which also affects Django and the like.
  • GNU VInce adds some particulars about Django's deployment situation. He also hints at the problem of game-changing technologies making it difficult for n00bs to climb aboard.

I've been waiting for a while for the hype to die down so we could have a sensible conversation about all of this. It seems to me that the vast majority of the Rails naysaying has been hinged on a misguided comparison between it and PHP, and complaints about it's performance. There's clearly an issue there, but the issue doesn't seem to me to be with Rails in particular. The "it's hard" and "it's slow" complaints both seem to be missing the fact that Rails, Django et al are solving a much larger problem than PHP.

The new web-development technologies are insta-frameworks, they come with all your professionalism and all your infrastructure in place from the outset. And the necessary baggage of memory overhead and complexity come along for the ride. The old familiars that we've been used to; PHP, Perl and the like come from the direction of shell-scripting-land where the most common case is the most basic. There are 100 hello worlds for every 1 webapp with all mod-cons. In contrast, the new web frameworks have the giants of Java-land in their sights. They say: we expect you to use url-rewriting, ORM, granular caching, TDD, asset servers etc. They'll make it as easy as humanly possible to do so, but as part of the bargain they'll expect you to step up and fulfill your side of the contract as a modern web professional.

And therein lies the crux of the problem I think. The new web frameworks shine a harsh critical light on the yawning gap between how we all started out and where we all should be. It seems like the majority of "I tried it, I didn't like it" stories are from people who burnt their tongue on the first taste and realised their skills weren't up to it. And the cries of "deployment! performance!" are from those who are aghast that they should understand anything about the servers and environments their apps are running in.

When a framework solves all the problems you were familiar with, it's humbling to find that the problems you're left with are those you know the least about.

Yes, there's more to it than that and there is the odd complaint that's valid and well considered. There's certainly room for improvement, but these technologies are very, very young. If we can just support new ideas, give them a little breathing room, help investigate the new bottlenecks and understand that no technology can be all things to all men, then we might just see some progress.

0 comments

15 Jun 2007
12 Jun 2007

Where am I?

This site belongs to Matthew J. Tarbit esquire. A tired old web developer holed-up in a hideaway somewhere in the depths of Leeds, England.

Along with being a home for my ramblings and linkings, it's also a resting place for the bones of a shared blog by the name of Pixelised, now long departed.

If you feel the need, you may add my outpourings to the deluge that is your already overflowing info drip feed.

Or why not rest a while and dig through my entries like a corpulent pig in search of all that is truffle-icious.