Archive for the 'reviews' Category

Review: JavaScript & JQuery by Jon Duckett

Disclosure stuff: I was sent a free copy of this by the publishers. From 2000-2002 I worked with its author. I currently work with Mathias Bynens, the book’s technical reviewer (but didn’t know this until after reading it).

Don’t tell anyone, but I’m not very confident with my JavaScript – I learned to program in COBOL, FORTRAN, BASIC, 6502, Z80 and DCL which are all procedural, so I was looking forwards to a book that starts at the very beginning and treats me kindly, before clubbing me over the head because I polluted the global namespace and laughing at me for extending my prototypical object literal constructors into my callbacks.

The book’s blurb says “We’ll not only show you how to read and write JavaScript, but we’ll also teach you the basics of computer programming in a simple, visual way” and is the follow-up to Duckett’s hugely successful HTML and CSS Book which sold over 150,000 copies. (In tech book terms, that’s practically Harry Potter; in this industry, 5,000 is a successful book.)

The book looks beautiful. High quality paper, colour images, with real care and attention lavished on the layout and the words. I’m no quivering aethete designer, but I found it pleasurable to read even though it’s a weighty 600 page tome. Each page (or spread) is its own discrete infolump so it’s easy to out down and come back to.

It starts light – defining events, objects, methods and properties, showing the relationship between HTML, CSS and JS, and with a section on Progressive Enhancement (hoorah). However, I was slightly peturbed that the first worked example uses document.write. I can see why you’d do this – it allows you to show something, but without having to muck about appending to the DOM or using getElementById and innerHTML but it didn’t feel particularly good practice (especially as getElementById and innerHTML are introduced soon after, anyway.) In the author’s defence, he does note that this is Considered Naughty.

Elsewhere, we see lots of workarounds and IE-specific aspects of the DOM. I’m comfortable with these being there; we have to live in the real world, and I think that a book that ignores this does a disservice to its readers – it’s right to equip someone to make pages work on IE.wtf or understand what’s happening in older/ inherited scripts.

The book moves briskly after the traditional introduction to loops, variables and other syntax. By page 270 we’re looking at event listeners, including IE5-8, event delegation, mutation events (with a note that mutation observers are coming, but no more than that.)

Chapter 7 begins with jQuery. Again, there are times when jQuery is entirely appropriate. What’s good is that this book teaches JS concepts first, and always keeps the two separate. (I get tired of “JS” tutorials that are actually about jQuery.)

The rest of the book romps through “HTML5″ APIs, JSON, common UI widgets and – usefully – debugging. Attention is paid to pointing out what’s standard and what isn’t, what’s vanilla JS and what isn’t. Progressive enhancement, accessibility and separation of concerns is are kept in mind throughout. This is good. You can see the table of contents.

When I’m reading, I often don’t care if I’m reading a paper book or a Kindle. But in this case, I was glad I was reading the full-colour, attractive book. I’ve railed about the shoddy quality and general unattractiveness of most computer books before. When so much information is available on the web, publishers must provide some sort of extra value. This book has it – the information is thought-through, beautifully presented and clearly explained. While I guess that the majority of my regular readers won’t need an explanation of what a loop or variable is, I believe this would be an excellent book for someone wanting to start with JavaScript, and learn it well. It doesn’t cover Promises, Mutation Observers, but I don’t really think they’re right for a beginners’ book, anyway.

Oh – and it made me realise that I’m not nearly as crap at JavaScript as I thought I was. Which is nice.

Review: Two Gentlemen of Verona, RSC

It’s easy to seriously muck up a production of one of Shakespeare’s great plays, but exceptionally hard to pull off a good production of a relatively weak play like Two Gentlemen of Verona. I enjoy seeing one of the lesser plays produced, as it’s fascinating to see what a really good director and cast can do with unpromising source material.

