Over the past year or so I’ve come to realize that getting the markup right is the most difficult part of building Web applications. Had you asked me back a year ago, I’d have guessed that working with JavaScript was the most difficult, but now I know better.
Server side development is in many ways the easiest. For one thing, the tools are great. These days it’s easy to set up a full server environment on your laptop, and the tools for working with code are incredible. Whether you’re a Ruby developer working in Textmate or a Java developer working in Eclipse, NetBeans, or IDEA, the tools are out there to amplify your productivity. The pace of innovation in the server space is incredible as well. Good ideas are being transported from one platform to another at an incredible pace. (Ruby on Rails stole just about everything good from the Java stack, and now the Java folks are stealing all the good ideas they can from Ruby on Rails. PHP is benefitting from both as well.)
The most powerful advantage of working on the server, though, is that it’s empirical. Does this SQL query return what I expect? Does the markup emitted by this method look like what I think it’ll look like? It’s easy to answer these questions, and it’s advisable to write automated tests to verify that the answers to those questions haven’t changed.
JavaScript was once painful to write. You had to write a lot of code to accomplish simple things, the JavaScript implementations varied widely between browsers, and it was difficult to debug your JavaScript code. Most people got by on scripts of dubious quality that they copied from other web sites. Two things have changed, though to make life much easier for JavaScript developers.
The first is that there are now a number of incredibly powerful JavaScript libraries available. They make it easy to accomplish big things with just a little code, and they abstract away the browser differences that made programming in JavaScript so difficult. The second is that the tools have gotten better. FireBug brings a lot of the key features of a good IDE to Firefox. Having a real debugger is a huge help in working out where issues lie in your code. (You can only take window.alert()
for so long.)
These days, I find working in JavaScript to be a pleasure, and I never thought I’d say that.
That brings us to HTML and CSS. Given a design, I’m starting to find that it’s not even possible to guess how long it’ll take to get the design to work across all of the common browsers in use today. Generally, I leave the markup to the experts, but for the past couple of months I had to delve deep into CSS and HTML myself. The first thing I discovered is that even making simple stuff look the same in Internet Explorer 6 and Firefox is a challenge. The next thing I learned is that it’s not even easy to make things look the same in Internet Explorer 6 and Internet Explorer 7.
When I went to people who know a lot more about cross-browser issues than I do, even they had to do a lot of experimentation to get things even close to looking right. And the secondary problem is that there don’t seem to be any sort of systemized tools or techniques to make any of this stuff much easier. Yes, FireBug is essential (how else are we supposed to know when styles are being overridden or aren’t being applied), but it seems like we need a lot more help if we want to make writing markup easier.
Is it really as bad as it seems, or am I missing something here? Because it sure strikes me as a rough time if markup is your medium.
It isn’t too early to start using HTML5
A representative of the W3C says it’s too early to start using HTML5. Scott Gilbertson of WebMonkey argues to the contrary. Given the pace at which Internet Explorer users upgrade, if you are opposed to using HTML5 now, you’ll probably still be opposed to it a decade from now:
In the meantime, developers are building awesome things with HTML5, CSS3, and JavaScript. Check out PaintbrushJS, a new library written by Dave Shea that enables you to apply filters to images using CSS and JavaScript. Not only can you change the way images appear on the page, but you can also allow users to save the filtered images.
Obviously we can’t just migrate to HTML5 wholesale yet (unless we’re creating Web sites optimized for iOS and Android), but the time to weigh whether using HTML5 and compensating for old browsers makes more sense than using older techniques that work in all browsers has arrived.