Sunday, October 04 2009

I grabbed "Dirt 2" for the xbox 360 recently, looking for an accessible late-night gaming distraction from coding.

The game is a stunning technical achievement, and it is amazing what they squeeze out of the almost half-decade-old era hardware of the device.

What makes the game spectacular isn't specific to some mystical art of console gaming, however, but is simply great software design and execution. While many in "mainstream" development (business processes, websites, etc) consider game development foreign to what they do, it's all just algorithms and code: One person does financial projections and another does particle effects, differing less than many imagine

The Bruce Trail near Mt NemoThe game was so excellent that I decided that I'd try to find who the talent behind it was, my quest thwarted because this game, like many recent releases by large game studios, has an apparently anonymous development team. My search for credits has yielded only a listing of artists responsible for the songs in the game.

It would be great if there was an industry credits site similar to imdb, where you could find out the people responsible for games and applications: I can easily discover who did the foley mixer work on Joe Dirt, but can't discover the team behind Dirt 2 after a lot of digging. Maybe I'll make one.

I did find a "studio tour" video, in which the only person deemed worthy of naming was the "Senior Executive Producer". Maybe if I finish the game I'll discover who did the magic to make this game happen. I'd like to read how these guys operate and do what they do, because they are clearly successful at their craft, and I imagine they'd have interesting things to say.

Are they just cogs in the gears of CodeMasters? Crank it and a great game pops out, quality determined only by your Senior Executive Director in charge of North American Marketing?

Are we past the era of superstars like John Carmack? Are we into an era where everyone is nameless "team players"...unless of course they're in senior management/marketing, in which case their contributions and name will be heralded everywhere.

As a mostly unrelated aside, the "all contributors are equal, but some are more equal than others" policy reminds me of a conversation I once had with a peer, during which they bragged about how their workplace followed a policy that strongly discouraged fancy-pants work titles (e.g. no lead architect, senior developer, etc). My appreciation for that egalitarian workplace dissolved, however, when I learned that the speaker had granted themselves a lofty, important sounding title, as did the other senior members, and they failed to see the hypocrisy in it.

Sidenote: The website for the game is mildly offensive to Canadians. They decided that the landing page would require you to first select a country, with the options being the Netherlands, Belgium, Germany, Spain, the UK, Italy, France, and the USA.

As a Canadian I'm left not knowing which I'm supposed to pick. Maybe I'm supposed to pick the UK to get words with superfluous 'u' still intact. Maybe I'm supposed to pick the US just because of proximity? Two of those countries (the Netherlands and Belgium) are significantly smaller than Canada, so I have to guess it's a hybrid language/proximity thing.

Lots of websites pull this cheap navigation technique and it's lame. Often a US flag really means "English", other times a Union Jack means English. Nationality and language aren't the same thing, so it's a lazy tactic, made especially confusing when both appear together.

Then again, if I recall correctly the old Codemasters site worked by having you select on a world map, where all of North America was labeled "United States of America". Us Canadians get accustomed to it.

   
Friday, October 02 2009

Back in 2001, I posted an amateurish essay on micropayments, written from my perspective as a willing-to-pay consumer that hoped to continue to enjoy quality content while the online advertising market collapsed.

Micropayments

 

Micropayments

 

Embarrassingly it got picked up by Slashdot and was put up as the awkward counterpoint to an earlier article by Clay Shirkey, in which the author competently, with research and everything, argued against the concept.

Arguments were had and forgotten, and we all moved on. Lots of great content disappeared from the web, advertisers got more and more desperate, often malicious, and a long and horrible content drought ensued.

Eventually Google came onto the scene, bringing advertising to the little guy, and the content market was reborn on the back of Adsense.

Clay was held up as the victor, or more correctly was considered the only contender, and has been used for citations countless times since, unquestionably proving the non-viability of any small-transaction system. I came across just such an article moments ago, as I do several times a month.

Was Clay right? Are people really psychologically unable to handle small payments? Is the idea of small-cost subscription packages for websites an unworkable model, or do people just say that because they like imagining that they're having a free lunch?

Lots of people seem to think so.

Then again, lots of people thought the Earth was flat, terrible things would happen when we passed the speed of sound, it would be impossible to full-text index the internet or to search it economically, and so on.

Take a moment to consider that there have been 2 billion iPhone apps sold, with a current average price hovering around a dollar. There are predictions that the average price will rise in the coming years, to a magnificent $2.37 by 2013.