One thing you can do is have lots of music and spectacle and there are a few musical interludes in this new production. The extended opening is a joy; the ensemble cast re-creates a busy restaurant in Verona, with live music and without dialogue but with lots of audience interaction. It’s great fun. It’s contrasted with the sophistication of the Milanese court later, in a fabulous interlude involving a cabaret singer/ exotic dancer and bizarre Tudorbethan disco dancing.

The production doesn’t try to overwhelm with spectacle, however. In fact, occasionally it lacks pace. This may because I watched it on the third night of its run, so the actors need to get into their stride. But it may be the quality of the text. One of the reasons that the play is weak is that Shakespeare was still learning his craft (many scholars believe this to be his first play) so there are long speeches that are undramatic wordplay. Perhaps they were funny in the sixteenth century but they aren’t now, so I found myself thinking that if I’d directed the play, I’d have been ruthless with my red pencil and removed some of those speeches. (It’s an advantage of one of the minor plays that you can excise stuff without offending too many purists.)

Something else that doesn’t work so well these days are the plays dodgy sex and racial politics. When Proteus falls in love with Sylvia and out of love with Julia he says “And Silvia — witness Heaven, that made her fair!— / Shows Julia but a swarthy Ethiope. / I will forget that Julia is alive”. However, it’s foolish to expect a sixteenth century play to conform to modern standards.

I thoroughly enjoyed the production, especially the performances by Pearl Chanda (Julia), Nicholas Gerard-Martin (Thurio), whose serenade scene was very funny, and Michael Marcus (Valentine). Honourable mentions, too, for Sarah MacRae (Silvia) and Martin Bassindale (Speed). The outlaws were also amusing. It’s also beautifully staged, with enough physicality and dark moments to carry the preposterousness of the plot – no twins or shipwrecks, but we do get a woman dressed as a man and instantaneous reversals of character.

An excellent RSC directorial debut from Simon Godwin. One small niggle: the first half was very long – almost two hours by my watch.

Apps For All: Coding Accessible Web Applications – book review

(I was sent a free ebook of this title. That hasn’t influenced my review. This ebook is published by Smashing Magazine and costs €10.95. There’s a sample chapter available. I have no financial connection with the publisher or author.)

When I read about this book I was excited to read it. I don’t need Yet Another Accessibility Book (I co-wrote one a long time ago) but wanted something that delves deeply into WAI-ARIA and how it interacts with HTML5 and assistive technologies. As this book’s blurb says “the underlying theme of this book is about making the interactivity of web applications include keyboard and screen reader users”, it seemed like the book for me. It’s also tech-reviewed by Steve Faulkner who’s my go-to Bogan for practical accessibility information, so I was pretty sure I could trust it.

WAI-ARIA is one of the vital specifications for making the web accessible. There are three problems with using it, though: firstly, the spec is hard to read and understand, even in the context of specs’ inherent indigestibility; secondly, it’s hard to understand how its concepts intertwine with other specs like HTML and, thirdly, most developers don’t use assistive technologies so are unable to understand or test the output of their ARIA pages.

Therefore, I greatly appreciated that author Heydon Pickering is a developer, so keeps the book practical. ARIA is used, in conjunction with markup and script in situations that you’d really encounter. The problem to be solved is elucidated, and the output is clearly explained. It goes deep, too; I learned a great deal and plan to re-read it soon.

It’s a short book (but quite dense) and Heydon’s prose style is clear and occasionally humorous. But don’t let that fool you; this is an important book because it’s the only one that thoroughly explains the technical merits and use of ARIA (and doesn’t browbeat the reader about accessibility).

Without hyperbole: every developer should read this book, and put its techniques into practice. Now.

David Tennant’s Richard II (RSC)

We went to see David Tennant as Richard II in the Royal Shakespeare Company’s eponymous production last night. As a production it was all you’d want from RSC – great actors, impeccably staged. But I can’t get over the feeling that actually, it’s just not a very good play (or it simply hasn’t aged well).

