A notch above a monkey

Javascript: The Good Parts and string.split problem

I just read Douglas Crockford ‘s book JavaScript: The Good Parts . It’s what a technical book should be. Concise yet full of useful information as a result of clear scope and sticking to it. If my experience is anything to go by, then there are not many Javascript programmers who wouldn’t benefit from it.

I did found one bit that wasn’t quite right. On pages 91-92 Douglas discusses string.split method, which can take a regular expression as a separator with which to split string. Douglas rightly points out that if regular expression includes capturing group (stuff between paranthesis like b(mmm)c ), then strings matching those groups will be included in the split.

However Douglas is not completely correct when he says that some implementations drop empty strings in the output array when separator is regular expression. If you run this demo in Firefox3 and IE7, you’ll see that IE7 drops even non-empty strings from capturing groups, while Firefox3 includes them.

Still, I would find a bug in my code faster this week if I read his book sooner.

Reading electrons

My wife and I have a problem. We love buying and reading books, but ran out of shelf space for them years ago. So we’ve been storing some of them in closets and boxes while we find a more suitable solution.

Like others we love physicality of books and it is hard to imagine buying artifacts that exist only in digital form. However, while searching for a good solution I did notice that useful life-span of most technical books is only few years and that we would save a lot of space and trees if I bought and read their electronic versions.

This has lead to my renewed interest in state of electronic readers, which I’ve been following on and off since I first heard of technology almost a decade ago. In last few months I got a chance to try first version of Kindle , read few chapters on Sony Reader PRS-505, checked how it feels to do it on iPod touch and read Designing Web Interfaces to the end on Nokia N770. By the way, I can only recommend that book to anyone interested in development of web applications.

So this post will be short overview of my experience so far.

Dedicated electronic readers

As said, I’ve used Kindle1 and Sony PRS-505, although my experience so far has been mostly colored by later. Most if not all such currently available devices are based on same technology, E-ink , and hence offer fairly similar reading experience as far as visuals go.

That experience is very good. It’s not quite paper, but it is certainly much nicer to read than computer screens, especially outside. It’s most annoying current limitation is probably absence of colors and depiction of b&w images in 16 or less shades of gray. You won’t be buying photo books for them any time soon.

What bothered me more though were tendency to use proprietary formats (Kindle) and absence of search (almost everyone else). I expected that device designers would notice that electronic format doesn’t offer a chance to flip through pages and remember position of interesting passages spatially and would counter this by adding a search function, yet most didn’t and as such these devices really are readers and not researchers.

With good technical books I spend more time looking up pieces of information than I spent reading it in the first place. I guess I would be willing to sacrifice search if devices themselves were significantly cheaper, but since they aren’t, I won’t be buying one anytime soon.

Still, if you like reading lots of books but don’t care about owning them, you should really look into them. They are simply magnificient when it comes to packing A LOT of books into tiniest amount of space without sacrificing much readability. Hell, since most if not all readers allow you to set text size, it might even be easier to read on them.

Tablets

I own and use two, iPod touch and ancient Nokia N770 . It’s a common story with multipurpose devices. You get to do a lot with them, but you usually have to sacrifice something compared to specialised gadgets.

I haven’t read much on iPod touch and it’s unlikely I ever will. It has a fairly small screen (and screen resolution) that makes it rather unpleasant to read texts with plenty of tables and diagrams. Pinching screen looks nice on commercials and doesn’t bother me too much when browsing web, but it gets tiresome quickly enough that I don’t want to do it repeatedly.

I also tried Kindle application, which works well enough for literature, but is even more limiting than Kindle device. There is no search and you don’t flip through pages all the time only if you are comfortable with reading text at smallest font size.

Nokia on the other hand has screen good and big enough that I needed to scroll only in one direction. Since that can be done with the same button that is used to flip through pages, I could read book using only one hand, which is nice since it let me read in most impossible body positions. As iPod touch it also has a color screen that is quite useful when dealing with technical material. What it lacks though is search in its PDF viewer that is also missing even in latest maemo incarnation on OS2008 (checked on Fry’s tablet).

Too bad. Nevertheless it will remain my main ebook reading device for foreseeable future.

Other observations

As already noted, I feel current crop of readers are geared mainly to reading books and not much to browsing or searching. Since most of them are built on same technological base, it’s understandable that their hardware is very similar, but I was still surprised to see that same lack of distinction when it comes to features implemented in software.