This is for generally small, disposable apps that often do little, but because the cost is small and the transaction surprisingly well lubricated by the iTunes process, a lot of people just click "buy" and enjoy the experience. Look at Atwood himself — using him as an example given that he comes into play in the article I referenced earlier — who said:

My total bill for 3 screens worth of great iPhone software applications? About fifty bucks. I've paid more than that for Xbox 360 games I ended up playing for a total of maybe three hours! About half of the apps were free, and the rest were a few bucks. I think the most I paid was $9.99, and that was for an entire library. What's revolutionary here isn't just the development ecosystem, but the economics that support it, too. At these crazy low prices, why not fill your phone with cool and useful apps? You might wonder if developers can really make a living selling apps that only cost 99 cents. Sure you can, if you sell hundreds of thousands of copies:

That's impossible! Clay Shirkey says so! Or at least that's what people often interpret him as saying.

iTunes doesn't just service the iPhone app market. Aside from its start selling music (usually sold by the track), countless people are avoiding advertisers and buying network television content via the services. Marginally small amounts, but low transaction costs, technology, and the ease of purchase makes it a viable market.

iTunes doesn't own this nickle-and-dime market, though.

I enjoy the occasional bout of gaming on the xbox 360, and it takes every opportunity it can to try to get me to partake of tiny little purchases, some as low as $0.40. Want a game-specific theme? Want some bling for your avatar? Want that car before you've "earned" it? Want this amateur community game? Come on, it's just a couple of points from some nebulous points pool that you can spend simply by pressing A a couple of times, and when it empties you just add a bunch more.

Of course, all of this naturally leads to the semantics of what a "micropayment" is, and inevitably people will argue that a micropayment must be paying sub-pennies by the page, or the KB, or the image, or whatever. That isn't the spirit of it at all, however, and instead the origins of micropayments were easy to accommodate payments of amounts that were traditionally uneconomical to gather. In my mind iTunes absolutely supports micropayments the theory, because prior to that service it simply wasn't possible to sell applications for $1 or less. There was a fairly lofty minimum threshold below which it wasn't worth your time.

That is no longer the case within certain spaces.