It’s a reasonably early Shakespeare play, almost all in iambic pentameter with very little prose, and a great deal of rhyming couplets (later plays close scenes with a rhyme, but don’t use it throughout). This made a lot of it sound like a Hallmark greeting card poem as the rhyme and rhythm are quite regular.

There’s also a howling clunker of plot, in which one character simply forgets to tell another of the death of the previous King’s widow:

[Servant:] My Lord, I had forgot
To tell your Lordship, to day I came by, and call’d there,
But I shall grieve you to report the rest
[York:] What is’t knave?
[Servant:] An hour before I came, the Duchess died.

I almost laughed out loud at this.

Another problem is that Richard II is a thoroughly unlikeable character. Perhaps it’s a failure of Tennant’s acting or Greg Doran’s direction (but I doubt it; they’re both highly professional) but Richard simply has no redeeming features, so you I didn’t care what happens to him. He’s vain, messianic and treats his nobles badly. He deserves to lose the throne. At least with Richard III, you enjoy his evilness; Richard II just seems rather wet.

Taffy at The Black Heart, Camden

Last week, I was lucky enough to spend a couple of hours upstairs in a sweaty windowless room above a pub in Camden on a scorching summer’s evening.

The reason I subjected myself to this misery was to see a Japanese punky-pop-shoegaze band called Taffy play. Taffy are a bit like The Primitives, with chainsaw guitar and great pop melodies but also sport a shoegazey-disorted lead guitar and sweet vocals from a singer called Iris. Their drummer, an ever-smiling bespectacled chap who reminds me of Penfold from Dangermouse, plays like two drummers together. They might not be ground-breaking, but they do make a great, summery sound. They’re much too cheerful to be real shoegaze, and they’re better musicians and singers than Shonen Knife, with none of their studied wackiness.

Best thing to do is listen. Here’s their latest single “Tumbling” (but the best tracks from their new Lixiviate album, Sweet Violet and Train aren’t singles):

After paying my £6 to get in, who should I bump into but drummer Ken at the bar. As my 14 year old daughter is in love with him (“he’s so adorable”, apparently) she demanded by text that I have a photo taken with him.

ken

The photo was taken by the guitarist. They both signed my CD cover. Note that Ken’s autograph is a smiling anthropomorphised drum kit. (“It’s so adorable!” squealed my daughter.) I didn’t know what Iris or the bassist looked like to get their signatures, so lost my chance at a rare collectible there.

cover

The band went on, and they were great. The sound was terrible, naturally: pub gigs never have a decent PA, the drummer plays loud to fill the room, the guitars turn up loud so they can hear themselves, and vocals are lost in the mix. Iris has a tuneful, engaging voice, but it’s quite high and not powerful. But they were brilliantly tight, and obviously loved playing. The bassist grooved around until his shirt was wringing wet, Ken flailed around on his drums, cleaning sweat off his specs between songs and never letting his smile falter. The guitarist even played an intro by hitting the strings with a glow stick.

As a band, they’ll either disappear or get really big and you’ll all be jealous of my seeing them in a room of 40 people in Camden. I think their tour finished tonight, but I heartily recommend their album.

Taffy band

Why “The Dark Knight Rises” scriptwriter should be shot

WARNING: may contain spoilers.

The kids wanted to see it, so I took them to see The Dark Knight Rises. Because it’s a film based on a comic and I’m over twelve years old, I wasn’t really expecting to like it, but there were some scriptwriting crimes so egregious that I list them here.

Firstly, the film was way too long. It didn’t help that Cineworld in Solihull decided that air conditioning in a packed cinema in the summer is a luxury that our £28 entrance fee didn’t merit. But it was still 30 minutes too long.

On the plus side, the special effects were good (of course they were: it’s a summer blockbuster) and the babes were suitably babelicious, if Hollywood collagen pout is your thing (it isn’t mine).

