PragPub 2010-03: Issue #9

Table of Contents

Features

- JavaScript: It’s Not Just for Browsers Any More
by Jason Huggins
Node.js is a toolkit for writing high-performance network servers in JavaScript. And it’s events all the way down.

- JSON—The Last 10 Feet
by Craig Riecke
IBM built Jazz from the ground up, so they had the freedom to build it any way they wanted. So why did they put all that bloated XML in it?

- Nice Apps, If You Can Afford To Write Them
by Chris Adamson
The App Store and iPhone opened a market, but will iPad limit it to large apps?

- Testing as Contract
by Brian Tarbox
Why not use testing as a guard against changes to the design?

- When Did That Happen?
by Dan Wohlbruck
On the birthday of the typewriter, Dan tracks the twists and turns of a concept from the typewriter through keypunch machines to today’s computer keyboards.

- Our Daily Beer
by Steve Peter
If you can cook, you can make your own beer at home.

Departments

- Up Front
by Michael Swaine
Homebrew and JavaScript

- Choice Bits
A little knowledge that is perfectly safe.

- The Working Geek
by Andy Lester
Andy continues a two-part essay on public speaking, telling all you need to know about slides and fear.

- Swaine’s World
by Michael Swaine
To try to get a handle on what makes a book a must-read, Mike examines the phrases people used repeatedly in recommending books.

- The Quiz
by Michael Swaine
A monthly diversion at least peripherally related to programming.

- Calendar
Author sightings, partner events, and other notable happenings.

- Shady Illuminations
by John Shade
HTML is going to kill Flash! Or maybe Silverlight! No it isn’t.

Except where otherwise indicated, entire contents copyright © 2010 The Pragmatic Programmers.

Feel free to distribute this magazine (in whole, and for free) to anyone you want. However, you may not sell this magazine or its content, nor extract and use more than a paragraph of content in some other publication without our permission.

Published monthly in PDF, mobi, and epub formats by The Pragmatic Programmers, LLC, Dallas, TX, and Raleigh, NC. E-Mail support@pragprog.com, phone +1-800-699-7764. The editor is Michael Swaine (mailto:michael@pragprog.com). Visit us at http://pragprog.com

ISSN: 1948-3562

Up Front

Homebrew and JavaScript
by Michael Swaine
2010 is shaping up to be an exciting year—wait for it—for JavaScript. JavaScript? Yep, homely old JavaScript, which is now being taken seriously in development situations where it would never have been a candidate before. It’s due to a number of developments, described by Jason Huggins and Craig Riecke in their articles on Node.js and JSON.

The late 1970s—when personal computers were called microcomputers, Bill Gates was writing software for some crazy entrepreneur in Albuquerque, Apple was still two guys in a garage, and hardware and software hackers met at a sharing session called the Homebrew Computer Club in Palo Alto—was an exciting time to be a developer.

But the FOSS community has in many ways kept that homebrew spirit alive. And today developing for iPhone or Android can give you the sense that you could be the next indie breakthrough star with your one-developer-shop mobile app. But will it last? Chris Adamson wonders whether the iPad will kill the indie software hero dream.

We’re not overlooking actual homebrew, by the way. On the theory that you should occasionally step away from the keyboard and spend some of the intensity that you bring to your development projects on something completely unrelated to computers, Steve Peter walks you through everything you need to know to brew your own beer.

And we’re not overlooking the history of computing, either. Dan Wohlbruck takes us back in time, looking at the development of those type-y things, from the first typewriter to modern computer keyboards. Do you know what the typewriter’s killer app was? Dan tells you.

And that’s only about half of what’s in this issue. Brian Tarbox is back with a thought-provoking viewpoint on testing. Andy Lester continues a two-part essay on public speaking skills for developers. I explore what makes a tech book a classic. As usual, we have a quiz, an events calendar, and our Choice Bits collection of miscellaneous observations. And John Shade weighs in on HTML 5 and standards. He’s in favor of standards, at least for other people.

Choice Bits

We Thought You Might Like to Know...

A little knowledge that is perfectly safe.

What’s Hot

Top-Ten lists are passé—ours goes to 11. These are the top titles that folks are interested in currently, along with their rank from last month. This is based solely on direct sales from our online store.

1^

8

Metaprogramming Ruby

2^

4

The RSpec Book

3^

6

Hello, Android

4v

2

Agile Web Development with Rails, Third Edition

5

5

iPhone SDK Development

6^

9

Programming Ruby 1.9

7v

1

SQL Antipatterns

8v

3

Language Implementation Patterns

9^

NEW

Cocoa Programming

10^

NEW

Beginning Mac Programming

11^

NEW

The Definitive ANTLR Reference

Nibbles from the News Desk

Andy Lester in Computerworld: In the March 8th issue of Computerworld magazine, the Career Watch page will have a Q&A with Andy Lester, author of our unconventional tech job search book Land the Tech Job You Love. Andy will be discussing job hunting and job boards in the interview.

Language Implementation Patterns is #1: Terence Parr’s new book, Language Implementation Patterns, condenses and organizes the key patterns programmers need to implement domain-specific languages. It’s been in the #1 slot in the compilers category at Amazon since its January release, edging out the classic “Dragon book.”

Sips from the Twitter Stream

Toward the end of February, it seemed like there was a rule that tweets had to be about the Winter Olympics, the Chilean earthquake, or Cliff Stoll’s 1995 Newsweek article on why the Internet will fail. Here are a few off-topic tweets that slipped through:

I like how slow Buzz has made Gmail. Now it feels exactly like I’m using Outlook. — Hunt Henning

You cannot see the mountains from Mountain View, there are no redwoods in Redwood City, there are no high stumps in Palo Alto. — David E. Weekly

Trips to New Orleans consistently remind me how underrated the tuba is. — Chad Fowler

Max Headroom is coming out on DVD. A visionary TV series from the 80s that anticipated backpack journalism. — Jay Rosen

Dunno about you but I find the MadLibs form style REALLY irritating. The signal:noise ratio is far too low. — Simon Harris

I think @pragpub is right. Apple is telling the world the all purpose PC is done. The Ipad is only to Consume data not create large amounts. — Mark Welker

Google search results for the words "search engine": AltaVista, Dogpile, Bing, Ask.com. — Gina Trapani

In the Forum, you’ll find two views on Flash and a correction to an October quiz answer.

You can follow us on twitter here.

The Working Geek

How to Give a Tech Presentation, Part Two
by Andy Lester
Time the audience spends reading a slide is time spent not listening to you.

Public speaking is a fantastic way to improve your social skills and hirability, and in last month’s column, I explained how user group meetings and technical conferences are an ideal place to do this. I talked about the importance of your topic and the angle of your technical talk, and how to create an outline. This month I’ll explain how to think about your slides, keys to effective presentation, and how to handle common public speaking fears.

How to Think about Slides

Before you create your first slide, consider their role in your presentation. Your slides are not the primary source of information. The words that you speak are why the people are there. You’re not simply putting bulletized summaries of your words on the screen and reading from them. Slides are there to supplement your spoken words, not prop them up.

Keep words on your slides to a minimum. Time the audience spends reading a slide is time spent not listening to you. Anything more than a sentence on a screen means that you’ll lose the audience for a few seconds, and that can be hard to regain.

A slide is also appropriate for showing code listings and technical details not easily translated to English, so long as the audience is not expected to read the entire slide to understand it.

Graphs and charts also make powerful slides if they are truly an example of a picture being worth a thousand words. If your defect rate dropped dramatically over a six month period, a chart showing that is a fine slide. It’s easier to see than to read.

One place it does make sense to have a slide heavy with bulletized text is when wrapping up the talk, or at the end of a section. You can put up a recap of your 3-7 main points that you want the audience to remember. You’ll be verbally recapping as well, but not reading the bullets from the screen behind you.

As to the specifics of creating text and images for the slides themselves, that’s a subject far too large and graphic-heavy for this space. I heartily recommend the book slide:ology: The Art and Science of Creating Great Presentations by Nancy Duarte.

However, I do strongly recommend that you create your slides in some standard slide software like Keynote, OpenOffice Impress or PowerPoint. Don’t mess with anything other than those three. After you’ve got some slide deck creation experience under your belt, then you can spend hours messing with HTML-and-Javascript-based packages like S5. If you’re a seasoned speaker, you may even decide to try to roll your own homegrown software—and get halfway through it before deciding it’s not worth the hassle.

Prepare for the Big Day

If you’re going to spend the time and energy preparing a talk, whether it’s a five-minute lightning talk at a user group meeting, or a half-day tutorial at OSCON, promote it. Let people know that you’re going to be speaking, when you’ll be speaking, and what your topic will be. Post it to your Twitter feed and flog it on Facebook at least once. Tell your mom and dad, too. You never know who they’ll let know about it.

When you’re done with your talk, people will inevitably ask for a copy of your slides. Make them available online before your talk. Create an account on slideshare.net, and include the URL for it on the last slide of your deck. For example, mine is slideshare.net/petdance. Then upload your slide deck at least an hour before your talk, so it will be sure to have been processed and made available before your talk is over.

Get a presenter’s remote. They’re only about $20 and plug into your computer’s USB port and have buttons for going forward and back in the presentation. When the time comes to advance your slides, you don’t want to have to look down and find the spacebar. Worse, if you’re like me and you walk around the stage (whether it’s an actual raised platform or not), you don’t want to walk back to the podium where the computer lives. If your remote has a laser pointer in it, that’s even better, especially if you are showing code listings. It’s silly to try pointing at a function call in a line of code five feet above your head.

It’s a good idea to get someone to introduce you before you speak. When you’re introduced, it helps put the audience in the frame of mind to like you. They’ll probably even give you polite applause, which feeds that urge.

Don’t wait until five minutes before to ask a buddy to do it. Ask the event organizer if someone will be available to introduce you. Many events will have this set up anyway, and will ask you for a bio.

Write your own bio from the point of view of the listener, and make it related to your talk. Don’t think that you don’t need an introduction because you’re at your local user group and everyone knows you. At least one person in the audience won’t.

Here’s a sample introduction:

Tonight’s talk, “External Penetration Testing of Secure Systems,” will be presented by David Lightman. David has been a programmer and security expert since getting his first IMSAI microcomputer in 1983. He has consulted extensively with NORAD, and is the inventor of cinematically convenient voice synthesis. In his spare time, he enjoys a nice game of chess. Please welcome David Lightman.

This covers all you need. It gives the title of the talk, your name, and some of your credentials. An optional bit at the end gives a human interest factoid. The introduction should have a clear ending so people know when to clap and start liking you.

Handling Speaker Fear

