28 July 2009

Launched

36 hours, more or less, after the launch of the new npr.org, and we're all feeling pretty chuffed. The coverage in the New York Times and elsewhere didn't hurt.

From Andy's pics of the late-morning launch meeting (we had to take over the Music end of the floor to fit in everybody—that's my elbow in front of the window, far right), to roving Callie's skewed-angle portraits, to the steady stream of tweets, our launch activity was meticulously documented. I think Daniel and crew were particularly bold to live blog the proceedings, when you consider that the process took more than twice as long as we planned. There are lots of tweets like:



  • We are moving a lot of data in our migration scripts. Taking longer than expected in the live env. @daniel_jacobson Sunday, July 26 13:44:58
  • Final stages of migration before the QA starts. Taking longer than expected... @daniel_jacobson Sunday, July 26 14:13:51



I remain astonished at how smoothly this boat got into the water, with a minimum of schedule slippages, sharp words (and some of those from me), late nights. Beyond this, standards of excellence have been maintained. And the emphasis on transparency is something I've never seen before, with my background in proprietary software products and financial applications.

The back-end application still shows its age in places, but to its credit, the project planners made this an opportunity to give it a feature boost while also building the public-facing site.

It really has been a great project. What's the opposite of a perfect storm?

06 July 2009

Putting it together

We've been code-reviewing some of the Java code on the project, and the question of optimal string concatenation came up. While others on the team were loyal to StringBuilder.append(), I had relied on the + operator, following the advice of Ian Darwin in his Java Cookbook 2/e:

3.4.1. Problem

You need to put some String pieces (back) together.

3.4.2. Solution

Use string concatenation: the + operator. The compiler implicitly constructs a StringBuilder for you and uses its append( ) methods. Better yet, construct and use it yourself.

I scratched a little deeper, and found that a more complete answer to "which is better?" depends in part on what compiler optimizations you're using, as Apurba and Pavitar point out. Schneide Blog also notes that it's hard to measure string concatenation performance in isolation from the real-world context where you're performing the operation.

Another point to keep in mind: what are we trying to optimize? Run-time speed, memory usage, or something else? Nicholas Hagen, in his benchmarking tests, helpfully provides both execution times and object creation counts. Hagen gives some rules of thumb. I have added emphasis to the most important one for us, and fortunately it matches our informal shop standards.


  • DO use the plus operator if all operands are constants

  • DO use String.concat if only concatenating 2 strings

  • DO use StringBuilder within a for loop when updating values

  • DO use StringBuilder if concatenating more than 2 strings

  • DO use StringBuilder rather than re-assigning variables multiple times

  • DO ensure StringBuilder has proper sizing



Fortunately for this project, all the Java string manipulation is done in backend systems on an moderate-volume intranet, so these general guidelines are sufficient; we haven't needed to do extensive profiling to find hot spots. The public-facing web site uses different technology altogether.

01 July 2009

Everything's better on a stick

Ryan Paul reports on the first official release of the Sugar educational software platform for removable media. Sugar was the Linux-derived OS distributed with the first generation of XO computers. With the release of Sugar on a Stick (SoaS), now it is the case that
When Sugar runs from a memory stick, the user's files can be stored directly on the device. This completely portable and self-contained approach makes it possible for students to use at school and at home. It also makes it easy for schools to repurpose existing computers and get them up and running with the Sugar learning environment with minimal difficulty and investment.