But the script was terrible. Now, in a Hollywood blockbuster based on a kids’ comic, I don’t hope for emotional depth. But as the Bad Guy had mobilised thousands of normal people who were prepared to be blown up by a nuclear bomb he’d planted, it would be satisfying to be given even a cursory explanation of why they would. Or even, why Bad Guy and Bad Girl would. (“Because they’re bad” doesn’t work.)

Two can’t-be-arsed script devices were employed repeatedly. The lazy, lazy flashback-with-a-voiceover technique was used several times, as was clankingly clumsy Obvious Explication Dialogue:

“I want you to give me Clean Slate”.
“you mean, the computer program that lets you type in your name and erases you from databases?”
“Yes!”

Imagine if people in real life spoke like that:

“Have you got the keys to the car, Bruce?”
“You mean, our blue Nissan Micra that I bought from my father when he upgraded to a Passat? The one I scratched when I reversed it into a wall outside Aldi last Wednesday?”
“Yes!”

Then there is the mysteriously common movie trope whereby a character who doesn’t speak English suddenly learns it in time for them to utter the words that allow them to fulfill their plot function. I’m thinking of the bald guy in prison who needs translation until he whispers encouraging, motivational words to Batman. Imagine being that guy! All that time, unable to communicate with the Anglophone world and, just when the deus ex machina grants you fluent English so you can go to the pub and chat up girls, you disappear from the world as your bit of plot has finished. Bummer.

And don’t get me started on the unrequited homo-erotic thing between Michael Caine and Christian Bale. Any scriptwriter that requires Caine to cry should be drummed out of the scriptwriters’ guild. He’s spent 85 years being celebrated for not acting – he’s not going to start now.

More fool me for expecting anything other than cartoon characters, I suppose, but grown adults had promised it’s “dark” so I expected a Bergmanesque investigation of why a man would wear tights, with added “Pow!” overlays. Should’ve gone to see The Lorax instead.

Review: Design Is A Job by Mike Monteiro

I’ve been doing a lot of flying lately, and can’t use the lappy on a plane so decided to read computer books (so the boss can’t berate me for enjoying myself on company time) and review them, actually on a blog rather than simply tweeting “Awesome!” or “EPIC FAIL”.

Presumably because I have incriminating photos of Zeldman, the A Book Apart people send me free copies of their publications, but they haven’t asked me to review them, let alone required me to be nice.

This book accompanied me to Bulgaria and I was, I confess, pretty sceptical. I’ve seen a lot of hand-wavy “design and inspiration” talks at conferences (“Look at the lovely Flickr images, I’ve got an iPad, aren’t we all awesome“). I’ve also seen lots of scarily aggressive Americans talk about how they went from start-up to millionaire in less time that it takes me to get around to scratching my balls in the morning, and disliked those talks even more because they displayed a very un-British lack of taboo about money.

Therefore, I was worried that a book about design and money would be some ghastly hybrid of this: “Hey, we’re all children of the universe which is awesome and like, totally full of, like, emptiness. So make all your websites full of whitespace, then grab that mofo and leverage it into the dollar domain!”

My fears were unfounded. Firstly, there is precisely zero designer handwaving in this book. The author explicitly rejects that:

A designer requires honest feedback and real criticism, and that’s not going to happen in a realm where colleagues or clients are worried bout crushing the spirit of a magical being. The sparkly fog of affirmation gets in the way…A designer solves problems within a set of contraints…a designer understands goals…

There is money talk, as there has to be in a book called “Design is a Job”. But there was even a section entitled “Your ethical responsibility” in which Monteiro writes

You have a responsibility to the community at large to make sure that what you’re signing up to design is worth being designed…So before you take on a client, ask yourself whether the problem the client is asking you to solve is one that you feel good about attaching your name to…There is absolutely nothing wrong with making money…but making it to some else’s detrimnent makes you complicit in that persons’s downfall. If a product you design does harm, then you have done harm.