If you’re a first time speaker, chances are you’ve got fears, and you’ll be nervous, but I’m here to assure you that things aren’t as scary as you’re imagining.

The best defense against fear is preparedness. On the day of your talk, make sure you’ve got all the parts and widgets you need. Video adapter, power cords, mouse, whatever it is you need, make sure you have it. Get to the event early so you can set up, and to allow for Murphy’s Law.

Don’t be afraid of being a new speaker, or that you won’t be good enough. Whatever you do, don’t apologize for being a new or nervous speaker. Chances are the audience won’t notice, and if you apologize you’re asking the audience to pay attention to your nervousness.

Don’t fear not knowing enough. You may get a question you don’t know the answer to, but that’s OK. Just say “I’m sorry I don’t know the answer to that,” and move along. If you’re worried about the question eating up too much time, say “I’d be glad to discuss that with you after the talk, but right now we need to keep going,” and move along.

And in Closing...

Public speaking can be a challenge, but that’s the way most things worth doing are. I guarantee that you’ll learn a bit about yourself, and probably the topic you’ll be discussing, by giving a talk. Who knows, you may just find that you have a knack for it.

I’d be remiss if I didn’t thank Mark-Jason Dominus and Damian Conway for their help and inspiration in my own public speaking exploits. They’re two of the best speakers I’ve ever seen, and if you get a chance to see either of these two speak, do so, regardless of topic. They’ve also been very giving of advice, and this column and the last wouldn’t have been possible without their guidance over the years. Thanks, Damian and Mark.

Andy Lester has developed software for more than twenty years in the business world and on the Web in the open source community. Years of sifting through résumés, interviewing unprepared candidates, and even some unwise career choices of his own spurred him to write his nontraditional book on the new guidelines for tech job hunting. Andy is an active member of the open source community, and lives in the Chicago area. He blogs at theworkinggeek.com, and can be reached by email at andy@theworkinggeek.com.

Swaine’s World

What Makes a (Tech) Book a Classic?
by Michael Swaine
To try to get a handle on what makes a book a must-read, I examined the phrases people used repeatedly in recommending their must-read books for programmers.

Like many of you, I suspect, I’ve read a science fiction book or two in my life. Like you, I’ve read a few books on programming issues. Quite a few. Some of them I would call classics.

Those who share my interest in science fiction may be aware that the Nebula Award nominees for 2009 have been selected by the Science Fiction Writers of America. Most Nebula-watchers are probably focused on the dramatic presentation competition this year, where the choice is among Avatar, Coraline, District 9, Moon, Star Trek, and Up. I’m more interested in the novel competition.

I want to know what professional science fiction writers think is an exemplary book, and I want to know what professionals in software think is an exemplary technical book. I track the Jolt awards and wade through lists of Books Every Software Developer Should Read and Best Books for Software Developers and technically-focused Amazon listmakers’ Wish Lists.

I realize I’ll find more careful and sage advice on what makes a good tech book by reading, say, Dave Thomas’s advice to would-be writers. But I keep going back to the lists. Maybe I’m just a list junkie. Maybe I’m taking that whole Wisdom of Crowds meme too seriously.

But for me there are solid reasons to read lists of recommended books. I read to discover gems I didn’t know about, to be reminded of classics I’d forgotten, and to get moral support for my own prejudices.

I recently studied a number of recommended reading lists with a particular question in mind: what makes a book a classic? Is the book a textbook that has been critical to many a programmer’s education? Is it the seminal text in some area? Is it a comprehensive tome on some subject? Is it just charming and engaging? Did it change the reader’s life, or her thinking? Or is it one of those books that nobody reads but everybody just knows is really important?

Reading Lists, Refactored

Five books appeared on just about every list I examined:

- Programming Pearls by Jon Bentley

- The Mythical Man Month: Essays on Software Engineering by Fredrick P. Brooks

- Peopleware: Productive Projects and Teams by Tom DeMarco and Timothy Lister

- The Pragmatic Programmer: From Journeyman to Master by Andrew Hunt and David Thomas

- Code Complete 2: A Practical Handbook of Software Construction by Steve McConnell

Maybe some of those books are too new to be called classics. Maybe they’re candidates for classic status. But these five books do seem to be regarded as must-reads. Then there were the books that kept appearing, but not as reliably as those five:

- Structure and Interpretation of Computer Programs by Harold Abelson and Gerald Jay Sussman

- Compilers: Principles, Techniques, and Tools by Alfred V. Aho, Ravi Sethi, and Jeffrey D. Ullman

- About Face 3.0: The Essentials of Interaction Design by Alan Cooper

- Refactoring: Improving the Design of Existing Code by Martin Fowler

- Design Patterns: Elements of Reusable Object-Oriented Software by Erich Gamma, Richard Helm, Ralph Johnson, and John M. Vlissides

- The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie

- The Art of Computer Programming by Donald E. Knuth

- Rapid Development Steve McConnell

- The Design of Everyday Things by Donald S. Norman

- Code by Charles Petzold

- The Art of UNIX Programming by Eric S. Raymond

- Joel on Software by Joel Spolsky

- Agile Web Development with Rails by Dave Thomas, David Hansson, Leon Breedt, and Mike Clark

You probably have one or more books in mind that didn’t make these lists, like P. J. Plauger’s Programming on Purpose, Andy Hunt’s Pragmatic Thinking and Learning, Steve McConnell’s Code Complete, Andrew Schulman’s Undocumented Windows, Larry Wall’s Programming Perl, or Alistair Cockburn’s Agile Software Development. Oh, and I didn’t mention the Pickaxe Book. Can’t leave that out. Or how about Kent Beck’s Extreme Programming Explained, Kernighan and Pike’s The Practice of Programming, Dan Friedman and Matthias Felleisen’s The Little Schemer/The Little Lisper, Bruce Eckel’s Thinking in Java, Venkat Subramaniam and Andy Hunt’s Practices of an Agile Developer, Bertrand Meyer’s Object-Oriented Software Construction, or any of Edward Tufte’s amazing books. And there may be books in these lists that you wouldn’t wish on a dog. My selection of lists was arbitrary, and a different selection would have yielded different results. But those top five are likely to appear in most lists.

I Couldn’t Put It Down

To try to get a handle on what makes a book a must-read, I examined the phrases people used repeatedly in recommending their must-read books for programmers. I’ve tried to group them conceptually.

Some of the terms referred to the stature of the book: terms like “classic,” “widely quoted,” “highly regarded,” “popular,” “standard,” “influential.”

Another category of terms emphasized conciseness or clarity: “to the point,” “tells you exactly what you need and no more,” “clear,” “concise,” “practical,” “simple and useful ideas,” “direct,” “straightforward advice,” “well organized,” “logical,” “does a great job of explaining,” “clear examples.”

Another theme was comprehensiveness: “covers everything you’d expect,” “wide range,” “covers just about every aspect,” “depth,” “generally applicable,” “definitive,” “covers a lot of ground,” “chock full,” “encyclopedia.”

Another theme that emerged was practicality: “save you time,” “learn good practices,” “refresher,” “general how to solve problems,” “down and dirty,” “useful for beginners and experts alike,” “handy,” “relevant,” “useful,” “reality check,” “nuts and bolts,” “cross-developer,” “cross-language impact,” “found a lot of ways of improving my code.”

Another reason for recommending a book was that it was engaging or a fun read: “entertaining,” “really draws you in,” “fun,” “readable.”

Yet another theme was inspiration: “mind-expanding,” “thoughtful,” “changed the way I thought about software development,” “influenced me,” “thought-provoking,” “ah-ha moments.”

Then there was breadth of applicability: “suitable for any audience,” “cross-developer,” “cross-language impact.”

Clear. Concise. Comprehensive. Pragmatic. Engaging. Inspiring. Broadly applicable. Based on the evidence of these lists, those are the attributes that people look for in books they consider must-reads. That first attribute, stature, I suppose is a consequence of the others, not really a primary virtue.

This little exercise was not a scientific study. If you tried to replicate it, you’d probably come up with different results. But not too different, I hope.

I also hope that my sharing of this exercise was of some use or interest to you. By the way, there was one other attribute that I noticed recurring in people’s explanations for why a book was a classic: “excellent reference.”

A classic book is one you go back to again and again.

While working as one of the founding editors of InfoWorld, Michael Swaine wrote Fire in the Valley: The Making of the Personal Computer with Paul Freiberger; the movie Pirates of Silicon Valley was based on it. He was editor-in-chief and editor-at-large for Dr. Dobb’s, for whom he still writes his “Swaine’s Flames” column. Michael is the editor of PragPub.

JavaScript: It’s Not Just for Browsers Any More

Three Significant Events in 2009 Changed the JavaScript Landscape
by Jason Huggins
Node.js is a toolkit for writing high-performance network servers in JavaScript. And it’s events all the way down.

In case you haven’t heard, JavaScript is now an excellent language for writing extremely fast production-ready web servers. I know, I didn’t believe it at first, either. But two important projects were started in 2009 to make that possible: CommonJS and Node.

Even though JavaScript has been around for what feels like centuries and is widely used (arguably the most used programming language on the planet), it has been mostly relegated to the safe confines of running inside web browsers. Meanwhile, a few frameworks have attempted to bring JavaScript to the server side, such as Aptana Jaxer (powered by the SpiderMonkey JavaScript interpreter) and Helma (powered by Rhino). But several deficiencies have been holding these platforms back from wider adoption among developers.

The Ecosystem

When we choose a technology to write an application, we don’t just choose the language, we also choose the list of available libraries. If a language has many useful libraries with a vibrant community around them, it’s going to be easier to write your application in less time.

All modern languages have a standard library and a healthy ecosystem of third-party libraries. Python is well-known as a “batteries included” language. And there’s a healthy ecosystem of packages contributed to the Python Package Index (“PyPI”). The same holds true for Ruby and Perl. Not so with JavaScript.

Until recently, you could take JavaScript interpreters like SpiderMonkey, V8, or JavaScriptCore off the shelf and run server-side JavaScript code with them right away. But without libraries, you couldn’t do much of anything real with them without lots of work and time.

In 2009, however, the JavaScript community realized things needed to change. On his blog, Kevin Dangoor explained that JavaScript had a social problem, not a technical one. While JavaScript is a great language, there has been a general lack of agreement on a standard library API and no common way of packaging and using external libraries between frameworks. With no common APIs, each new server-side JavaScript project had to do things in its own way, to the detriment of creating a larger JavaScript ecosystem of cross-project libraries and tools.

So Dangoor started the the “ServerJS” project. The goal was to specify the APIs needed for creating a large and compatible JavaScript library ecosystem. Within a week of its launch, the ServerJS group had 224 members and 653 posted messages to its mailing list. Clearly, Dangoor had struck a nerve with developers. The project was later renamed CommonJS, to better reflect its goal of uniting all JavaScript communities, browser-side and server-side, with common APIs.

