John Topley’s Weblog

Good Luck To The Happy Couple!

In a break from our scheduled programme, I’d just like to wish my good friend John Conners and his long-suffering girlfriend (John’s words, not mine) and very-soon-to-be wife all the best for their wedding tomorrow. I hope you’ve got that speech written, John!

How I Learned To Love Web Apps

I’ve been thinking about Web applications lately and in a U-turn worthy of an unpopular politician have revised my opinion of them. Regular readers may recall that previously I’ve bemoaned the poor user experience offered by Web apps in comparison to their desktop cousins. That’s still true—although not as bad as it used to be—but I just don’t think it matters any more, because Web apps are good enough for what most people want to do most of the time. Of course there are exceptions, for example I don’t think we’ll be seeing Photoshop rewritten using PHP (or even Rails!) any time soon. I don’t see computationally and GUI intensive software leaving the desktop whilst the way the Internet comes down the pipe is architected as it is.

Thanks to developments like AJAX (the widespread adoption of XMLHttpRequest, not the invention of the buzzword), we can now make Web applications that start to approach desktop-bound ones in terms of responsiveness and all-round slickness of experience. In fact, if we’re not careful there are a whole variety of ways now at our disposal that we as developers can break the user’s expectations of how things ought to work. By the way, AJAX should really just be named “A”, because you can use XMLHttpRequest from VBScript if you’re mad enough, and JSON or even text works just as well as XML for the response format. What’s more, the whole shebang can even be invoked synchronously. All of which goes to show that the AJAX moniker is entirely without merit apart from being catchy and widespread, and in the end that’s all that matters because it’s not important what the label is, so long as everyone has a common understanding of what it represents.

It’s been fascinating watching the growth over the past year or so of frameworks geared towards making Web application development easier, particularly in the A(JAX) arena. There’s so much stuff for developers out there now that simply wasn’t available this time last year. Kids today don’t know how lucky they are. And a lot of it is good stuff too, with decent documentation and testing behind it. Step forward the Yahoo! User Interface Library and probably the Google Web Toolkit too.

All this musing on Web apps is all well and good but I’m actually putting my money where my mouth is and paying monthly fees to rent the use of several online applications. Namely Backpack, Flickr, Strongspace and Wufoo in addition to the ones that I use for free: Basecamp, Gmail and Google Calendar. I know that I’m going to be hosed if my broadband goes down or if any of these apps disappears—is anyone else worried that 365 Main have a large data centre in San Francisco?—but I have more confidence in the ability of Google and 37 Signals et al to back up my data than I have in my own ability to do so on a regular basis. Besides, the sheer convenience of being able to access my data that’s held across these services from anywhere there’s a broadband Internet connection has so far outweighed any downsides. I’ve surprised myself by how I’ve gone for this in such a big way. It doesn’t bother me in the least that I don’t have a CD-ROM to show for my money. I’ve still got the installation media for software that I’ve bought over the years and all it does is gather dust and waste space. Also, I don’t consider my data to be interesting enough to get all paranoid about.

I think it’s interesting to take a moment to reflect on some of the ways that Web applications have no equivalent in the desktop world:

  • You get to them using URLs rather than by having your OS launch an executable file. URLs can be typed directly, bookmarked or linked to from somewhere else. They can also be mistyped and you might end up somewhere else entirely. Imagine how bizarre it would be if you thought you were starting Excel and you ended up running some program for browsing extra-large clothing!
  • URLs can be chopped about. Properly designed Web applications should support URLs that can be hacked. Getting around desktop applications is totally different in that you’re offered a finite number of things that you can click on to get to some place else. You don’t see the internals of how they’re stitched together.
  • If you’re not careful, users might bookmark your Web application when it’s in an inconsistent state. Short of doing something unspeakable to their browser, you can’t stop them from hitting Ctrl + D when you least expect it.
  • The entry point to commercial Web applications is also usually a Website that’s geared towards selling that application.
  • There’s no consistency within the user interfaces of different Web applications. Sometimes you click buttons for actions, sometimes an image made to look like a button and sometimes it’s a hyperlink. Having said that, consistency now seems to be a dirty word amongst desktop applications too. Office 2007 has a brilliant UI that’s totally non-standard and Apple just can’t decide how they want their bundled OS X apps to look.
  • There’s no desktop equivalent of a 404 error page!

In spite of all these oddities and potential problems, I think the model of letting software companies take the strain when it comes to not only developing applications, but also to installing, updating and securing them and of backing them up is a good fit for how most people want to use computers. Let’s face it, people like things that just work without too much thought being required on their behalf. We’re all busy enough already.

I didn’t believe Sun Microsystems when I first came across their slogan that The Network is the Computer, but it looks like they might actually turn out to be right to a large extent. Unfortunately for Sun they didn’t figure on most providers of Web applications doing so using commodity hardware and open-source software, but Sun’s loss is our gain as both developers and users.

Best Of Breed Web 2.0 App

I dislike using the term “Web 2.0″ because no-one really knows what it means, but nonetheless it has come to represent a certain type of Web application. Anyway, Wufoo caught my eye because it’s a brilliant idea, brilliantly executed but with a shockingly bad name.

Rails Tip #6: Resetting The Session

Rails makes it dead easy to clean up objects in the HTTP session. No need for anything as complicated as iterating over them and setting them to nil. Simply use:

reset_session

—within a controller.

Learning Lisp

The title of this post is misleading because I’m not actually learning the programming language Lisp. Not directly, anyway. I have come across some of the more exotic and esoteric aspects of programming during the past year or so, some of which originated in Lisp. For example, discovering closures and using functions as first class data types in JavaScript. The reason I mention Lisp is that defmacro has written a really great article that goes some way to explaining Lisp in terms of familiar ideas.

Once you have a few programming languages under your belt, it’s easy to get into thinking that they’re all basically the same and that all you need to do to pick up a new language it to master its syntax. That’s not true at all though and sometimes you come across things in a new language that completely alter your computing world-view. For example, did you know that methods in Ruby can return multiple values? Coming from Java I find that quite odd! At the moment—and like many other people—I’m learning Ruby because that’s what Rails is on and I definitely feel like I’m only just scratching the surface of it. However, I already like Ruby’s terseness. Part of my frustration with Java comes from its verbosity and part of that comes from the design of the platform itself. It may use all the correct design patterns but sometimes all you want to do is open a file and read its contents quickly and easily.

The idea that there could be a winner in a World Cup of programming languages had fundamentally not occurred to me until I read Paul Graham, who is perhaps the most famous advocate of Lisp. That the winner should be a language that not only shares its name with a speech impediment, but that is also so old is doubly fascinating.

I would like to learn Lisp purely for academic pleasure if I ever found myself with lots of leisure time, but I wonder whether all roads in programming ultimately lead to Lisp anyway? I suspect they do if you keep travelling.


Archives

  • Jul
  • Aug
  • Sep
  • Oct
  • Nov
  • Dec

More Archives


Sign In