The author (who I’ve never met and know nothing about) comes across to me as a craftsman – someone who takes pride in the job he does, and the wider craft, but who wants to make an honest living doing it. Whether it be design, or branding, or coding doesn’t really matter. Monteiro writes about design because that’sd what he knows best, rather than because the points made in the book are only relevant to product or web design.

Standout chapters for me were the ones that deal with sticking to your own process and the importance of having lawyers. If I were ever in business by myself – regardless of what type of business – I’d keep those chapters close by me.

To conclude: I’m surprising myself to be recommending this book, even though I expected to hate it. Lots of practical advice, written without bullshit in a voice that seems Monteiro’s own rather than that of his editor or publisher, and which can be read on a couple of European flights.

Review: Build Mobile Websites by Castledine, Eftos, Wheeler

I got this book free in lieu of payment for my Sitepoint article Notes on Designing Websites for the Asian Market. When it arrived, I looked in the index for “Opera” and found no entry at all. As this is a book is called “Build Mobile Websites and Apps for Smart Devices” and is about designing mobile websites (not just apps), I decided that the book would be another iOS wankathon, and put it immediately in my recycling pile. (“iOS wankathon” is the technical term employed by medical professionals to describe articles/ books/ conference talks that stupidly assume all mobile users have iPhones or other webkit-based browsers.)

Luckily, I decided to give it a go and picked it up just before getting a flight. It’s actually a really good book, with only one webkit wank (a very low number when “apps for smart devices” is in the title).

There’s good information on responsive web design, although it doesn’t replace Ethan Marcotte’s book, it summarises well. The second edition should add information on CSS Device Adaptation (“CSS viewport”) now that IE10 and Opera support it.

I found the chapter on design for mobile very useful with its different patterns for organising information. The chapter “markup for mobile” was less so, probably because I know more about markup than design.

One slight niggle – in an example app, the use of ellipsis is shown by including the name of a person “I am a celebrity with an incredibly long name for some unfathomable reason”. Long names seem quite common in Thailand, Sri Lanka, Russia, Greece etc; it’s only “unfathomable” if you think in the context of English names.

The only example of webkit wanking comes in the “Mobile web apps” chapter. In order to navigate from page to page, -webkit-animation is used with no other vendor prefixes. The authors have ensured that a simplified page swap is available on other browsers, but that tests WebKitTransitionEvent in JavaScript. Why not just use all the vendor prefixes and the non-prefixed version, and only then fallback to a “simplified” page swap? It’s particularly remiss when Firefox supported Animations from May 2011, while the book was published in June 2011.

Better still would be to ensure that vital functionality like navigation is available everywhere and only then progressively enhanced.

In conclusion, this is a decent book. Client-pleasing stuff such as touch, accelerometer, geolocation is covered. But while it was languishing on my shelf more cutting-edge features have become available. You can still learn from this book now, especially if you’re interested in sites that work well on mobile rather than all-singing all-dancing applications, but it would be good to see a second edition that addresses getUserMedia and proper cross-browser vendor prefixing.

Creative JavaScript with Seb Lee-DeLisle

One of the many joys of going to Fronteers 2011 (even more than seeing Jake Archibald in a mankini) was Seb Lee-DeLisle’s presentation “CreativeJS – beauty in the browser”. Watching sexy particle systems, using mobile phones as pixels and playing NyanCatch was fun and exciting.

I’m a JavaScipt n00b, but an old hand at programming, which I taught myself in the 80s by coding visual games like space invaders and lunar lander. So when I heard that Seb was giving a two-day workshop in Leeds on how to code creative visual effects and games, I decided to go along.

Seb didn’t start at the very beginning; it’s assumed that we have a text editor, a web inspector (I was using Opera Dragonfly, of course) and that we know what variables and loops are. There wasn’t much talk of prototyping and inheritance either – the emphasis was on the making rather than the theory.