Which again brings us to the possibility of micropayments for websites that hold actual value: People need to quit pretending that micropayments are some disproven, unworkable theory. There are a lot of us who simply abhor advertisement or economic coersion in all its forms (as you saw in the prior entry, the moment someone adds commission links to what is purportedly a subjective review, my opinion of their credibility drops precipitously, and I'm suddenly wondering if they actually liked the product, or if they just fumbled around for something and pushed the first thing they found, using it to effectively tax the readership indirectly and terribly inefficiently), and who aren't cheap bastards. If you have a site of value, and if there were a trustworthy, credible and lubricated system like iTunes for Websites, the idea could have legs.

   
Thursday, October 01 2009

Three Kings

In an earlier, more naïve era of my career, I had three software development “heroes”: Jamie Zawinski , John Carmack and Joel Spolsky.

Jamie Zawinski grabbed my attention because he was at the center of the internet revolution, right in the bowels of Netscape from the outset, and had established a pattern of posting surprisingly pragmatic comments that defied convention.

It was extraordinary to read someone openly critical of their own organization, especially without it being retracted or redacted the sobered-up or calmed-down next day, and where the author didn’t hide behind anonymity.

Jamie let us commoners see the sometimes ugly mechanics behind the curtain. He also revealed a very interesting workplace that was foreign to the gray-walled cube world that most of us lived in.

Georgetown Fall FairThis was at a time when Microsoft really had almost unthinkable dominance over the industry, so to hear Jamie discuss the travails of cross-platform development was like going out of bounds at a tourist resort. Seeing what the brochure didn’t show you.

An SGI box? IRIX? How exotic!

Another of the kings, John Carmack, was blessed with “F-you money” from the incredible success of some of his earlier projects, along with a proven abundance of intelligence and skills, so he too had the luxury of entertaining a surprisingly realistic and pragmatic perspective. He was a principal driver of the evolution of GPUs and gaming hardware, and you can owe thanks for some of the capabilities of your console or dual-GPU rig to his desire to make shooting things in first-person shooters hyper realistic.

Carmack was also one of the original “bloggers”, regularly posting lengthy “blog entries” by repurposing the UNIX finger facilities.

Joel Spolsky is a bit of the odd-man out in this trio. While he did have the requisite first-initial, he wasn’t known for extraordinary technical acumen (beyond having worked on Excel in some earlier life), but hear me out, please.

Joel ascended to Kingship – at least in my personal hierarchy of industry royalty – just after the dot com crash, when CMM factory-line initiatives started to become the mythical silver-bullet: This was an era awash with articles gushing about the amazing adoption of CMM5 among offshoring firms.

Many organizations were striving to reduce software development to an assembly line of easily interchangeable cogs, both of code and people, achieving a utopia where the process would become perfectly predictable and repeatable if only you filed enough forms.

Joel spoke up for developers when most were absurdly blaming the .COM collapse on dual-monitors, Aeron chairs, and inflated developer egos, as if taking developers down a notch and having them sit on a cold rock would have made selling kitty litter online a good idea.

He was essentially an enlightened pointy-hair blogger, and while I wouldn’t look to his blog for technical advice (Wasabi!), he really understood developers and the process of getting software built. And he was willing to risk his own nest egg and put his money where his mouth is, having since built a reasonably successful company in Manhattan that most of us should be envious of.

Unbound by Convention

What made these three really stand apart in a sea of cheap advice-givers and pundits was that none of them were writing to get a job or even necessarily to keep one. Joel made his own bank while the other two were of such technical esteem that they had little to worry about professionally regardless of what they might say.

They weren’t coerced into railing off the latest buzzwords and best practices, deferring to the latest silver-bullet best practice pattern-based UML diagramming system 3NF data warehousing factory built on a n-tier service-oriented, aspect-oriented, polymorphic framework so that they can get the approving nods from the nervous masses and clueless PHBs.

They didn’t worry about offending a boss who held some sacred cow that if only you did it the way she read on some best practices blog, everything would be fabulous, at least until that initiative fails and you move on to the next cure-all.

The three kings were just saying it like they saw it, which was and still is rare.

Eventually Joel ran out of things to talk about and switched his blog to mechanically regurgitated repeats; Carmack got lost endlessly perfecting the noble quest of simulating head shots when he wasn’t reaching for the stars; and Zawinski decided to engage in endless battles with the city of San Francisco over his money sink of a late-night dance club (if you read his blog about DNA Lounge early on, you could almost smell the contractors taking this dotCOMinaire for a ride).

Maligning Metaphors

I was delighted to see Joel return from effective blogging retirement, and my enthusiasm exploding when I saw that it was a post about Zawinski!

A royal duet!

Okay really Joel was selling a book – like his partner-in-crime Atwood, he seems to be motivated to post by Amazon Affiliate bucks these days, credibility undermined by that kickback – however he chose the Zawinski chapter as his pitch, talking admiringly about how practical and “get ‘er done” (paraphrased) jwz was about his craft, doing so with a present tense that betrays a certain blissful ignorance about Jamie’s career path since.

Joel labeled Jamie the “Duct Tape Programmer”, which was a description that Jamie took as “damning with faint praise”. Joel has long been against architectural astronauts, so he seemed to excitedly hold up Jamie as the successful counterpoint.

Perhaps “duct tape” is a bit of a metaphorical overreach, causing many to envision some Tim the Toolman ‘Ar ar ar’ hack.  Pragmatic or practical probably would have been more accurate, though it would have made for a less contentious entry.

Never mind that Jamie worked within extremely tight timelines, using technology far less advanced than what we have now.

Joel’s entry raged across the social news sites, with the regular suspects popping out of the woodwork to declare it a grievous offense to all that is all that is good in the world of software development. Lots of blog replies parroting the standard best practices appeared, their authors clearly hoping that their boss and any future employers will see how studious and diligent of worker bees they are.

Who Decides on Best Practices?

The people who are the most certain about software development patterns, practices, and technologies are usually the people who have the least reason to have such certainty.

I’m going to be a bit trollish while I go to the extreme and say that many of the oft-quoted leaders of the field, responsible for much of the unquestioned wisdom-bites, have little to demonstrate why they’re in a position to preach.

The revered Fred Brooks, author of the Mythical Man-Month, came into a position of considerable influence largely by leading a project that was by most accounts a massive failure. That would be fine if there was but one way to fail and he found it for the benefit of all, but there are an infinite number of ways that a project can fail.

Of course you must learn from failures, but my experience has been that the explanations for failure are often a worse-than-useless distractionary tactic: When a team technically fails to accomplish what they set out to do, expect the post-mortem to be full of nonsensical misdirection about how everyone and everything else is to blame.

How many post-mortems include the statement “I grossly overestimated my own capabilities”? I suspect few.

Steve McConnell is another well-known author in the field, revered for his software development books (though many strangely overlook After the Gold Rush, where McConnell knee-jerk responds to the dot COM collapse by advocating an ill-considered licensing system for software developers), but his professional experience seems to be limited to working on TrueType at Microsoft, and some nebulous software development at Boeing, after which he took on the role of telling the world how software should be developed. Now he consults with pointy-hair bosses to unknown outcomes.

Don’t get me wrong, I have both of them in the bookshelf behind me, and read and greatly enjoy their opinions (Brooks’ observation about second systems is more profound and important, I think, that the over-quoted man-month snippet), but really, let’s keep some perspective and stop using it like they’re the incontestable word of truth.

I read them critically and with an open mind, not taking it as the voice from an all knowing deity, but instead the perspectives of a couple of guys drawing from their experiences.

Georgetown Fall FairOf course, the esteemed Fred Brooks and Steve McConnell exist in a realm far above most silver-bullet cheerleaders in our industry. These successful authors actually dirtied their hands with actual software development, refactoring their opinions over the years into refined perspectives. I select them merely as “absolute best case” examples.

More commonly the people who most ardently advocate certain practices and approaches have achieved little, usually having nothing to back their conviction but self-interest and a desire to look like they know what they’re talking about, having associated their id with “correct” approaches.

They just clutch onto whatever they hear is proper and start repeating it like a novelty birthday card repeatedly opened. They’ll tell you that should develop like an ecommerce site, despite not being an ecommerce site; like you’re NASA, despite not being NASA; like you make the software for a pacemaker, despite actually making an ebay auction sniping tool.

Why do I hear the word “pattern” from mediocre or non-developers more than I hear about it from experienced developers, always stated as some sort of conclusive statement?

Why do we accept that a chimp-level of software development skill is acceptable for maintenance programmers, capable of understanding only the most infantile code that is carefully decorated with “Coding for Dummies” comments?

Why is “We should use UML” the desperate last-ditch fallback of failing teams everywhere?

Unit testing, or the more early-loaded TDD, can be great, but it isn’t a panacea and is an extremely poor substitute for actual craftsmanship.

Moving beyond the non-developers giving their unwanted opinion on how software should be built, the other class of destructive noise is the advocacy of silver-bullet methodologies during the honeymoon period.

Great, you built a sample app on RoR/Haskell/Scheme/python or whatever else is the cure-all platform that profoundly changed your world view.

Here’s a nickel. Go build a real app then tell us how revolutionary it is now. I don’t discount the advantages, but advocacy based upon toying around is of little use to real projects. Extrapolating it up is foolhardy.

Oh look, another guy telling us how switching to the Dvorak keyboard layout made him regular and makes his code smell like cinnamon. Here’s someone saying that they slept 4 hours a night by taking 20 minute catnaps, proven out over their two day sample period. This guy says that having a 400x200 single-app screen on a netbook made him a perfectly focused coder. Here’s a dieter who is certain that they’re onto an incredible, beats-the-laws-of-thermodynamics diet now that they’ve followed it for a whole six hours.

The Emperor Has No Clothes!

The fairy tale “The Emperor’s New Clothes” has significant relevance to the software development field. To quote the plot summary from Wikipedia

An emperor of a prosperous city who cares more about clothes than military pursuits or entertainment hires two swindlers who promise him the finest suit of clothes from the most beautiful cloth. This cloth, they tell him, is invisible to anyone who was either stupid or unfit for his position. The Emperor cannot see the (non-existent) cloth, but pretends that he can for fear of appearing stupid; his ministers do the same. When the swindlers report that the suit is finished, they dress him in mime. The Emperor then goes on a procession through the capital showing off his new "clothes". During the course of the procession, a small child cries out, "the emperor is naked!" The crowd realizes the child is telling the truth. The Emperor, however, holds his head high and continues the procession.

Too often the software development industry suffers for lack of someone crying out. We often just go along with it, listening to the declarations of non-developers and maintenance programmers as if they speak unquestionable truth, all while discarding any counterexamples as mere aberration (“Well not every team has superstars you know! We aren’t all John Carmack!”).

Everyone withholds contrary, pragmatic “Well it isn’t quite so cut and dry…” opinion lest they look like a “hack” to a present or future employer or nervous, cargo-cult embracing peers, smiling politely while the never-coded, overconfident guy acronym drops about things he doesn’t understand in the daily stand-up.

The more you know, the more you’ve experienced, the less obvious the world becomes, and the more hesitation before offering up opinions. The less ease there is to criticize the path of others when it has yielded obvious success.

Opinions come quickly to experts and morons. Few of us are experts.

Jamie Zawinski had unique conditions under which he unquestionably succeeded. Many, with the seeming clarity of hindsight and the ability to project whatever imaginary timeline one desires, will look back and comment on how the codebase got rewritten, purportedly twice, and how eventually the product was squashed, stomped out of relevance by Microsoft (before being reborn as the game-changing Firefox), using that to draw the absurd conclusion that if it were produced “properly” at the outset, today we’d all be using Netscape 9. Then again, maybe it would have followed the disastrous arc of Chandler.

The road that leads to most successful apps is often an ugly, brutish affair filled with compromise and folly, risk-taking, detours-followed, and shortcuts pursued. That isn't to justify them, or to diminish alternative approaches, but we should always keep our minds open, being less quick to defensively guard whatever we're selling as the cure-all this week.

A Call Out For Success Stories

What I’d like to read more about are the success stories, and less about the professional pundits telling everyone how it ought to be done.

Of course here’s where we get into a common paradox that exists in most industries: The successes are usually off enjoying their success and wealth, less inclined to toil away their days writing blog entries extolling their "dart toss" method of architecture. We’re left with the conversation being dominated by the people who don’t actually make software at all, telling us how grand they could make software, if they ever actually did, by following their sure-win magic formula. The conversation boards are overrun with the people who actually have so little to do that they spend their time describing the ideal way that everyone else should write software.

Parallels can be drawn with the financial world, where the snake-oil salesmen pitching the ways to make money are usually doing so because their only way of making money is pitching how to make money (Want to know the secret to making big money? Send me $5, and I’ll tell you that it’s to get people to send you $5 to learn the secret of making big money). The guys actually making the money are off making the money.

This brings us full circle back to Joel’s recommendation of the book. A book that serves as one of the few opportunities we have to really read how projects succeeded, straight from the source.

It’s good if only to let the successes have a voice in the conversation.

   
Wednesday, September 16 2009

Georgetown Fall FairGoogle released an update of their web browser yesterday, bring Google Chrome to version 3. This release offers a number of improvements and new features, and pushes JavaScript performance even further into the stratosphere, keeping up the horse race between Chrome and Safari.

One improvement that has gone largely unnoticed is that 3.0 brings Web Workers to Chrome (of course it already had it in Google Gears fashion, however now it's in the standard, cross-browser form), so you can run the web worker benchmark I previously put up and see Chrome 3 blazing a path. I'll update the comparison charts to include this browser shortly.

This means that web apps using Web Workers for enhanced performance on multi-core machines, or more importantly for better GUI responsiveness, now function on Firefox, Safari, and Chrome, leaving just Internet Explorer and Opera as the hold outs.

Quiet Upgrades

I really appreciate how quietly Google updates their browser when you already have it installed. No user-disrupting fanfare or attempts to use the opportunity to push new toolbars or side products on you (which, I suspect, drives the frequent updates to many products. I uninstalled NoScript way back after having the update notice seemingly every other day for what seemed to be the most trivial extension possible, each update bringing you to the advertisement riddled website where it incidentally told you that they made some sort of irrelevant non-update. That was before the notorious battle between NoScript and Adblock, where the former again was motivated primarily by ad impressions). Of course this model gets much more debatable once changes include major functionality changes, or breaking changes, however as is it's a seamless way of delivering updates, where each version simply improves and adds to what is there.

   
Tuesday, July 07 2009

Back in September of 2005 I wrote an entry on Microsoft's confused and self-destructive position regarding Mono, the open-source implementation of a .NET runtime/C# compiler. It is great to see that Microsoft has cleared the air, likely in reply to some recent comments by Richard Stallman.

However you feel about Stallman, he should be thanked for eliciting this position declaration and finally helping to legitimize Mono. .NET / C# developers should rejoice at this development.

   
Monday, July 06 2009

The G1 Moves to Canada

Android The first Android-based phones available in Canada are the HTC Dream and Magic, both recently introduced by Rogers Canada. The Dream is better known in the US as the G1 under its T-Mobile guise, where it has been available since October of last year. The Magic is a newer phone, known in the US as the G2, offering a bit more internal memory and flash storage, and a sleeker, lighter design made possible because it doesn’t have the physical keyboard that the Dream sports.

The phones are a bit late to the moose party, but at least they finally made it. We tend to get these things a little slower here in the Great White North, as we’re a lucrative enough market that these companies want to pursue some sort of strategy to aggressively monetize us, yet we’re a small enough market that they’re in absolutely no rush to do so. We’re often stuck in a bit of limbo, embargoed out of play until some grand strategy is developed.

Alas, the Android finally got their landed immigrant papers and moved in.

Apple Goes and Spoils the Party

The Android launch has been rumored to be a big disappointment for Rogers, and they've already resorted to slashing prices. The phones aren’t nearly as sexy as the iPhone, and their release in Canada came right as anticipation for the 3GS started swelling, exploding into a tumultuous wave of gooey pro-Apple fanaticism.

The poor reception isn't all that surprising. For many end-users the iPhone really is a better product, an assessment made even truer with the release of the 3GS. It was a close race with the 3G, but there seems to be a clear winner now that the 3GS is available.

The Dream, its 528Mhz processor purportedly underclocked to 384Mhz* — presumably for thermal reasons — fell behind the iPhone 3G, and is easily kicked around by the 3GS. The HTC’s design is comparably stodgy, and the app support isn’t as robust or polished (especially here where inexplicably there is no access to the commercial Android market apps. Instead we’re restricted to the free software). The hardware saw no upgrades at all over its year-old G1, so there’s still a restrictively small amount of on-phone storage, and yet Android 1.5 — the “cupcake” version installed on the Rogers phones — has yet to support installing to the SD card while they iron out the inevitably futile DRM efforts, so that remains a very real concern.

* - Note that the statement about the underclocked processor is based on information I discovered online while researching the phone, repeated across many sites, not that repeated assertion gives it any further truth. However I can say that when playing around in the shell on the phone with the excellent and free connectbot app, the scaling_max_freq is set to 528000, implying that the Rogers build of the phone will clock all the way up to the limits of the processor.

Rogers made the situation for the Dream worse by crippling the one meager advantage it holds over the iPhone (in my opinion a huge advantage, but subjective opinons differ), which is that it has a real keyboard. For reasons that are hard to understand — I have a strong suspicion that it relates to bilingualism, which is the reason why we also don't have voice search, a feature really sorely missed given how valuable it is in the latest Google maps update — the Rogers build of the Dream variant of the phone has no onscreen keyboard, forcing you to pull a Transformers routine on the phone every single time you need to enter so much as a letter. This turns the physical keyboard into as much a liability as an asset, and if it ended at that I would recommend that people go for the Magic and steer clear of the Dream. Not only does it make it a pain to do quick interactions with the device, but I'm sure the endless opening and closing (often in situations where you shouldn't be trying to open and close a device) isn't optimal for the long term reliability of the unit.

Thankfully this terribly stupid decision can be easily overcome, and you can get the incredible utility of both the software keyboard and the physical keyboard, as each best fits. When you just want to punch in the start of a business name to look it up in Google Maps, there’s no need to pull out the keyboard.

The HTC Android phones came to Canada with excellent Exchange ActiveSync support, so for corporate users it supports their Exchange installations with no unnecessary middleware software or services.

Enough about the HTC phones, I recently had the desire to upgrade my smartphone, and as you can see above I firmly believe that the iPhone 3GS is the superior phone. It is impossible to argue otherwise.

The choice is clear.

So I went and bought an HTC Dream, signing up for the 6GB / month data plan. Given that I'm usually around a WiFi point, I doubt I'll ever use even a fraction of that, but I'd rather not even have to worry about it.

It's All About Potential

I simply believe that the Android platform has a very bright future ahead. That it is poised to be unstoppable. I am of the belief that gaining the developer knowledge and comfort with the product now beats using the faster, slicker (and definitely cooler) iPhone 3GS. And I like having a real keyboard.

I am convinced that in the next two years we'll see the release of a variety of compelling and powerful products based on the platform.

And while it isn’t an iPhone 3GS, and I wouldn’t recommend it to my sister in-law, it’s still an amazing little phone in its own right. It is far from perfect (there are Windows Mobile-like interface delays throughout, and several apps have outright crashed on me), but it’s very decent and technically amazing.

The Google integration of the phone is a nice benefit of the device. A few years back I predicted the emergence of Satvertising, in particular as satellite imagery became available on navigation devices, so it's interesting to see it become a real possibility with Google maps on the Android. It’s pretty bizarre to pull up the map while sitting on the deck out back to find that Google maps had me literally at the table that I was sitting at.

The deep Gmail integration, especially for Google Apps users (including "Standard Edition"), is excellent. The Exchange integration is close to perfect, and it certainly beats what the MotoQ, a Windows Mobile device, offers. Using both on the same device is painless, with excellent integration (e.g. calendar events drawing and saving to either) and no confusion.

Several videos I encoded with h.264 AVC (one of the best codecs around) played brilliantly, and I've read that it's comfortable with a number of other video formats. The included player is a little buggy, so occasionally things like update spinners would get orphaned on the screen, overlaying your video for the duration, but its easy to get around. The unit plays MP3s well enough, so not much notable there. On WiFi some better YouTube videos look amazing, though some arbitrary limits of the software has the quality declining to somewhere between atrocious and terrible when you fall back to 3G, not because 3G can't feed the data quickly enough, but instead because the YouTube app starts sending a "mobile" bit, telling the server to send the degraded version regardless of the capacity of your pipe.

The onboard camera stinks, but so does the onboard camera integrated into any cell phone (yeah, I'm talking to you iPhone users as well. The lowest-end P&S camera does a much better job than your phone does). It works in a pinch to document some random taserings, but I wouldn't convince myself that it replaces a real still or video camera. It does allow for some pretty cool uses like ShopSavvy. The GPS-like integration of Google Maps is very cool, and again works in a pinch (and offers some really dramatic functionality like overlaid satellite imagery, and is great when walking in a big city), but I wouldn't depend too much on it, or imagine that it replaces a dedicated unit. Given that it's downloading on an as-needed basis, a weekend trip to a conservation area outside of town had it drawing a blank, and despite having a GPS lock, it had no context to know where it was (having the constant need for a data connection). Maybe there are full-out GPS apps with real maps you can store on your SD card, making it usable for off-the-pipe usage — I've heard that BigPlanet is just such an app — however just a warning for those thinking that this phone alone replaces the need for a real GPS.

The short battery life of the device is well known, and is similar to most other high-power smartphones. I grabbed a 1400mAh battery to replace the included 1050mAh unit, and hopefully that makes it a bit less of an issue.

The wireless speeds seem decent enough, but despite signing up for a 6GB/month plan (which was a closely-held secret that you could get for $30 up to June 30th), it goes out of its way to ensure that it pretend that I’m on dial-up. YouTube, for instance, has spectacular quality when connected to WiFi, but the moment you’re on the supposedly 7.2Mbps 3.5G network, it unnecessarily degrades to a garbage quality level (maybe there’s a “quit skimping on the bits” setting somewhere, but I’ve yet to find it, beyond ridiculous workarounds including downloading videos fully first and then viewing locally). This is one of those consequences of illusions about throughput.

Other potential services like VoIP are simply servico-non-grata (err…), with vendors like Skype providing terse statements that they’ll never support pure VoIP, careful not to open that can of worms. I’ve heard such a use of the service has even been made they-come-and-cuff-you illegal in some countries, which is extraordinary. You’ll pay for those minutes and you’ll like it, damnit!

Developers, Developers, Developers!

Alas, what really compelled me to choose the an Android-based smartphone is my software developer urges. What incredible hacker fun the platform provides!

Getting started developing for the platform is surprisingly easy (I think I’m going to post a little “first steps” post about what it’s like for a non-Java, non-Eclipse developer to get started developing for the Android), and the free development ecosystem is remarkably robust and feature rich. The normal complexities of software development present themselves as you try to build something “real” — no magic bullet there — but there isn’t the demotivating waste of time dealing with the typical nonsense when starting on a new platform. And you don't have to go and buy a Mac or agree to let Apple name your firstborn (iConsumer) just to develop for it.

And you don't have to stay in the stratosphere of the Davlik virtual machine, but instead you can create native code, or even alter that base platform itself. The whole thing is open source after all.

Excuse me, is that 600 million Dhrystones in your pocket?

It really is a powerful little computer in your pocket. In just a few more years I’m sure such a device will be central to a user’s computing reality, on a need basis wirelessly connecting to keyboards, displays, mice, and so on.

What an amazing time. To have such a remarkably powerful device with accelerometers, a compass, GPS, a very powerful little processor, 3D hardware assists, WiFi, WiFi-like cellular network speeds, all targetable by anyone using extremely rich, yet free, development environments (the Eclipse integration is spectacular)…the potential is truly limitless.

Amazing things lie ahead.

   
Friday, June 26 2009

Web Worker Benchmark - Moonbat

If you're running Firefox 3.5 or Safari 4 [EDIT: Or Chrome 3.0], take a look at the "benchmark"/technology demo I just put up. [Safari 4 compatibility added based upon the great comment submitted by Oliver]

It's a modified variant of the SunSpider benchmark that I've written about before (in less than flattering terms), which I heavily altered to utilize the remarkable new Web Worker functionality you can now explore in Firefox 3.5. If you're really analyzing performance, be sure to disable Firebug as it significantly impacts the results.

Google GearsWeb Workers, a standardization of a feature of Google Gears, are a remarkably simple method of multi-threading JavaScript, not just to get it out of the UI thread — where it can be very detrimental to the user experience as the interface freezes while a script runs — but also to scale across multiple CPUs and cores on modern PCs, which while seemingly a ridiculous notion ("but it's just JavaScript! Multithreading?") is becoming a real concern as the JavaScript engines continue to advance and the usage and scope of the language and related technologies continue to expand.

Through a simple, synchronized message passing system and a minimalist API, the Web Workers model lends itself to robust, elegant code that isn't as prone to classic multi-threading pitfalls. While not a part of the current instantiations, in a theoretical implementation there is no reason why web workers couldn't be located on entirely different machines, given that each worker is essentially an isolated runtime, sharing very little (the navigator properties and some basic security info for things like enforcing XmlHttp restrictions), communicating via serialized messages.

Understanding the Benchmark

The benchmark/technology demo is operational in Chrome, Opera, and Internet Explorer, but only if you change Web Workers to 0. In that case it is sequentially running the set of tests in the main thread, as JavaScript has traditionally been run. I didn't intend for this to be used for cross-browser comparisons, even if I resort to presenting just such a comparison at the end of this entry, and instead the focus is really on the technology, so the real "power" is seen once you start to turn up the web worker dial, all the way to 11.

SafariWeb worker multithreading isn't limited to Firefox 3.5. Oliver left a comment pointing to a Safari-ready variant he threw up, so I modified the test accordingly (the difference being that when Safari implemented it, it didn't intrinsically include JSON encoding, so your caller and receiver had to do that themselves). I didn't realize that Safari had covered this ground, though it isn't shocking given how rapidly that browser has been advancing.

With one web worker, the UI remains fully responsive to user interaction, which is an experience quite unlike what was seen at 0 (where the browser essentially locks up during the run), and the actual run itself suffers little for the isolation. On a quad-core CPU, the CPU usage during the duration of the test cycle fluctuates around approximately 25%.

At two web workers, the individual tests take slightly longer to run, however the actual completion and pace of the tests in the whole is greatly improved. Not quite a halving of the runtime, but not too far off. Two cores are saturated during the duration of the test.

At three web workers, three of the cores are filled with work, and the total elapsed time improves somewhat, albeit not by the ratio that correlates with the 50% increase in computation power.

At four web workers, we've tapped out the parallelism and despite all four cores being saturated for most of the duration, the total runtime actually suffers slightly. Going above four doesn't cost much, but it also brings no real gain (beyond possible algorithm gain isolated various parts of the application).

You can also run a mode where instead of running a modified js directly in the worker thread, the code is passed as a string parameter, eval'd into a function reference, and the function is run. There are some interesting observations to be observed by this test, such as the lack of tracemonkey loop optimizations on eval'd code (see bitwise-and in particular. It suffers dramatically when run as an eval'd function relative to running as literal JavaScript). This surprised me as the eval merely instantiates a function in the current context, but doesn't run it, yet the performance penalty remains because it was sourced from an eval.

Here are some results for 1-8 threads, running 10 cycles of each test, gathering the total elapsed time in Safari 4 and Firefox 3.5 RC2. This was run on a quad-core Q9400 machine, and of course your mileage will vary. While it is evident that Firefox 3.5 is using more of the available processing power as you move past 1 thread, with it increasing from 25%, 50%, 75%, to 100% at 1, 2, 3, and 4 threads respectively, it doesn't fully benefit from the additional resources, yielding a greatly diminished rate of return. Safari, on the other hand, already started with a considerable lead, and it pulled away with each thread up to the optimal 4, really hitting its stride.

Multiple threads in Safari and Firefox 3.5

I'll add some charts and the like to this entry later, but just thought I'd drop a line on that demo of a very promising technology that will soon see fairly robust deploymet (one huge benefit of Firefox -- shared by Chrome and Opera -- is that the uptake rate for new versions is extremely high).

   


About the Author
Dennis Forbes Dennis Forbes is a Toronto-based software architect. While focused primarily on the .NET and SQL Server worlds, Dennis frequently ventures outside of this comfort zone into game development and image processing. He has been published in several industry magazines, has been quoted in the Wall Street Journal and has been interviewed by NPR.

He is a vice president and lead software architect at an innovative New York City hedge fund back-office services firm.

Dennis has been working on solutions for the financial, telecommunications, and power generation markets for over 15 years.





 
Earlier EntriesLater Entries

Dennis Forbes