uStorIt: Something new

So I’ve been looking at the set of technologies that whoever it is that generates buzzwords seems to be calling “html5″. One of the big ones is client side storage. Very useful, very nice. A lot of attention has been paid to the client side database storage found in google gears and the latest webkit browsers. What is more interesting to me is actually the key-value storage available in Firefox 2+ as well as webkit browsers. For a lot of use cases (most?) key value is all you need, relational db is overkill.

Anyway, for an app I’ve been thinking about for a while I started to look into this. Unfortunatly there are two different, incompatible implementations of this (webkit vs not-beta firefox) and it doesn’t work at all in IE8 or the rest of the A-Grade. So I hacked together the beginnings of what I hope will be a normalization layer that should make clientside key-value work in at least Firefox 2+, Safari 3+, anything with gears and IE8. I’ll probably explore the dojo flash approach as well. Anyway, its something to keep me busy on the shuttle.

jQuery: Bad for Your Brain

I would say the vast majority of people making websites are “framework hackers” of one sort or another. They can throw up a site with rails, (or symfony) and jQuery in about five seconds flat. People who tend more to the designer end of the spectrum can actually put together pretty decent websites using these tools, which is obviously a good thing.

Now, one of the most interesting things (to me) about jQuery is that it takes full advantage of the functional aspect of javascript. The way its super-terse syntax works is using functions that return functions, or functions that return objects with members that are functions:

$("p.neat").addClass("ohmy").show("slow");

So ‘$’ is a function, that takes a parameter, which returns an object with the method ‘addClass’ which does the same and so forth, so the cool chaining aspect of javascript starts to come together. Its all vaguely reminiscent of ruby. Cool. Anyway, my only problem with all this (and its a small problem) is I think that this kind of slickness might actually be masking the basics of how JS works. And I notice it melts people’s brains. And by people I mean those who want to be front end engineers and start with jQuery and then have no clue what to do when they say, get to yahoo and need to use a different framework.

Basically jQuery is amazing for building apps fast. But I would almost say that if you really want to learn js you need to start without jQuery and only use it once you have an idea how you would accomplish the same tasks without it.

Hey Cool

You can post on wordpress from Yahoo Mail now. That’s handy.

Changing Frameworks is not the Answer

If you are, at some point, working on a project and you find the framework you are using doesn’t do something you need this just means you need to write some code and extend the framework. Changing frameworks…or worse including multiple frameworks…is completely wrong. It shocks me how often I see sites with JQuery & prototype on the page.

Javascript Books

Sometimes I think of programming a bit like playing music, where the languages are the instruments. C/C++ is like violin or trumpet. You need a basic level of skill and knowledge in those instruments to make any music at all. If I just picked up a trumpet (even as someone who knows another instrument) I am unlikely to be able to make any music at all. The lower level languages like C are completely unforgiving, you literally can’t make a program without a basic level of knowledge. Javascript is more like the piano, anyone can play Heart and Soul with about five minutes of instruction.

Anyone can make a few scripts. And with libraries like JQuery out there people with little to no understanding of the language can actually achieve quite sophisticated things on their web sites. Thanks to libraries the majority of tasks in JS can be achieved with very little knowledge. Which is great for the most part. However, if you want to start developing interesting and large scale applications in Javascript you are going to need to understand the language. You should be able to read the code of libraries like JQuery and YUI and understand what is going on behind the scenes.

Someone on an internal list recently asked what books they should get to get to the next level in Javascript. It turns out you can read only authors that work at Yahoo! and get an excellent JS education. Here is the list I sent to answer that question: