Vincent Gable’s Blog

November 24, 2008

How To Space Your Code For Maximal Interoperability

Filed under: Design,Programming,Quotes,Usability | , , , , ,
― Vincent Gable on November 24, 2008

The new rule for indentation and alignment: use tabs for achieving an indentation level, spaces for character alignment within an indentation level.

Christopher Bowns (and independently Peter Hosey)

The arguments make total sense to me. Here’s hoping for better IDE support in the future. Unfortunately, (though interestingly), according to Steve Yegge, indentation is very hard:

I would have been publishing this article at least a month ago if it weren’t for indentation. No, six weeks, mininum.

See, I thought that since I had gone to all the thousands of lines of effort to produce a strongly-typed AST (abstract syntax tree) for JavaScript, it should therefore be really easy to do indentation. The AST tells me exactly what the syntax is at any given point in the buffer, so how hard could it be?

It turns out to be, oh, about fifty times harder than incremental parsing. Surprise!

Here’s a forward-looking (somewhat contrary) opinion,

Soft-wrapped code (leaving a long line long, and letting the IDE handle the spacing) also appears to be the direction that Apple are heading and they tend to drag a lot of Mac programmers along in their wake.

Matt Gallagher

March 5, 2008

Zooming can be Difficult

Filed under: Design,Research,Usability | , ,
― Vincent Gable on March 5, 2008

I hadn’t realized until today that “zooming” was a nontrivial task. I’m habituated to choose “zoom in” to see more detail, but less of the big picture, and “zoom out” to see how less-defined blocks fit together. But selecting which flavor of zoom is appropriate is not as easy as it first appears.

I didn’t realize this until I saw two participants in usability tests frequently choose the opposite kind of zoom from what they wanted. One lady would even explain how zooming would be helpful to what she was going to do, then say that she should perform the opposite kind of zooming that she described.

Understanding zooming involves forming and manipulating a three-dimensional model of abstract data represented on a two-dimensional screen. Sometimes there’s even the question of what is being zoomed. If you zoom in on a window containing a map, should the window itself change size (take up the fullscreen perhaps), or should the contents of the window be changed?

Small wonder then that some people choose the wrong kind of zoom, especially if they are not spatially-oriented.

The good news is that a zoom error is easy to recover from. You just hit the other button. Recovery is even easier if a knob, or other reversible input device, controls zoom. You just twist in the opposite direction, without having to acquire another button first. The scroll-wheel on a mouse is such a control, but …

But be careful when using the scroll-wheel to zoom, because users may trigger a zoom when they meant to scroll. I have this problem all the time with Google Maps. After a few hours of using the scroll-wheel to scroll webpages, I look something up in the Google Maps webpage — but if I attempt to use the scroll wheel to scroll the map it shoots my viewpoint up hundreds of miles into the atmosphere. Even though recovery is easy, it’s very disorienting, and quite annoying. It’s also slow, because the data has to be loaded over an internet connection — even the fast connection at the office is still orders of magnitude slower then loading the data from local memory.

It’s interesting that Mac OS X’s Exposé feature, while arguably a zooming-interface, is not described as one. To quote the help, “Your computer includes Exposé, a tool that temporarily rearranges windows to help find things.” No spatial reasoning is needed to use it.

Powered by WordPress