Meanwhile, also in 2009, Ryan Dahl was working on a new JavaScript framework called Node. Node is also known by the far more searchable terms Node.js and Nodejs. Node takes Google’s V8 JavaScript interpreter engine, combines it with the CommonJS library APIs, and rolls it up into a complete environment for using JavaScript outside the browser.

A third noteworthy JavaScript event happened in 2009. JavaScript-focused conferences started to appear. Chris Williams and Iterative Designs created JSConf, the first professional conference for JavaScript developers. I had the honor of presenting on Selenium, the web testing tool, at the first JSConf in April 2009, in Washington, D.C.

The Breakthrough Presentation

Though Dahl started the Node project in early 2009, Node’s big day came when he gave a presentation on Node at JSConf Berlin in November. Significant attention from web developers for Node started after that conference, and has been growing since. Between the two JSConf conferences, Dahl was the only one to receive a standing ovation at the end of his talk. In a room of peers on the bleeding edge of their craft, that’s exciting.

(Slides and video of Dahl’s JSConf talk are available online.)

Since JavaScript on the server has been around for years, you may be wondering what the big deal is about Node. What makes it so special? The big idea about programming with Node is that it focuses on evented I/O all the way down.

There are arguably three main programming styles for implementing high-performance servers:

1. Using multiple processes,

2. multiple threads, or

3. single-threaded asynchronous events.

Node is an event-based framework and enforces a “no blocking APIs” policy throughout.

The multi-process or multi-threaded procedural style is the more common, conventional way to program in most other languages, like Java, C#, Perl, Python, Ruby, or PHP. Although event-based programming in those languages is possible, it is not the cultural norm. (Event-based frameworks in Python are available in Twisted or Tornado, and EventMachine in Ruby.)

Doing It with Events

Although event-based programming is an uncommonly used style in other languages, it is the preferred common style for writing browser-based JavaScript code, and Node is inheriting that cultural norm. In the browser and now on the server with Node, event-based programming is the JavaScript Way to code.

For example, here’s how the jQuery documentation explains how to make an asynchronous (aka “Ajax”) request for data.

$.get(’ajax/test.html’, function(data) {

$(’.result’).html(data);

alert(’Load was performed.’);

});

What does an event-based program in Node look like? Here’s a snippet of code from Dahl’s JSConf presentation:

db.query("select..", function (result) {

// use result

});

In this example, a database query is made, but a callback function is attached. When the database returns results, the callback will be executed. Blocks of code are linked by events. When no database events have been triggered, the program is free to process other code and respond to other events.

Compare this to the more common procedural way this would be coded:

var result = db.query("select * from T");

// use result

The problem with the the traditional example is that the program is blocked from doing anything else while waiting for results from the database. The traditional fix for that problem is to wrap the database call in a separate thread or process. At JSConf, Dahl explained that the event-based model is far more efficient with CPU and memory, while also scaling better. Compared to multi-process or multi-threaded programs, event-based frameworks can do more with less.

Getting Started with Node

Here’s the minimal path to start playing with the latest version of Node:

$ git clone git://github.com/ry/node.git

$ cd node

$ ./configure

$ make

$ sudo make install

$ node-repl

Out of the box, Node.js assumes it’s running in a POSIX environment—Linux or Mac OS X. If you’re on Windows, you’ll have to install MinGW to get a POSIX-like environment.

In Node, Http is a first-class citizen. Node is optimized for creating http servers, so most of the examples and libraries you’ll see on the internet will most likely focus on web topics (http frameworks, templating libraries, etc.)

Here’s a simple “hello world” web server:

var sys = require(’sys’),

http = require(’http’);

server = http.createServer(function (req, res) {

res.writeHeader(200, {’Content-Type’: ’text/plain’});

res.write(’Hello World’);

res.close();

})

server.listen(8000);