I thought about buying printed and electronic copy, but changed my mind when I looked at price of the bundle . What I thought I would be buying is convenience. What price suggests to me is a sale of another copy. I probably would buy both, if price of bundle would be up to 15% higher than price of printed version.

That does not mean publishers are wrong, since I am hardly a representative sample, but I suspect I am not the only one who is thinking about building electronic library before they go ahead and purchase a reader. This transitioning phase where readers are not widespread yet might not be long enough to matter anyway and publishers probably don’t care about speeding it along since for most of them devices are just a content transportation mechanism that isn’t owned by them.

Tablets, with screen and resolution big enough work surprisingly well as long as you don’t try to read under direct sun light. Their other downsides are much shorter battery life and need for good eye-sight unless you are willing to scroll a lot.

Still, even though I won’t be buying an electronic reader this year, it is only a matter of time when one of them will replace my tablets as reading device.

Quo vadis, Nokia

It’s been a month since I got an iPod touch as a present and I’ve been using it regularly since. I still have and use both a Nokia N65 phone and Nokia N770 tablet , but use of later has been diminished in last month.

iPod touch experience

I can’t help not to think of Touch as basically this decade’s Palm organizer. Thin widget with pleasant user experience that can be extended with myriad of applications, whose developers are — judging by iPhone versions — limited not by their imagination, but with device capabilities and limited expandability.

I still don’t like its on-screen keyboard and wish I had at least something like Graffiti . Hence I don’t write on it anything longer than two sentences and together with lack of camera, built-in microphone, GPS, Bluetooth or even just self-made software, it makes Touch a read-mainly device. Consumer device would be another, more ghastly, but appropriate description.

As a side note, even my now aged N770 tablet is more friendly to creators and hence I still find use for it. I just don’t want to browse web on it because of its very very dated browser that can’t be updated.

Still, even with annoying limitations I like iPod touch a lot. It’s hard not to with its polished interface and an App Store that is probably its killer application. Choice of applications in Slovenia is more limited than in USA, but still very wide and downloading them is so easy and cheap, you might have to fight against developing an addiction to it.

So what about Nokia?

Mobile devices space has become really interesting in last year. iPhone, iPod touch, Android with G1 and upcoming Palm Pre are finally bringing experience on web and otherwise, that we were promised years ago. But what this list lacks is any gadgets from Nokia.

I like Nokia. They had friendliest phones that are remarkably open in industry that likes to control everything. I think their tablets are great, even with shortcomings that should be resolved by now. But even with lots of innovation I get an impression that they are lagging behind.

As a complete outsider who only passingly follows what is happening in mobile industry, I can only ignorantly speculate about its reasons and plans.

I believe first problem for Nokia is that unlike Palm , Apple or even Google it’s not a niche player and tries to build phone for every possible user. It releases them too often. Taken together it is no wonder that just Nokia Europe lists 115 devices that are either selling now, were recently or will be in near future.

That’s too many devices, each with slightly different software, that create a very fragmented market. In such environment you can’t really hope that application would be pushing phones capabilities which aren’t there in most cases. Hence applications Nokia offers are not nearly as exciting as what Apple has.

Next problem presents development environment, which is simply awful. Symbian might have been a nice platform back when, but its time has passed and I doubt open-sourcing it will help. Java hardly works better, but it’s probably a bit nicer to use even though it feels slower. Python is nice for tinkering, but not really an option until it becomes pre-installed. There’s also a web runtime, which is mostly missing. Few phones support it and only one phone available can use it for something more significant than a window to web.

Much of what I just said is not true for tablets, but historically they didn’t seem to get much love from company. Too bad, since I think they are one of the most exiciting things Nokia has.

I do remain an optimist. Purchase and relicensing of Qt together with its upcoming S60 version signals that company is aware of development problems. Qt also offers a possibility of a framework that could be used everywhere and hopefully this will include Fremantle. Generally I don’t put too much faith in rumors, but some of them give credible hints that next tablet could be even better than an already great N810. If it also brings a distribution model comparable to App Store and a bit more polish, then it could be a big success even with non-geeks.

But what they need to do in my opinion is spend less time trying to build all encompassing services like Ovi and spend more effort in building amazing devices that integrate well with what is already out there. And by integration I don’t mean an app hidden in some folder on phone. Upload to Flickr should be available right after you took a photo. I also wish they didn’t try to leverage existing platform and users so much and were more daring and forward looking. If platform you have is stopping you from developing a phone you want, then find or develop a better one.

Until then I am sticking with what I got. A great phone for my needs that few match and a couple of nice tablets.