We looked at canvas, how to make simple shapes and simple animations. Then we used Seb’s simple library to add drag, velocity, gravity and randomness to particles, all the while building pretty effects that responded to the mouse. We learned canvas rotations and transforms (which I hadn’t really bellyfelt before) by making a generated tree (which I topped off with random cherry blossom).

We learned how to code the game Asteroids, with a reminder of trigonometry that shocked me: who knew I’d ever need SOHCAHTOA or the Pythagorean theorem in real life? This also helped us learn how to make natural-seeming physics.

We all had a brief foray in webGL, albeit abstracting away most of the horrors via Mr Doob’s THREE.js.

It was a great fun course. Seb’s an engaging and effective teacher and I feel much more confident with my JavaScript now (I even suggested an optimisation to Seb’s collision detection code!). Thanks to Seb, Clare who co-organised it, and my fellow attendees.

If you’re looking for an “in” to JavaScript, and you learn by mucking about and seeing what comes out the other end, sign up to Seb’s next course.

Full Frontal 2011 notes

Full Frontal is organised by my co-author, Remy Sharp and his wife Julie (who both juggled recent parenthood with conference running – respect!). I’ve been unable to attend in previous years due to being out of the country but was looking forward to this one, even though I was a little worried that the JavaScript content would be well over my head.

I needn’t have been too scared. The first talk was on CoffeeScript which seemed to me quite intriguing as it (seems to) encourage you to continue thinking of JS as JS (rather than turning it into Java or some such horror) but smooths away some of the syntactical gotchas that get on my moobs. (See Mike Davis’ write-up.) However, I’m a great believer in not cheating until you know the rules properly, so I’ll be delaying CoffeeScript until I’m more confident in my JS.

The second talk was Phil Hawksworth “Excessive Enhancement – Are we taking proper care of the Web?”, which wittily harangued developers to ensure there is proper semantics underneath the JS shizzle and CSS bling – a subject dear to my heart recently. (And he even quoted me, which is nice!)

I skipped talk #3 “Respectable code-editing in the browser” for some synergy-leveraging as I thought it would be too advanced for me. Only afterwards did I realise that the talk was by Marijn Haverbeke, the author of Eloquent JavaScript that I was greatly enjoying on the train coming down on the recommendation of Noo Yoik JS lovegod Mike Taylor.

The talk on Cloud9 IDE by Rik Arends was a bit of a product pitch, but interesting. I wonder if it works across all browsers?

“Scalable JavaScript Application Architecture” by Nicholas Zakas was the tech highlight for me. He discussed a method of structuring an application so that everything was controlled by a main control app with messages passed into it and back out, with everything else being a black box to everything else. This means the programmer must spend a lot of time at the start of the project, designing the sandbox, controller and APIs. This may not be revelatory to most JS coders (or it may be, I don’t know) but it reminded me of learning Jackson Structured Programming in the late 80s when a systems analyst at AT&T. I’d like to see Zakas do a follow-up talk on how to design the sandbox and controller.

Glenn Jones’ “Beyond the Page” talk discussed – and demoed – techniques and emerging standards/ idioms to make Web sites less separated from other apps. We saw Drag and Drop, Web Intents etc. Some evil hackery, too!

Brendan Dawes always scrubs up nice and today was no exception. Although he’s a quivering Flash-lovin’ aesthete (albeit with a Northern accent), he had the techy crowd warming to him and then in stitches with a stream-of-consciousness talk about creativity, new interfaces and expensive pencils.

Last on was Marcin Wichary from Google, who talked of Google Doodles. Who knews that they user-test them? It was a fascinating talk and the good news is that he’ll be blogging about them in the future.

FullFrontal was a super day. The after party had lavish quantities of free grog. The venue was quirky and fun, with free coffee all day. Each talk was handpicked – in fact, everything about the event was curated by Remy and Julie. I’ll be going next year (although not staying in the Travelodge, Preston Road, which was a dump, and nothing to do with the event).