sys.puts(’Server running at <a href="http://127.0.0.1:8000/’);

Let’s examine the parts separately:

var sys = require(’sys’),

http = require(’http’);

This is where the CommonJS APIs come in. The require function is the standard way to import modules. Before CommonJS, JavaScript programmers had to roll their own way of importing packages of code similar to the import statement in Python or require in Ruby.

server = http.createServer(function (req, res) {

res.writeHeader(200, {’Content-Type’: ’text/plain’});

res.write(’Hello World’);

res.close();

})

The createServer function expects to be given a callback to run every time a new request comes in.

Here’s how to run the example web server:

$ node hello-world.js

Server running at <a href="http://127.0.0.1:8000/

Even with this small amount of code, Node is fast enough to deploy as a real server. To measure server performance, Apache Bench is a great little utility for quick ad-hoc load testing. On my MacBook Pro (3.0 GHz Intel Core 2 Duo with 4GB 1067 MHz Ram), here’s how the “hello world” server performs with 10,000 requests, 4 multiple requests at a time.

$ ab -c 4 -n 10000 <a href="http://127.0.0.1:8000/

...

Requests per second:    6560.50 [#/sec] (mean)

...

Granted, most benchmarks are done wrong. This one is especially perilous since it was run on a laptop, and not via a real network. However, 6560 requests per second is nothing to laugh at. V8 is a mighty fast javascript interpreter and Node takes it even further, to make this a compelling platform for building servers.

Okay, So What’s the Catch?

Since Node is so new, there are many little features missing that that Rails and Django developers take for granted. During development, one small, yet important, feature that Node lacks is the ability to auto-restart when a change is made to the server’s source code. Other features like a step-debugger and REPL interactive prompt are available and useful, but still have some rough edges compared to equivalent tooling in Python and Ruby.

There’s a lot of churn going on in the Node codebase, with core APIs being modified between each release. Of course, these changes are making the APIs more consistent, so I’m not complaining. The pace of development is reminiscent of the early days of Ruby on Rails—there is a ton of innovation going on, but if you don’t pay attention for a week, many things are different. It’s the best and worst thing about the project. It’s great because more eyeballs means more bugs get fixed and new features get implemented faster. But it’s bad because you have to work hard to keep up with all the changes.

Until now, writing server software meant not coding in JavaScript. Before Node, there were many better and faster alternatives. Now the game has been changed. Node levels the playing field and is a serious contender for your next web server project.

Jason Huggins co-founded Sauce Labs and currently leads product direction. Prior to Sauce Labs, Jason was a Test Engineer at Google where he supported the grid-scale “Selenium Farm” for testing Google applications such as Gmail and Google Docs. Jason’s experience also includes time at ThoughtWorks in Chicago as a software developer. While at ThoughtWorks, Jason created the Selenium testing framework out of the need to cross-browser test a new in-house time and expense system. When not programming in Python or JavaScript, Jason enjoys hacking on Arduino-based electronics projects. Jason has spent time in New York City, LA, and the Bay Area, but Chicago is his kind of town.

JSON—The Last 10 Feet

What’s All That XML Doing in IBM’s Jazz?
by Craig Riecke
We like our tools to be lightweight. So what’s with all the bloated XML in IBM’s Jazz?

In other industries, being “heavyweight” is a good thing. Heavyweight means stable, tested, grounded, and reliable. But in software, “lightweight” is the new goal—svelte, fast, efficient, easy-to-learn, and elegant. Products like Spring, GlassFish, and Adobe Air pride themselves on being lightweight. They offer just what you need and no more. Who wouldn’t want that?

One lightweight technology gaining converts is JavaScript Object Notation or JSON. It’s a data language similar to XML—both are self-describing, human-readable, hierarchical formats. So an XML packet like this:

<customer>

<name>Grover Nixon</name>

<address>

<line1>512 Elm</line>

<line2>Apt. 3B</line2>

<city>Kennebec</city>

<state>SD</state>

</address>

</customer>

Is equivalent to the JSON:

"customer": {

"name": "Grover Nixon",

"address": {

"line1": "512 Elm",

"line2": "Apt. 3B",

"city": "Kennebec",

"state": "SD"

}

}

The JSON has less structural markup. And though modern web browsers understand both XML and JSON, it processes JSON much faster because it uses the already-optimized JavaScript engine. Passing JSON is like passing partially-parsed data. Once I started using it in the browser and saw how fast it was, I dropped XML like a hot potato.

So I wasn’t surprised to see JSON used in IBM’s Jazz architecture. Jazz is an open source server-based platform providing integration between source control, task management, bug reporting, and communication. Think of it as Eclipse for the server. By building a solid base product, making it infinitely extensible, and open sourcing all the code, IBM creates an environment that users flock to, write extensions for, and embrace with gusto.

I’m pretty persnickety about software. I’m not content to kick the tires—I need to dig in and read code and look at the protocols that flow over the wire. If you find elegance there, you find it everywhere in a product. So that’s how I approached Jazz. I fired up the server, opened the admin page in my Firefox browser, opened Firebug, and watched the net conversation:

{

"soapenv:Body": {

"response": {

...

"method":"getQuery",

"interface":

"com.ibm.team.workitem.common.internal.rest.IQueryRestService",

"_eQualifiedClassName":

"http://com/ibm/team/core/services.ecore:Response"

},

"_eQualifiedClassName":

"http://schemas.xmlsoap.org/soap/envelope/:Body"

},

"_eQualifiedClassName":

"http://schemas.xmlsoap.org/soap/envelope/:Envelope"

}

If you’ve seen enough SOA stuff in your life, this should look somewhat familiar. It’s JSON all right, but it looks like a SOAP packet. And don’t these _equalifiedClassNames look a lot like XML namespaces? Here was evidence that there’s some heavyweight XML processing going on in the Jazz server.

“Whoa!” I thought. Combining the heavyweight with the lightweight—isn’t that like sucking a Nerf ball through a straw? Rather than defining some svelte new JSON-based protocol, they simply borrowed web service protocols and converted them to JSON for the last 10 feet—that is, from the web server to the browser. The idea seemed crazy at first. We all know SOAP and XML are bloated, slow, and committee-driven, right? Wouldn’t it be faster, easier, better to use JSON across the entire data transfer spectrum? Since IBM built Jazz from the ground up, they could’ve easily done that, right?

Data Integration Is Hard

But here’s the thing. You might have a better architecture in the end, but not a lot better. It might be faster, but not a lot faster. When you go down the JSON route, you run into the same issues that XML faced 10 years ago:

- Mixing data from two different sources into one JSON packet can cause element labels to bump into each other. Mix up a packing slip and an invoice, and suddenly the From address may mean something quite different. That’s why XML has namespaces.

- Converting between different JSON structures would require writing mundane code. A more declarative way to map data would make the job easier. That’s why XML has XSLT.

- Describing a JSON packet’s structure—its fields, data types, etc.—is necessary in order for people to hook into your services. It’s essential to have a metadata language for this. That’s why XML has Schemas.

- Carrying on two simultaneous client-server conversations takes care. If you ask the server two questions and get one answer back, how do you know what question it answers? That’s why XML has WS-Correlation.

...and so on. The bottom line is this: data integration is difficult. XML is a rich and complex format because it has to be. You can think of it as Robert’s Rules of Order for computer data. Because you can’t govern people’s values and upbringing, the rules must take into account different cultures, sources, and styles of communication that are all valid. So it is with XML.

Mixing data integration into your browser-based app makes it unwieldy. Slicing, dicing, combining, transforming and aggregating data... that’s just not something JavaScript does well. Plus it detracts from the real purpose of your browser app—display and input. So by delegating this job to an XML and SOA infrastructure, you can express your own apps more succinctly.

Take a concrete example: the Google Map API. To use it, you must obtain an application key from Google and use it in each of your requests. You can do this directly in JavaScript, but then you end up coding this key into your application where people can see it. Furthermore, now you have the same key hardcoded in many different application scripts. This is a clear violation of the DRY rule—Don’t Repeat Yourself.

But an SOA server is good at that stuff. You write a proxy there for Google Maps, so your app can send JSON Google Maps-bound data to this proxy, which converts it from JSON to XML, adds the key to each request, and sends it off. In most SOA servers, you can do this with zero code. The magic is performed in XML and XSLT. Why write a JSON mechanism for the same thing?

Discovered Elegance

XML universality adds other benefits. In Jazz, for example, I can examine packets across the wire as I’m doing GUI-based tasks, then replay those web service calls from any web service language. Instant macros! And not just macros but macros that can be called from any language that speaks Web Services... which is to say, any language. If you need an extremely high-performance macro, you can just write it in C++.

“That’s nice,” you might counter, “but it’s still heavyweight.”  But even that’s less true nowadays. XML processing is sped up with products like Intel’s SOA Expressway, which does parsing way down in machine language. On top of that, you can build a good SOA infrastructure, which doesn’t necessarily mean a large one. Of course there are huge SOA suites with ga-gillions of features and other-worldly price tags. But there are solid smaller suites too, and many open source options: WSO2, Mule, and GlassFish, to name a few. These products take away a lot of the mundane XML tasks you’d do in code.

So in the final analysis, I think Jazz has the right idea. Use the right tool for the right job. Mold all your data with XML, and give it to the browser in easy-to-digest JSON. A well-balanced, harmonious assembly line... that’s a very elegant approach.

Craig Riecke is a Dojo committer and a writer and editor for the Book of Dojo, Dojo’s online documentation. Holding a BA in English and an MS in Computer Science from the University of Nebraska, he is currently Chief Software Architect for CXtec in Syracuse, NY. While programming he listens to old, scratchy blues music on his iPod. His motto is “I’d rather drink muddy water and sleep in a hollow log than write a redundant line of code.”

Nice Apps, If You Can Afford To Write Them

What the iPad Really Means to Developers
by Chris Adamson
The App Store and iPhone opened a market, but will iPad limit it to large apps?

In its event introducing the iPad, Apple showed off elegant tablet versions of its iWork applications, which will presumably serve to set the bar for applications on the much-anticipated device. The demonstration of Keynote, with a slick interface and deep functionality, portends great things for users of this platform... provided third-party iPad apps are anywhere near as good.

But that might turn out to be a taller order than is initially apparent.

Return of the Thick Client

Five years ago, desktop apps were dead. Everything, we were told, was going to be a webapp, as epitomized by Google’s efforts to put together an Office rival that ran entirely within the context of a web page.

And then a funny happened on the way to the cloud: people discovered that native, local applications offer a better user experience than webapps.

It wasn’t a necessary development: at first, Apple was determined to tell developers that writing iPhone-specific HTML and CSS was the One True Path to delivering a nice iPhone experience. But the huge interest in the “jailbreak” community, at least some of which was motivated by an honest desire to understand and employ the native APIs, proved that there was tremendous interest in delivering native applications on par with those that Apple shipped with the device. Maybe this forced Apple’s hand, maybe it was their plan all along, but at any rate, Apple eventually offered a native SDK, and everyone knows how that’s turned out.

But how is it that the same users who were perfectly happy to use webapps a few years ago are now insisting on custom mobile client apps for Facebook and Twitter, even when each has a perfectly good mobile website?

I think the answer is one of distribution. The win of webapps was always that they didn’t require any client-side installation process: no installer to run, no arguments with sysadmins about “approved” software, and no hassles for developers trying to update thousands or millions of client installations. To cite my own experience, I wrote a Java Swing client application in 1999, and in 2003 I found myself assigned to rewrite it as an IE-only webapp, a huge step backwards in usability and compatibility, but so much easier for customers to maintain that it was a no-brainer. Not having to drive out to client sites to debug botched installs or unanticipated network hassles got me over my aesthetic qualms pretty quickly.

With the iPhone and the App Store, many of these problems go away.  With the filesystem abstracted away, many of the installation hassles disappear: click “buy” or “download” and the app is on your device, ready to run, and impossible for the user to mess up by moving or deleting needed files. Updates are trivial to perform, and a red badge on the App Store makes sure the user always knows that he or she has new features or fixes available.

iPhone OS makes distribution and maintenance of native applications nearly as easy as webapps, and this has led to a renaissance of thick-client programming. (Between the iPhone and iPad, we need a new term for this style of programming. These devices aren’t “desktops,” and when the user is working in a local productivity app, they’re not really a “client” to anything either.) Developers who’d been forced to adapt to JavaScript and the fractured world of browser semi-standards are delighted to return to a proper user-facing API, particularly one as thoughtful and elegant as Cocoa Touch.

The App Store has its downsides, to be sure. Apple’s review process is often derided as unfair, imposing inconsistent, unclear, and self-serving rules on developers that are sometimes only discovered after an app is developed, submitted, and rejected. And some developers, accustomed to the freedoms of traditional web and desktop programming, will never accept the premise of Apple acting as a gatekeeper between them and their would-be users.

But the fact that more than 140,000  apps have been written for the platform in 18 months is more than just a story about the iPhone OS. It heralds the resuscitation of the user-facing native application itself. Tim O’Reilly might have been right that every app in the “Web 2.0” era needs to be network-enabled, but that doesn’t mean it needs to run in the context of a browser. Perhaps, the read-write web needs more than <textarea> for participation to be truly practical.

Now, with the iPad, we have an opportunity for a radical new start. Its interface metaphors are neither those of the iPhone nor of Mac OS X. Seeing iWork rethought for the iPad interface brings to mind a host of questions. Like the desktop, there’s much to manage on one screen, but like the iPhone and iPod touch, there’s no concept of window management. The OS X developer will need to start thinking in terms of views dominated by one or two significant tasks, like the editing of a document, without a collection of palettes and inspectors to assist. The iPhone developer will need to think in terms of staying on one view and handling many events and activities within that view, rather than navigating to a new narrowly-scoped view controller every time something is tapped. Using iPad may turn out to be a fundamentally new form of user interaction with applications.

A Rock and a Hard Place

Yet as the iPad giveth, the iPad may also taketh away. We might see a real renaissance in big user-facing apps, but I wouldn’t be surprised to see an end to the short-lived revival of the “one-person shop.” There have been a lot of stories about individual developers striking it rich—or at least paying the mortgage—entirely with iPhone apps they’ve written themselves. This phenomenon may be very difficult to recreate on the iPad, Apple’s promises of a “new gold rush” notwithstanding.

The difference is one of scope and shape. The iPad’s larger screen calls for more substantial applications, as does the imagined use scenarios of sitting on the couch for a long stretch with your iPad, as opposed to whipping out your iPhone for short sessions, like checking Twitter while in line at the store. Apple’s guidance to developers is noteworthy here. The message to iPhone developers thus far has been one of minimalism: only include the essential feature set your app needs, plan for short periods of use, keep it simple and responsive. With the iPad, the early message to developers stresses appearance: lavish graphics, on-screen objects that closely resemble their real-world counterparts, and a deeply immersive experience. What we’ve seen of Apple’s initial iPad apps, like the book reader with the photo-realistic bookshelf and e-books, exceptional layout and typography, and beautifully animated page flips, typifies this philosophy.

Apple has a world-class art department to produce this stuff. The indie developer in the garage does not.

Already, the App Store suffers from a Bling Arms Race.  Some categories of apps—unit converters and Twitter clients come to mind—are primarily differentiated by their appearance, with developers one-upping each other in the presentation department.  It’s not vanity that drives them, it’s sales: with app review sites overwhelmed and no “try before you buy” option (the usefulness of which is debatable anyways), the most obvious clue to the quality of an application is the screenshots that are so prominently featured in the App Store’s desktop and mobile GUIs. If developers care enough to make an app look good, shoppers sensibly conclude that the rest of the app is a quality production, and therefore a good purchase.

Thing is, bling costs money. There are Renaissance Men and Women among us who understand Photoshop’s blooms, diffuses, and glows as well as they understand Objective-C’s delegates and retains. For the rest of us, the choice is to either look “average” (which is the fast track to one-star reviews) or to hire on graphics professionals who can get our visuals up to snuff. And an app that has to pay two people’s bills, the developer’s and the artist’s, needs to make twice as much money to justify their investment.

Unfortunately, but probably not surprisingly, the App Store has proven to be highly hit-driven, with a small percentage of apps garnering an overwhelming share of the downloads. A Pinch Media analysis shows the top 10% of paid apps outselling the 10-20% decile by a factor of 8, with subsequent deciles quickly becoming even more irrelevant. Pinch’s analysis showed the average net proceeds of a given app to be about $8,500 as of October, 2009, but that’s a misleading figure: the distribution of sales suggests that the median revenue is much lower.

In an earlier analysis of the App Store economy, Twitterific developer Craig Hockenberry wrote about the lamentable rise of the “ringtone app", saying that his company was focusing on inconsequential 99-cent novelties rather than more substantial applications, because market conditions made it too risky to spend the developer months required to create more sophisticated apps. True to his word, his latest work is a premium flashlight application.

Maybe we can keep a developer and an artist housed, clothed, and fed on 99-cent ringtone apps, but only if they’re cranking out low-risk, low-investment apps by the bushel, and occasionally getting lucky.

And there’s the problem: little apps are what the iPhone and iPod touch excel at, so there’s some hope for the indies to produce a few hit apps that pay the bills. Scale up to the iPad, and the numbers aren’t as encouraging. The device demands more functionality, more art, more immersion... all of which means that iPad apps are going to cost more to produce.  Yet the device will start from an install base of zero, and iPad apps will still have to compete with tens of thousands of existing iPhone apps, which will happily up-scale to the device.

Put another way, the whole point of the iPad is to run the kind of apps that Hockenberry has already concluded that companies like his cannot afford to develop.

Outside of the opportunities for early-adopting developers to get some sales from early-adopting users eager for any iPad-optimized apps, the best hope for iPad developer might be higher prices. If users will pay $20 or more for iPad apps, they might justify developers and artists putting in months of work on them. But Apple has priced its iWork apps at $9.99 each, setting a price standard much lower than comparable desktop titles command (the three iWork apps cost $80 in a bundle for Mac).  If the iPad economy then experiences the same kind of “race to the bottom” that occurred on the iPhone, it’s hard to see how the romanticized “developer in the garage” has any chance of paying his or her bills with iPad development.

Oh, there will be plenty of opportunities for iPad developers, in contracting, vertical markets, and corporate development. There are a lot of businesses for which the combination of custom software and the iPad form-factor and feature set will be a compelling solution, and they’ll surely be hiring. But in a way, this gets us right back to where the desktop was before the web, with most developers doing corporate or contract work, with code more likely to support a business use than to be something sold directly to the end user.

The idealized “indie developer hero” concept had a nice revival, and it was fun while it lasted. But the dream is already dying on the iPhone, and the iPad won’t revive it.

Chris Adamson is a writer, editor, developer and consultant specializing in media software development. He is the co-author, with Bill Dudney, of the recently released Pragmatic Bookshelf book iPhone SDK Development. He has served as Editor for the developer websites ONJava and java.net. He maintains a corporate identity as Subsequently & Furthermore, Inc. and writes the [Time code]; blog. He wrote about writing apps for the iPhone in the second issue of this magazine.

Testing as Contract

A Modest Proposal
by Brian Tarbox
Are software tests too important to be left to just any programmer?

One of the realities of development these days is that our software teams have heterogeneous skill levels. Most teams contain a mix of veterans and rookies. There can be large differences in how seriously people take continuing education, too. My team, for example, has a member who just announced that he never learned any of the Java 5 features and so couldn’t work on areas that used generics. Considering that we’re now migrating from Java 6 toward Groovy, this team member is pretty far behind the curve.

As a field we keep trying to find procedures, methods, or paradigms to deal with the fact that not all developers are equal. It goes against the grain to say that some developers are simply better than others, but the average developer is—well—average!

One of the approaches we’ve used to deal with differing skill levels is Test Driven Development. Most shops now at least pay lip service to the importance of unit testing—although from comparing notes at conferences, I’d say the number of shops that actually require that the tests be written before the “real” code is still pretty small.

I want to argue that TDD focuses on the wrong problem.

The developers who understand the importance of unit tests and who write comprehensive and subtle tests are exactly the group that need them the least. The “average” or inexperienced developer probably doesn’t believe in unit tests and will write bad or pointless tests if forced to do so. I have empirical evidence that they won’t write tests that aggressively try to break their classes. I’m embarrassed to admit that I’ve had to turn on CheckStyle’s “unit test must contain an assert” test so as to force some of my team to write unit tests that actually test something.

Programmers with Class

But differences in skill levels aren’t a new phenomenon. Back in the C/C++ days there was a clear separation of skill levels among developers: some people wrote classes, most people just used classes. Some people wrote libraries, but most people just used those libraries. It was understood that not everyone was capable of designing good classes. Class design was a higher level skill that was left to our top people.

Then along came Java. Since everything was a class, everyone was suddenly a class designer. Except that they weren’t. It was still the case that only a small subset of developers could design good classes, but we weren’t supposed to care anymore.

Today we try to manage this situation with TDD, but the differences in skill and commitment still gum up the works.

Testing as Contract

But consider this: instead of hoping that each developer will write their own (good) test cases and only then write their code, imagine that the best developers in a team write the interfaces and all of the unit tests that exercise the interfaces. We then let everyone else code until the tests pass. It’s very similar to standard TDD except that we have the most skilled people writing the unit tests. They are in fact writing the enforcement of the contract.

I am attracted to this approach because it gives me a way to protect my design. My group is working on so many projects that I tend to write the initial design and perhaps the initial implementation, and then hand it off to a remote team to finish. This approach has had very mixed results. After trying to write exhaustive Functional Specs, or racking up too many Frequent Flier miles, or doing too many late night/early morning video conference calls, the essence of the initial design sometimes gets lost.

The most successful approach for me has been to write an exhaustive set of unit tests that act as a guard against changes to the design: in effect, to the contract. One result is that I get a steady stream of complaints that my unit test suite makes it harder for people to change the code, and I’m glad of that. I want people to have to think before changing the design.

In the past we’ve chastised developers whose code coverage numbers were not high enough. I’ve come to think that was the wrong approach. Perhaps in a perfect world every developer would write their own tests, but in the real world it may make more sense for the senior developers to create the design, write the interfaces, and then write a good suite of unit tests for all of the code. After all, if we believe that the tests are so important, shouldn’t we be the ones to write them?

Brian Tarbox is a Principal Staff Engineer at Motorola where he designs server side solutions in the Video On Demand space. He writes a blog on the intersection of software design, cognition, and Tai Chi at briantarbox.blogspot.com.

When Did That Happen?

The Typewriter and Keyboard
by Dan Wohlbruck
On the birthday of the typewriter, Dan tracks the twists and turns of a concept from the typewriter through keypunch machines to today’s computer keyboards.

On March 1, 1873, E. Remington and Sons, famous for making firearms, began commercial production of the Sholes and Glidden typewriter. The Remington Company had prospered during the Civil War, but with war’s end, they were trying to diversify their product line. In the late 1860s, they had begun to build sewing machines, and when they had the opportunity to purchase the typewriter patent, they saw a surprising synergy between these two technologies: they built their typewriter on a sewing machine chassis.

Remington called the device the Sholes and Glidden typewriter and they sold the first model until 1878. The machine was beset with problems and only 5,000 were ever sold. Although production of the Remington typewriter continued well into the twentieth century, the Remington Company sold the distribution and manufacturing rights—and even the name itself—in 1883.

It was with the renamed and re-engineered Remington Model 2, which could produce both upper case and lower case letters by using a shift key, that the typewriter really became a fixture in homes and offices. Priced at just over $100, the Remington 2 was an unqualified success. Before radio or television brought entertainment into the home, the typewriter could be found in the parlors of many upscale homes, where, believe it or not, the activity of typing was seen as family entertainment. Parents and children created printed documents, made their own copies of plays and novels, and wrote letters to friends. By 1900, you could find more than a quarter of a million typewriters in the nation’s homes and offices.

The Typewriter’s Killer App

At the New York Business Show in 1920, the Remington Typewriter Company unveiled a portable model (although the portable wasn’t actively marketed until the following year). Portability became the typewriter’s killer app. The Remington portable sold for sixty dollars and Remington sold over a half million of them. By the late 1920s, you could buy a portable in one of six different colors and show up at college in style. Everyone who could afford one had a typewriter.

From the time of the Sholes and Glidden model, the typewriter featured the familiar QWERTY keyboard with four rows of letters and numbers. The shift key, other special characters, and number pads were added to the keyboard over time, but the 19th century typewriter looked pretty much like a twentieth century typewriter.

Then, in 1933, IBM announced the type 032 keypunch machine. It was the first keypunch that could place alphabetic data on cards. It was also the first keypunch to print the punched data across the top of the card. If you ever have the chance to see a type 032 keypunch, you’ll see that it looks like an old typewriter placed on top of a sewing machine. The 032 adopted the QWERTY keyboard, but instead of typing letters onto paper rolling over a platen, it punched letters into a card.

IBM used the widespread familiarity with the typewriter to sell the keypunch. Its promotional literature advised that the 032 “operated in an entirely automatic mode in which the user merely depressed the keys as though typewriting and with the same speed.”

But unlike the typewriter, the type 032 keypunch was all business: all business data processing, to be exact. The marriage of typewriting and data processing had occurred.

Typing Refactored

On both the typewriter and the early keypunch, the keyboard was an integral part of the machinery. When the operator depressed a key, something physical happened. On the typewriter, depressing a key moved an arm with a letter on the end to strike and make an impression on a piece of paper. On the keypunch, depressing a key struck a metal surface which closed an electrical circuit to punch a hole in a column. It was with the use of abstraction, namely codes that could be sent, received, and interpreted electrically, that keyboards became independent mechanisms.

Another step in the keyboard’s independence came in 1874, when J. Baudot secured a patent on a code to replace Morse code. Instead of Morse’s dots and dashes, used in the telegraph, Baudot code used 5 bits to represent 32 different characters. Although it didn’t see much use in telegraphy, a variation of Baudot’s code was used in the teletype.

Then in the early 1960s, the ASCII standard for representing numbers and alphabetic characters was released. With the adoption of a standard for encoding characters, keyboards became fully separate components that produced a certain binary coded electric signal each time a specific key was depressed—and a keyboard could be attached to any device that could interpret the standard signal. It was just in time to join a revolution.

Sholes’ original four rows of keys that were used in 1873 with the manufacture of the first commercial typewriter could be found on a keyboard in 1975 on the world’s first personal computer.

In took just over 100 years, and it all started in March 1873—and that’s when it happened.

Dan Wohlbruck has over 30 years of experience with computers, with over 25 years of business and project management experience in the life and health insurance industry. He has written articles for a variety of trade magazines and websites.

Our Daily Beer
by Steve Peter
If you can cook, you can make your own beer at home.

The last time we met, I walked you through adding yeast and water to some grains to produce something delicious. We’re going to do the same thing this month, but this time, we’ll change the grains, add a new ingredient, and produce liquid bread. That’s right, this month, we’re going to brew some beer.

Four Ingredients

The basics of beer are simple: take malted grain (typically barley and/or wheat), add water and heat to convert various enzymes to sugars, drain out the sugary water (which is called ‘sweet wort’), add hops and boil, then cool the resulting soup (now called ‘bitter wort’), add yeast and set it aside for a while, and you’ve got beer. For beginners, or for those with small apartments, producing the sweet wort can be difficult, as it involves special equipment and space. Fortunately, there’s a way to skip the first step by using malt extract, which we will use here. (For the purpose of pedagogy, we’ll oversimplify at times in this introduction. Future articles can fill in details and deal with brewing in more depth, such as starting with grains.) You can purchase beginner’s ingredient kits that contain all the items we will use today, and in fact, that’s exactly what I’m using here. Let’s make some Weizenbier!

Weizenwhat? Today, I’m going to brew a German-style wheat beer, which has about 65% malted wheat and 35% malted barley, along with a particular type of yeast. The resulting beer will be refreshing and effervescent, and have hints of cloves and banana in the taste (due to the yeast—we won’t be adding any fruit into the beer).

The equipment you’ll need for this is pretty basic: a large pot (the bigger, the better), malt extract (dry or liquid), yeast (dry or liquid), water, a large spoon, and perhaps some tubing, depending on other details of your setup. There is additional equipment that will make your life immensely easier, although it strictly speaking is not required: a wort chiller, hydrometer, and a floating thermometer.

If your brewpot isn’t big enough to fit 5 gallons, which is the amount we homebrewers typically make, it is possible to boil a smaller amount (say, 2 or 3 gallons) and add it to cold water in the fermenter. If you do go this route, remember to boil and chill the water you are putting in the fermenter. Why? Sanitation is one of the most important habits to get into when homebrewing.

A Note on Sanitation

The magic that transforms your wort into beer is fermentation by a microorganism called yeast (technically, a fungus called Saccharomyces cerevisiae/uvarum). The conditions under which yeast thrive are also the conditions under which other microorganisms thrive, and they can make your beer taste nasty. So, we want to give our yeast a head-start by reducing the other critters to as minimal a level as possible.

To do this, you can use either a very dilute bleach solution (plain bleach, unless you really want your beer to taste like lemons or a Carolina pine forest) or a commercial sanitizer. If you use bleach, make sure you thoroughly rinse all your equipment. If you use a commercial product, follow the label directions. For this batch of beer, I’ve used a commercial no-rinse sanitizer, together with a foaming cleaner.

Tea, Anyone?

I said we’d keep things simple for this first batch of beer, and we will, but there’s a simple thing we can do to make our first extract beer a little bit better. Specifically, we’re going to add some grains and allow them to steep (not unlike making some barley tea!). Many beginner’s kits nowadays come with these specialty grains. To use these, we gently crush the grains in a ziplock bag using a rolling pin. The idea is to expose the sugary inside of the kernel to the water, not to pulverize the grains into flour. Once the grains are crushed, put them in a muslin sack and tie off the top.

Add 5 and a bit gallons of water to your brewpot. (We put in some extra to allow for boil-off.) We’ll dunk the grains in the water as it reaches 155 °F (68 °C). Turn off the heat and allow the grains to steep for half an hour. Remove the grain sack (without squeezing it) and turn the heat back on to bring us up to a boil.

When the water comes to a boil, we will add the malt extract and some of the hops. The kit I’m using here has the dry malt extract and the hops mixed together. You might have them separate, or you might have liquid malt extract. (If you do have liquid extract, I recommend putting it into a pan of warm water to allow it to flow better when you need to add it to your brewpot.) In any case, the hops you add now will contribute to the bitterness of the beer, but most of their aroma will boil off. We’ll take care of that by adding more hops later in the boil.

Add the extract and stir it around, taking care to avoid the wort boiling over. (It can be particularly difficult to clean off stove tops.) The hop pellets will disolve, and you will have a wonderful smelling—but ugly—green soup.

Now, we allow the wort to boil for at least an hour. We’ll be adding some more hops along the way, but since we have some time on our hands, let’s rehydrate the dry yeast. Boil some water and allow it to cool to below 98 °F (37 °C). Put it in a pyrex cup or a bowl and add the dry yeast. Cover it with some plastic wrap until you are ready.

Do you have to rehydrate the yeast? If you ask 10 homebrewers, you will get a dozen different opinions. I tend to, but many people don’t. You can also use yeast that already is in liquid form. (And yeast is at least a whole separate article, so we’ll leave it at that.)

At roughly 30 minutes into the boil, you can add more hop pellets. If you are brewing an India Pale Ale, you will add another 1 oz. or so, but for our Weizenbier, we don’t need so much. Also, for some styles, you will want to add even more hops when you turn off the flame, and possibly even into the fermenter!

Chill Out, Man!

So, an hour has gone by, you now have a house that smells wonderful, and you have 5 gallons of boiling-hot wort. If you add the yeast now, you will kill it, so let’s cool down the wort. I use a handy piece of equipment called an immersion chiller, seen below. It’s simply a copper coil with inflow and outflow tubes. Cold water goes in one side, travels down through the wort, taking away heat, and heated water flows out the other side. If you don’t have a chiller, and especially if you are boiling in a smaller pot, you can simply put the pot into a sink filled with icy water. (Don’t put ice into the wort. Ice tends to be not very sanitary, to put it mildly.)

Now we’ve got the wort down to around 80 °F (27 °C). We need to transfer it to our fermenter. There are a couple of ways to do this. My brewpot has a nice ball valve, so I just open it up and let the wort flow out into the fermenter. This also serves to aerate the wort, which is important at this stage (and only at this stage), because the yeast need to have oxygen to reproduce to healthy numbers to ferment the beer. If you don’t have a fancy brewpot, you can use a piece of plastic tubing to rack the wort into the fermenter. (Brewers always call syphoning from one vessel to another ‘racking’.)

While you are transfering into your fermenter, draw some of the wort off and use a hydrometer to measure the original gravity of the wort. The original gravity is a measurement of the dissolved sugars in the liquid relative to plain water, and we will use this measurement later to calculate the alcohol by volume of the beer. If you do take a hydrometer reading, don’t pour that wort back into the fermenter. Put it in a glass and sample it. Yes, it’s flat and it has no alcohol, but try it. It will make you smile.

The Windup and the Pitch

Once your wort is in the fermenter, it’s time to pitch the yeast. No, not like Nolan Ryan pitches. Pour the yeast into the fermenter. Put the lid on the fermenter, and put a sanitized finger over the hole in the lid. Now shake the living daylights out of the fermenter. The goal right now is to aerate the solution to provide oxygen to the yeast. Good music helps.

Now, put a fermentation lock into the hole at the top of the fermenter and fill it with liquid. Some people use plain water, some people use StarSan solution, and some people use vodka (no kidding). The purpose of the airlock is to allow carbon dioxide created by the fermentation to escape without allowing competing microorganisms, dust, flies or other bad stuff into the beer. Put your fermenter somewhere out of the way that has a fairly steady temperature around 70 °F (21 °C), such as a basement or closet.

How long do you let the beer ferment? It depends on a number of factors, such as the type of beer/yeast, how well-cared-for the yeast was, and the temperature in your basement/closet. In general, I’d recomment letting your first batch go for two weeks. The single biggest mistake beginners make is to rush the beer into the bottles, and the second biggest mistake is then to open those bottles too early.

Bottling

In order to bottle your batch, you will need about 48 12-oz beer bottles. Yes, you’re going to have to go out and drink a bit. (Consider it research.) The best bottles are the brown ones, as they don’t allow light in that can cause skunky flavors. You don’t have to use 12-oz bottles. You can use 22-oz bombers, or 500 ml import bottles, or any combination. Don’t use growlers, though, since the carbonation won’t set up in them.

Make sure you clean your bottles as soon as you pour the beer out. (Trust me.) To remove the labels, I use a scoop of OxyClean Scent-Free in a sink filled with warm water. In about an hour, most of the labels fall right off.

Just like magic, two weeks have passed, and the day has come to bottle. You have clean bottles, but they need to be sanitized before you put your precious beer in them. By far the easiest thing to do (i.e., the thing I do) is to run the bottles through the dishwasher without any detergent, setting the drying cycle to heated dry. If you don’t have a dishwasher, you can rinse them out with diluted bleach or any of the commercial no-rinse sanitizers we mentioned earlier.

In order for the remaining yeast in your beer to be able to generate carbon dioxide in the bottle, we need to provide them with a bit of food in the form of priming sugar. We take two cups or so of the beer (or just some water) and heat it up and add the priming sugar. (You can also take a hydrometer reading now. This will allow you to calculate the alcohol by volume of your beer: (OG-FG)*131.) Pour that into your bottling bucket. (This is a bucket similar to your fermenter, but with a spigot at the bottom.) Then take a piece of tubing and transfer the beer from the fermenter to the bottling bucket, taking care not to splash it around too much, which can cause off-flavors later on.

Also take this opportunity to leave behind the hop residue and the bulk of the yeast which is sitting on the bottom of your fermenter. (When you get more advanced, you can re-use this yeast for a new batch of beer.)

Here is where technology comes in handy. When I first started brewing, I filled the bottles with nothing more than the tubing from the bucket to the bottle, crudely cutting off the flow by crimping the tube or putting my thumb over the end. Now, I have a bottling wand, and what a difference it makes. The wand is a rigid piece of plastic with a spring-loaded switch at the bottom. Put it in the bottle and push down, beer flows in. When the level of the beer comes just up to the top, let up and pull the wand out. The displacement of the wand leaves you exactly the correct amount of headspace at the top of the bottle. (Oh, and if you have a dishwasher, use the door as a place to bottle. If, I mean when, you spill something, you can just close the door, and the problem’s solved!)

Put a crown cap on the bottle, and crimp it down with your capper. There are several variants of cappers, but I’ve had the best luck with the bench capper that has a nice lever to crimp the cap.

Again, you will need some patience. Allow your bottled beer at least 10 days to develop some carbonation. Longer is better. When the time comes and you pop off the top, pour the beer gently into a clean beer glass, leaving behind the last little bit of yeast sediment. Enjoy the fruits of your labor!

Read More

There are several good books and websites out there to help the homebrewer. Two of the books I’d recommend are:

- The Complete Joy of Homebrewing by Charlie Papazian

- How to Brew by John Palmer

A helpful online community I visit frequently is http://www.homebrewtalk.com/, although a simple web search will reveal many more.

Steve is the typesetter for the Pragmatic Bookshelf. When not coaxing kerning pairs or reining in overfull hboxes, he likes to spend time in the kitchen baking and brewing. He also makes his own typefaces, but you can’t eat those.

The Quiz

The Fierce Urgency of Now
by Michael Swaine
Recently, you find yourself obsessing over time. You feel the need to know the time with absurd precision and accuracy.

Who Knows Where the Time Goes?

You take comfort in the fact that your computer checks in regularly with some time server, but you start thinking about the pathway that information has to follow to get to your brain. Your computer is on a LAN, so there’s the local pathway, then there’s the random internet pathway over which the LAN connects with that time server, and does that server really keep the time itself, or is it in turn checking with whatever subatomic device it is at the Greenwich Observatory that keeps track of the official time, if that’s still the case? All those links with all those latencies.

You only stop obsessing over these latencies when you realize that they are completely swamped out by the real bottleneck in the system: the optic nerve, which slows the signal to about 60 meters per second. You’re always going to be something like 1/10th of a second behind the time, because that’s how long your eye takes to tell your brain what it sees.

In any case, when it comes to time, you’re a stickler for precision and accuracy. And they’re not the same thing, of course. Not at all.

The Dead Zone

Your cell phone is capable of keeping track of the time with ridiculous precision. Far more precision than you can possibly use. But because you let the battery die today and are currently in a cellular dead zone, it has zero accuracy. You’ve replaced the battery, but what good does that do you now, with no connection, on the road in a motel in the sticks where the desk clerk answers your request for a wake-up call with a reminder that there’s a digit clock on the nightstand.

The clock on the nightstand may in fact be highly accurate. Anyway you’re going to assume that it is, because you appear to have no alternative. But it lacks precision.

If the clock was set to, say, 8 AM on some past day at the exact second when it turned 8 AM and has been keeping perfect time since then, then when it tells you that it is now 6:43 PM, as it is doing now, all you know is that it is somewhere in the interval between 6:43:00 and 6:44:00 PM. Technically, the interval is closed on the left and open on the right: it’s no earlier than 6:43:00 and not as late as 6:44:00, but it could be arbitrarily close to the latter time. So 6:44 is as good a guess as 6:43 for the real time.

You need to catch a flight in the morning, so you want to know the time as accurately and precisely as possible under the circumstances. Plus, you always want to know the time as accurately and precisely as possible. You fall asleep worrying about the time.

Dreaming of Clocks

Time, as it will, passes.

You sleep. You dream clock puzzles. First, a digital clock puzzle:

How many times per day will a digital clock in 12-hour mode display three identical consecutive digits?

Easy. Then you dream of an analog clock puzzle:

How many times per day do all three hands of an analog clock coincide?

Also easy, even in your sleep.

What Time Is It Really?

You wake up. The first light of dawn is coming in the window. This tells you nothing except that it is morning. You glance at the clock. 5:45. You close your eyes and count off what you think is 15 seconds. You’re pretty good at this; in 15 seconds you’re not going to be off by an appreciable amount. You open your eyes and glance at the clock again. Still 5:45.

What is your best guess for the current time, to a tenth of a second?

That’s even easier than your dream puzzles, right? Or is it?

If all those puzzles failed to challenge you, how about this one:

Why do we remember the past, but not the future?

Sean Carroll takes a crack at that and other deep puzzles of time in From Eternity to Here: The Quest for the Ultimate Theory of Time, just released by Dutton.

Solution to Last Month’s Quiz

Last month we offered up a snippet of public domain source code, part of a translation of a famous program originally written in 1966 into a programming language created in 1993. (Technically, into source code for an editor that has the 1993 programming language embedded in it.)

But to make a puzzle of it, we encrypted the source using a simple letter-substitution code. The challenge was to decrypt the result and identify both the program and the 1993 language. (We didn’t require you to port it back to the 1966 source.)

Here’s the code as we presented it:

qstgq xhmtunsm Vqneg(uvlu)

qstgq wvojsmov = ""

qstgq hovw = ouwnmc.hjjvw(uvlu)

qstgq hovwSwnc = hovw

-- wgmrsfqk ovqvtuvr wvjqnvo nx ms avkiswro

qstgq wgmrWvjqnvo = {

"IZGU RSVO UZGU OHCCVOU US KSH?",

"N OVV...",

"N'F MSU OHWV N HMRVWOUGMR KSH XHQQK.",

"TGM KSH VQGYSWGUV SM UZGU?",

"UZGU NO PHNUV NMUVWVOUNMC!",

"UZGU'O OS... JQVGOV TSMUNMHV...",

"N HMRVWOUGMR...",

"IVQQ, IVQQ... RS CS SM",

"IZK GWV KSH OGKNMC UZGU?",

"JQVGOV VLJQGNM UZV YGTACWSHMR US UZGU WVFGWA...",

"TSHQR KSH OGK UZGU GCGNM, NM G RNXXVWVMU IGK?",

}

...

-- tsmdhcguv

qstgq tsmdhcguv = {

[" N "] = "KSH",

[" GWV "] = "GF",

[" IVWV "] = "IGO",

[" KSH "] = "FV",

[" KSHW "] = "FK",

[" N'BV "] = "KSH'BV",

[" N'F "] = "KSH'WV",

[" FV "] = "KSH",

[" GF N "] = "KSH GWV",

[" GF "] = "GWV",

}

-- wgmrsf wvjqnvo, ms avkiswr

qstgq xhmtunsm wvjqkWgmrsfqk()

wvojsmov = wgmrWvjqnvo[fguz.wgmrsf(ugyqv.cvum(wgmrWvjqnvo))].."\m"

vmr

And here it is decrypted:

local function Eliza(text)

local response = ""

local user = string.upper(text)

local userOrig = user

-- randomly selected replies if no keywords

local randReplies = {

"WHAT DOES THAT SUGGEST TO YOU?",

"I SEE...",

"I'M NOT SURE I UNDERSTAND YOU FULLY.",

"CAN YOU ELABORATE ON THAT?",

"THAT IS QUITE INTERESTING!",

"THAT'S SO... PLEASE CONTINUE...",

"I UNDERSTAND...",

"WELL, WELL... DO GO ON",

"WHY ARE YOU SAYING THAT?",

"PLEASE EXPLAIN THE BACKGROUND TO THAT REMARK...",

"COULD YOU SAY THAT AGAIN, IN A DIFFERENT WAY?",

}

...

-- conjugate

local conjugate = {

[" I "] = "YOU",

[" ARE "] = "AM",

[" WERE "] = "WAS",

[" YOU "] = "ME",

[" YOUR "] = "MY",

[" I'VE "] = "YOU'VE",

[" I'M "] = "YOU'RE",

[" ME "] = "YOU",

[" AM I "] = "YOU ARE",

[" AM "] = "ARE",

}

-- random replies, no keyword

local function replyRandomly()

response = randReplies[math.random(table.getn(randReplies))].."\n"

end

It’s Eliza, Joseph Weizenbaum’s classic imitation of a Rogerian therapist (or a small part of it). Kein-Hong Man ported it rather faithfully to Lua (embedded in the SciTE editor).

Two readers solved the puzzle very quickly on the day it was published, one of them within minutes of its release. That they were able to decode this based on such skimpy information means something. We wish somebody would tell us what.

Calendar

Author sightings, partner events, and other notable happenings.

Featured Event

Dave Thomas of Pragmatic Programmers and Jim Weirich of EdgeCase will deliver the keynotes at Red Dirt Ruby Conference in Oklahoma City in May. The organizers hope to make it a uniquely focused and productive experience, partly by limiting attendance. The conference is organized around four themes:

1. Ruby: The Ruby language still has the power to surprise us. This theme is focused on Ruby syntax, gems, and good development practices.

2. Rails 3: Ruby on Rails is crossing a huge milestone. This theme is centered on topics such as routing, metal, the new response system, and advanced queries.

3. NoSQL: Database choice affects application performance and scalability. This theme will focus on databases such as MongoDB, Riak, Redis, and Tokyo Cabinet.

4. Servers: Ruby is well suited for web based applications. This theme will focus on tools such as Rack, Unicorn, EventMachine, Resque, and AWS.

- May 6-7, Oklahoma City, OK
Red Dirt Ruby Conference

Author Appearances

- Mar 4, Birmingham University, seminar
“Domain Driven Design using Naked Objects”Dan Haywood, the author of Domain-Driven Design Using Naked Objects

- Mar 8-9, Devnexus, Atlanta, GA
Java related topicsVenkat Subramaniam, the author of Practices of an Agile Developer, Programming Groovy, and Programming Scala

- Mar 9-12, Reston, VA
iPhone Studio, Pragmatic StudiosDaniel Steinberg, the author of Cocoa Programming: A Quick-Start Guide for Developers

- Mar 9-12, Reston, VA
Mastering Ruby and Rails Studios (sold out)Dave Thomas and Chad Fowler, the author of The Passionate Programmer: Creating a Remarkable Career in Software Development

- Mar 11, CocoaHeads, Ann Arbor, MI
“In-App Purchase: Why, How, and Why Not”Chris Adamson, the author of iPhone SDK Development

- Mar 11, QCon London, London, UK
“Breaking Your Agile Addiction”Rachel Davies, the author of Agile Coaching

- Mar 11, Boston Chapter, IIBA
“Overcoming Several Pitfalls of Transitioning to Agile”Johanna Rothman, the author of Manage Your Project Portfolio: Increase Your Capacity and Finish More Projects, Manage It!: Your Guide to Modern, Pragmatic Project Management, and Behind Closed Doors: Secrets of Great Management

- Mar 15-17, Reston, VA
Clojure Programming Studio (sold out)Stuart Halloway, the author of Programming Clojure and Rails for Java Developers

- Mar 16-17, Scandinavian Developer Conference
TBDBrian Marick, the author of Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa and Everyday Scripting with Ruby: for Teams, Testers, and You

- Mar 16-17, Scandinavian Developer Conference, Göteborg Sweden
“I Think I Finally Understand Mocks,” “Agile Values,” and “Artisanal Retro-Futurism Crossed With Team-Scale Anarcho-Syndicalism”Brian Marick, the author of Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa and Everyday Scripting with Ruby: for Teams, Testers, and You

- Mar 17, Capital Area Clojure Users Group
Stuart Halloway and Rich Hickey on ClojureStuart Halloway, the author of Programming Clojure and Rails for Java Developers

- Mar 18, Turku Agile Day 2010, Finland
“Timeboxed Thinking”Staffan Nöteberg, the author of Pomodoro Technique Illustrated: The Easy Way to Do More in Less Time, and Portia Tung

- Mar 18-29, SPARK IT, Bangalore
Groovy and Java topicsVenkat Subramaniam, the author of Practices of an Agile Developer, Programming Groovy, and Programming Scala

- Mar 19-20, Agile Coach Camp, RTP, NC
TBDJared Richardson, the author of Ship it!: A Practical Guide to Successful Software Projects

- Mar 20-21, RubyConf India
Keynote AddressChad Fowler, the author of The Passionate Programmer: Creating a Remarkable Career in Software Development

- Mar 26, Agile Acceptamce Testing Days, Ghent, Belgium
“Coaching Teams over Acceptance Testing Hurdles”Rachel Davies, the author of Agile Coaching

- Mar 26-27, Scottish Ruby Conference
“I Think I Finally Understand Mocks”Brian Marick, the author of Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa and Everyday Scripting with Ruby: for Teams, Testers, and You

- Apr 6-8, Reston, VA
Ruby on Rails StudioDave Thomas and Chad Fowler, the author of The Passionate Programmer: Creating a Remarkable Career in Software Development

- Apr 8, New England Java Users Group
“An Experiential Introduction to Agile”Johanna Rothman, the author of Manage Your Project Portfolio: Increase Your Capacity and Finish More Projects, Manage It!: Your Guide to Modern, Pragmatic Project Management, and Behind Closed Doors: Secrets of Great Management

- Apr 8-9, Philly Emerging Technology
TBDBrian Marick, the author of Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa and Everyday Scripting with Ruby: for Teams, Testers, and You

- Apr 8-9, Philadelphia Emergent Conference
Building DSLs with GroovyVenkat Subramaniam, the author of Practices of an Agile Developer, Programming Groovy, and Programming Scala

- Apr 10, Twin Cities Code Camp, Minneapolis, MN
“HTML5 and CSS3 Today”Brian Hogan, the author of Web Design for Developers

- Apr 11-14, 360iDev, San Jose, CA
“Core Audio: Don't Be Afraid To Play It LOUD!”Chris Adamson, the author of iPhone SDK Development

- Apr 12-15, MySQL Conference & Expo, Santa Clara
“SQL Injection Myths and Fallacies”Bill Karwin, the author of SQL Antipatterns: Avoiding the Pitfalls of Database Programming

- Apr 14-16, Reston, VA
“Pragmatic Studio: Cocoa Programming for Snow Leopard”Daniel Steinberg, the author of Cocoa Programming: A Quick-Start Guide for Developers

- Apr 16, GR8 in the US Conference, Minneapolis, MN
“Grails Quick-Start”Dave Klein, the author of Grails: A Quick-Start Guide

- Apr 16, Minneapolis
On topics around Groovy, and giving a kickoff talk at GR8 ConferenceVenkat Subramaniam, the author of Practices of an Agile Developer, Programming Groovy, and Programming Scala

- Apr 16-17, Citicon: Continuous Integration and Testing Conference, RTP, NC
TBDJared Richardson, the author of Ship It!: A Practical Guide to Successful Software Projects

- Apr 20-23, Bangalore
On topics around Java and Scala, and giving a keynote at Great Indian Developer SummitVenkat Subramaniam, the author of Practices of an Agile Developer, Programming Groovy, and Programming Scala

- Apr 21, Costa Rica Agile Day
TBDBrian Marick, the author of Programming Cocoa with Ruby: Create Compelling Mac Apps Using RubyCocoa and Everyday Scripting with Ruby: for Teams, Testers, and You

- Apr 22, Manchester Geek Night, Thoughtworks UK
“Naked Objects”Dan Haywood, the author of Domain-Driven Design Using Naked Objects

- Apr 26, London
“DevDay for iPhone”Daniel Steinberg, the author of Cocoa Programming: A Quick-Start Guide for Developers

- Apr 27-30, Reston, VA
Mastering Ruby and Rails StudiosDave Thomas and Chad Fowler, the author of The Passionate Programmer: Creating a Remarkable Career in Software Development

- Apr 28, Geneva
“DevDay for iPhone”Daniel Steinberg, the author of Cocoa Programming: A Quick-Start Guide for Developers

- May 2-7, ???
teaching PSL with Esther Derby and Jerry WeinbergJohanna Rothman, the author of Manage Your Project Portfolio: Increase Your Capacity and Finish More Projects, Manage It!: Your Guide to Modern, Pragmatic Project Management, and Behind Closed Doors: Secrets of Great Management

- May 11-14, Chicago, IL
“Pragmatic Studio iPhone Programming”Daniel Steinberg, the author of Cocoa Programming: A Quick-Start Guide for Developers

- May 11-14, Reston, VA
Mastering Ruby and Rails StudiosDave Thomas and Chad Fowler, the author of The Passionate Programmer: Creating a Remarkable Career in Software Development

- May 12-14, Reston, VA
Clojure Programming StudioStuart Halloway, the author of Programming Clojure and Rails for Java Developers

- May 16~19, Software Practice Advancement 2010, London
“Customizable UIs with Naked Objects”Dan Haywood, the author of Domain-Driven Design Using Naked Objects

- May 18, Software Practice Advancement 2010, London
“Retrospectives Refactored”Rachel Davies, the author of Agile Coaching

- May 18-21, TEK-X PHP Conference, Chicago
“SQL Injection Myths and Fallacies” and “Models for Hierarchical Data with SQL and PHP”Bill Karwin, the author of SQL Antipatterns: Avoiding the Pitfalls of Database Programming

USENIX Events

- Mar 13, Pittsburgh, PA
WIOV ’10: Second Workshop on I/O Virtualization

- Mar 17-19, Pittsburgh, PA
VEE 2010: 2010 ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments

- Apr 27, San Jose, CA
LEET ’10: 3rd USENIX Workshop on Large-Scale Exploits and Emergent Threats

- Apr 27, San Jose, CA
INM/WREN ’10: 2010 Internet Network Management Workshop/ Workshop on Research on Enterprise Networking

- Apr 27, San Jose, CA
IPTPS ’10: 9th International Workshop on Peer-to-Peer Systems

- Apr 28-30, San Jose, CA
NSDI ’10: 7th USENIX Symposium on Networked Systems Design and Implementation

O’Reilly Events

- Mar 30-Apr 1, San Jose Marriott, 301 South Market Street, San Jose, CA 95113
Where 2.0: “Now in its sixth year, the Where 2.0 Conference is where the grassroots and leading edge developers building location-aware technology intersect with the businesses and entrepreneurs seeking out location apps, platforms, and hardware to gain a competitive edge.”

- Apr 12-15, Santa Clara, CA
MySQL Conference & Expo: “The largest gathering of MySQL developers, users, and DBAs worldwide.”

- May 25-27, Washington Convention Center, Washington, DC
Gov 2.0 Expo: “Gov 2.0 Expo will showcase the real-world application of Web 2.0 technologies in government and municipal sectors, featuring a practical program that will teach government employees and contractors how to apply technology best practices to foster greater transparency, effi ciency, and collaboration.”

Other Happenings

- Mar 12-21, Austin, TX
SXSW 2010

- Mar 16
Richard Stallman is 57.

- Apr 5
Dean Kamen is 59.

- Apr 6
Andy Hertzfeld is 57.

- Apr 14
Matz is 45.

- Apr 30
The World Wide Web is 17.

- May 17
Alan Kay is 70.

- May 19
James Gosling is 55.

- May 26
Ward Cunningham is 61.

Shady Illuminations

The HTML 5 Soap Opera
by John Shade
HTML is going to kill Flash! Or maybe Silverlight! No it isn’t.

If there are intelligent creatures on other planets spying on us, my guess is that they get most of their information about human culture from soap operas. That would be smart. Those daytime melodramas nicely capture the grandiose self-absorption of the human animal. And I hope the aliens are mostly watching telenovelas, those Latin American soaps in minseries format. They’re the best. Patricio Wills, head of development at Telemundo, described the plot of every telenovela as a couple who wants to kiss and a scriptwriter who stands in their way for 150 episodes.

Let’s examine how well that definition fits the HTML 5 standards process.

Generally Inhospitable

High drama? Check. One cast member accuses another of placing a secret hold on the standards process to benefit his company. The accused party hotly denies doing any such thing. The accuses comes right back with a snappy, “Oh, you didn’t? I thought you did. Never mind.”

High drama and nutty plot twists. So far, so good.

Also, I like how the “secret hold” business tars the HTML 5 standards process with the brush of the US Senate health-care legislative process. Because apparently the HTML process resembles nothing so much as one long filibuster. Maybe they’ll have to pass the sucker through reconciliation.

One Life to Live Until HTML 5 Kills You

Come to think of it, though, the moments of drama don’t compensate for the overwhelming tedium of the process of negotiating a standard. That may be why the blogosphere has to make it a life-and-death matter. HTML is going to kill Flash, or maybe Silverlight, depending on your hype source. One thing is consistent, though: somebody’s gonna die. There will be blood.

It’s pretty easy to debunk the “Silverlight killer” meme. That which HTML 5 could kill is that which Silverlight doesn’t have in the first place. That is, ownership of the presentation of video and simple animations on the web. Flash owns that, and Silverlight would have to be a Flash killer for HTML 5 to be a Silverlight killer. I see no signs of that happening.

The “HTML 5 Is a Flash killer” meme is slightly harder to debunk.

Now it’s unquestionably true that a lot of people think Flash should die. But that’s another argument entirely.

The Restful and the Restless

But it’s pretty hard to take the “HTML 5 will kill Flash” hype seriously when you remember that HTML is the product of a standards committee and Flash is the product of a company. Flash can change in response to HTML, HTML can’t change in response to Flash. Both can adapt over time, but Flash is a rabbit and HTML is a continental shelf.

So Flash will add capabilities and developers who create dazzling video or animated ads using Flash will continue using Flash, because it will allow them to make their message stand out by using capabilities Flash has or will have that HTML 5 doesn’t. And since they will want their ads to play on iPads, they’ll also produce a dazzle-deficient version to play on Flashless platforms. Ads without the dazzle? That’s a feature, not a bug.

Days of Gear Lives

HTML 5 may not be a Flash killer or a Silverlight killer, but it has claimed one victim. HTML 5 has sent Google Gears to sleep with the fishes. Gears has been “deadpooled” for Safari, TechCrunch tells us in its understated way, and is on “death watch” for IE and Firefox. It is an ex-App.

We can believe this because Google confirms it. Otherwise, it would be hard to tell. Google products just kind of seep out into the world in a state of permanent beta. Alive, not alive, it’s a coin flip. With no moment of conception when Google inserts the spark of life, there’s not going to be an unambiguous moment of app death. So it’s good that Google confirms that HTML 5 has killed Gears. Now we know.

The Bold and the Apostrophe

I seem to have strayed from my stated theme of examining the HTML standards process. Thank God for that. Standards processes are terminally boring. HTML 5 is more likely to bore standards committee members to death than to kill off Flash or Silverlight.

But I believe, reluctantly, in standards. If all of you would just do what I know you should, we wouldn’t need rules and laws and standards. But apparently that’s asking too much of you. So I accept the need for standards, especially in blogging. If I ruled the world, someone who misused boldface or wrote in all caps or consistently put apostrophes in possessive pronouns would be banned from any standards committee. But don’t worry about it. I’ll be king when dogs get wings, as I told Tom Petty.

On reflection, I guess the HTML standards process doesn’t rise to the melodramatic level of a telenovela. But it’s definitely a soap opera.

John Shade was born in Montreux, Switzerland on a cloudy day in 1962. Subsequent internment in a series of obscure institutions of ostensibly higher learning did nothing to brighten his outlook. He has still not forgiven LA electro-pop band Fol Chen for promising him a fortune but never delivering.