Dennis Forbes on Pragmatic Software Development
Subscribe to RSS
 
Monday, June 04 2007

Jeff Atwood, of Coding Horror fame, recently rebutted my post "Beginners and Hacks", which itself was a reply to his post "C# and the Compilation Tax".

Jeff makes some great points, but at the outset I have to disagree with his statement "The present model of software development is clearly monkeys all the way down. And if you're offended to be lumped in with the infinite monkey brigade, I'd say that's incontestable proof that you're one of us."

No, Jeff, I don't develop via the Infinite Monkeys Model. It disturbs me that any professional in this industry would volunteer for such a pejorative.

While humility is often a good thing, there is a limit. Every developer can't be Linus Torvalds or John Carmack, but every single developer should still have professional self-respect, and a desire to do and be the best that they can.

As for my denial of membership in the worldwide IMB representing "incontestable proof" that I'm among that group, that comment had me reminiscing about a shop I worked in about a decade ago: A new hire had proposed a questionable set of development changes, some of which I was passionately opposed to. He dismissed such disagreement via a hilarious bit of circular reasoning--

a) If you passionately disagree, you are being "defensive"

b) If you're being defensive per the definition given in a), it must be because you are wrong.

It's a simple, comforting way of dismissing opposing perspectives: Everyone who disagrees is just being defensive because they're wrong. It was so remarkable that it has always stuck with me as an example of self-delusional perception.

Jeff goes on to compare his apparent utter dependence on continuous compilation code checking with squiggle-line spell-checking. Even if I were to accept that simile, which I don't at all, let's humor that comparison for a moment.

I've written about the importance of correct spelling before, and have lauded the integration of automatic, continuous spellchecking in Firefox. I'm typing this entry in Microsoft Word, which has helpfully alerted me to several misspellings (mostly the result of typos).

I greatly appreciate these tools, and how they help me with the craft of writing.

Yet I'm not a professional writer. I am, in actuality, a hack and a beginner.

By noting that differentiation, am I then saying that a professional, dedicated-to-the-craft writer would actively abhor such a tool (see the Frank Navasky character from You've Got Mail as just such an anti-technology luddite)?

Of course not, and that is not and has never been the argument I'm making. Those who jump to such a conclusion are just being defensive, and thus, we have learned, must be wrong. No I'm not calling for editing in notepad, or making shoes like we made them 150 years ago.

Instead I'd wager that you'd find the average professional writer, dedicated to the craft of putting words to print, has dramatically less dependency on such accoutrements than "beginners and hacks": They have elevated their creations to the point where something as rudimentary as spelling no longer represents a significant part of their "problem". They compose their creations so carefully that they're less likely to have such errors in the first place: When every line is a conscientious, careful, considered work of art, it's less likely that a typo-detection utility is as important.

For a blowhard blogger like me, vomiting paragraphs of raw thought into an editor, this sort of handholding is much more important, and the use of spell-checking actually speaks directly to my point. Writing is not my craft, and these literary creations aren't craftsmanship. I've even been known to mix up it's and its on occasion, to the delight of my critics.

This brings us to the crux of the whole "debate": It was never about the advanced functionality of tools, or even the use of said features or whether they "annoy" me or not, but instead I'm speaking to a growing trend of laziness and carelessness in coding, where developers emit screens of code (probably gloating about their remarkable LOC achievements), and after spending as much time fixing up the many automatically detected errors they spend weeks trying to diagnose the much more insidious logic, design and usage errors that almost certainly permeate their creation.

If their work is so carelessly authored that they consider continuous automated correctness checks a heavily leaned upon, necessary feature of their environment, then I wouldn't put much stock in the quality otherwise.

That is the problem that I argued against, simply stating that when you feel naked and abandoned without these assistants, finding yourself automatically doing frequent compilations to catch egregious mistakes, then you've probably lost touch of the craft, and one's work isn't getting the loving attention it deserves.

Thursday, July 05 2007

yafla has moved to some new, dedicated hardware, opening up some tremendous possibilities.

Some very exciting changes are afoot!

Monday, July 16 2007

Cueing Up An Ad

"Come here and see this cool PBS promo that was just on!" I call to my wife, tapping pause on the PVR's remote. Given my history of calling her in for replays that weren't as hilarious or amazing as I originally imagined them to be, I knew this had to be a slick presentation if I wanted to impress with my PVR-fu.

As she enters the room the PVR finally reacts to my command, pausing, but then immediately playing again: Once again I've been caught out hitting the button twice, assuming that the first request got lost in the ether -- as often happens -- when it didn't seem to respond in a timely manner.

I hit pause again and this time it immediately reacts, coming to a halt.

"I just have to cue it up," I say, buying some time.

I tap rewind. Nothing happens. Come on, I think, I've got an impatient audience here! I tap it again, and the box launches into double speed rewind as I race for the play button. It plays on demand, but now it's several minutes before the desired start point.

Repeat.

Unpredictably high user interface latency strikes again. While this Motorola PVR is an exceptionally bad culprit for random non-responsiveness, it's hardly the only example of this seemingly growing trend.

User Interface Lag

My Moto Q smart phone is a great little device that I really enjoy, but the user interface responsiveness is enormously uneven, frequently lagging several seconds behind commands. Whether waiting for it to complete an application switch, or even during basic interactions such as entering a URL in the address bar of Pocket Internet Explorer, it's often out to lunch.

Presumably the questionable multitasking of Windows Mobile completely blocks the user-interface thread when it decides to chatter with a cell tower. Nothing else can explain its behaviour.

On startup my DVD player apparently needs to initialize its own little operating system, and if there's a disc in the drive it automatically demands that it determine the contents before it will eject. It insists that it be able to put "DVD" on the front-panel before any other activity occurs, achieving silicon self-satisfaction that it accurately determined the media type.

A common scenario has us getting ready to leave the house, preschool children bubbling with energy, when we realize that we have a disc that we should return to the movie store.

Turn on the entertainment unit. Wait for DVD to pre-power initialize. Hit eject on the front panel (which automatically turns the unit on). Wait as DVD player initializes and then unnecessarily spins up the disc in the drive to read the disc type and root menu.

Finally it ejects.

It isn't just household devices that show this worrisome trend. The bank recently "upgraded" their ATM machines, bringing a colourful, graphical façade to what was once an glowing-green, ASCII, very serious interface. What once was a quick navigation through the menus now sees the painful redrawing of screens and laggardly keystroke responses.

Seconds Add Up To Minutes Add Up To Hours Add Up To...

It might only be 10 seconds or so from beginning of DVD eject procedure to the actual ejecting of said optical disc, but that's approximately 9.75 seconds more than it needs to be.

When time is short, even small delays like this can be incredibly irritating.

Despite the increasing computational capacity of our devices, the problem seems to be getting worse. User interface responsiveness seems to lie low on the list of priorities in many contemporary electronic devices.

These devices seem to be growing slower and slower, yet the processors that power them are getting dramatically more powerful.

A Supercomputer in Your Hands

Slashdot recently had a story linking to some reviews of a new Windows Mobile 6 smartphone. Several of the comments provided variations of the argument that the primary weakness noted in the review -- poor performance -- was the result of "underpowered" hardware.

Throw some more hardware at it and everything would be okay, the argument goes.

Consider that for a moment: is hardware really the problem? My Moto Q -- a device that often demonstrates terrible responsiveness (I'm not trying to pick on Motorola -- I've noticed the same behaviour with Nokia and Audiovox phones) -- is powered by an Intel XScale PXA272 processor running at 312Mhz. It comes with 64MB of RAM, 128MB of flash memory, and I've supplemented it with 1GB of miniSD flash storage.

Is that an insufficient bit of hardware to manage the awesome tasks of a smartphone with a 320x240 screen?

As a point of historic comparison, in the late 80s I was a proud owner of an Atari 520ST. It was a multimedia powerhouse powered by an 8Mhz Motorola 68000.

Despite what now is a laughably anemic CPU, it seemed infinitely capable at the time: I used it to create complex reports for high school in a full featured desktop publishing app. I did hobbyist software development in a rich IDE on it. I wasted away countless hours trolling local BBS'. It even was a wonderful game platform, running richly challenging games with gusto (games far more advanced than what you often find running in J2ME on your cell phone).

Later I upgraded to the Atari 1040STE, still with the same 8Mhz 68000, but offering expansion capacity to bring it up to a colossal 4MB of memory. This was so much memory that I usually created a memory "disk" out of 3MB of it, and still never felt limited in the 1MB.

Seldom did my ST ever feel laggy or non-responsive -- it booted close to instantly from ROMs, and the simple UI was always extremely responsive. Demo programmers had it doing tricks that still impress me to this day. Later a UNIX-style OS was ported to it, including full pre-emptive multitasking.

So how does that relic of the past compare with something like the Moto Q? Comparing straight Mhz isn't a valid comparison (for instance the ST is a CISC processor, versus the RISC XScale), so I went searching and found some Dhrystone 1.1 benchmark numbers for both the XScale at 312Mhz and the 8Mhz 68000.

8Mhz 68000 (Atari ST) - ~1,603 Dhrystones / second

312Mhz XScale PXA272 - ~731,512 Dhrystones / second

On this benchmark the PXA272 in the tiny little smartphone on my belt (yeah, I'm a nerd) is equal to 456 Atari STs. Let's look at that in a bar graph in case it isn't clear enough.

8Mhz 68000 1,603 Dhrystones / second
312Mhz XScale PXA272 731,512 Dhrystones / second

Wow.

Memory wise the Moto Q has a virtually infinite amount of memory compared to my old Atari ST.

I'm not trying to pretend that the ST of old did what a PDA of today is doing: I remember first getting access to low resolution JPEGs on a local BBS (I was a teenager and they were swimsuit photos...pretty risqué at the time. This stuff was much tamer than an issue of Maxim magazine or an "Umbrella" video), having to go through the tedious process of first "decompressing" them to a TGA, waiting as the decompression processed for sometimes minutes, and then viewing the uncompressed image. There was no way it could realtime do something as complex as rendering a JPEG.

Yet considering this enormous increase in computational power, it does seem evident that many device developers aren't respecting the time of their users, and few users are calling out terrible interfaces for being unresponsive and disrespectful. Reviewers, in particular, seem blind to responsiveness when rating devices, presumably because the artificial environment of a review can't be compared to quickly trying to respond to an email while standing in an airport terminal just as the last boarding call is made.

The Basics of a User Interface

A user interface should be predictable and consistent -- it should always respond in a short, consistent amount of time (I would honestly feel that the PVR would be better if it always took 3 seconds to react to a command, versus now when it's anywhere between 0 and 5 seconds), always allowing the user to cancel operations that they're no longer interested in.

Responding to the user's input should always be job #1.

Wednesday, July 18 2007

I've written about energy conservation issues several times on this blog and in its precursor rants section. This is a topic that is pertinent to the economics of the hardware upon which we ply our trade.

I was advocating compact fluorescent lightbulbs six years ago, and have documented my family's power usage along with some of the steps we've taken to reduce it.

We turn off the (100% CF) lights when we don't need them, intelligently bank cooler outdoor air on summer nights to limit air conditioning, and we try to conscientiously reduce the energy we're using. When we buy electronics and appliances, the Energy Star rating tops our criteria list.

raspberries

This year we even marginally supplemented our food purchases with the produce of a humble home vegetable garden (doing our very small part to reduce the energy used to grow and transport it from elsewhere, not to mention that a small patch of once slow-growing grass now hosts fast-growing, carbon-trapping vegetables).

We are far from a great example of a carbon-neutral lifestyle, however. As I write this my wife and children are travelling in our fuel-guzzling, 5000lb 255hp minivan to a children's museum some two hundred kilometers away. We don't forsake modern conveniences like televisions and gaming systems, and of course I wouldn't go without my computers. We live in a suburban home, adding to suburban sprawl, and often commute long distances.

Compared to an urban dweller living in a tiny condo, commuting to work via the foot express, we're gluttonous power pigs. We're lazy environmentalists of convenience.

It's this pragmatism that has me questioning a lot of the enviro-nonsense that has become a religion as of late. Many, it seems, feel a perverse, corrupting need to polarize their position -- as has sadly become the norm in many areas of debate -- simplistically categorizing everything into absolute right or wrongs.

Often there are only grays.

The 10,000 mile Diet

Buying local, for instance, is a meme that has taken hold in enviro-circles. Simply ensuring that whatever plastic junk you're buying wasn't shipped overseas, and that your strawberries didn't come from California (or, if you're in California, that they didn't come from wherever else grows strawberries) and you're doing your part to save the Earth, the meme goes.

Is that true?

If one only considers final shipment, then local farmers have an obvious enviro-advantage. Yet that energy analysis seems simplistic: What if the alternative is grown on larger farms with a longer, more suitable growing season? What if the economy of scale of remote growers allows for increased automation and efficiency?

Is it really saving the environment if you're buying from small, labour- and energy-intensive farms where crops have to be coerced through the short growing season via considerable energy and chemical assistance? Where the ill-suited soil needs continuous supplementation?

I'm not providing answers -- I don't have the numbers -- but the energy that goes into making the foods that you eat and the products that you buy is much more complex than simply measuring the fuel that went into the boat or truck that it rode to your grocery store. Given the low cost of large plastic toys from China, for example, it's clear by simple economics that very little energy was necessary to ship it across the ocean (and that might reduce further as shipping companies look to save costs).

False Smugity

Automobiles are another area of the whole environment debate that seems to be much more complex than often perceived. Consider the media's coverage of Al Gore the IIIrd, son of Al Gore the IInd, getting caught speeding down a California freeway at 100mph in a Toyota Prius. Many of the news reports described the car as "environmentally friendly", and this has been a recurring description when describing hybrid vehicles.

The Prius is "environmentally friendly" only by the same confused logic that would deem a lit M-80 "hand friendly" relative to a stick of dynamite.

The Prius still requires roadways (and contributes to the clogging of the same) and parking lots and rubber tire factories and mines. The perceived moral righteousness of the Prius and its ilk might even exacerbate the problem of urban sprawl, making people feel almost heroic to commute 40km to work in their "environmentally friendly" hybrid car. Worse, it still requires copious amounts of energy to move its 3000lbs around -- not least of which is a giant array of batteries -- often with a smug driver as the lone occupant, contributing to the growing trend of smug pollution (as South Park hilariously characterized it).

The sort of absurd moralism about hybrid cars -- the kind that has the media declaring a 3000lb car "environmentally friendly", and the rich and powerful can gain environment credibility by being sighted in a hybrid (just ignore the numerous mansions and private jets...they were seen in a Prius!) -- is how you end up with absurdist theater like this.

The Prius is but one example (and I don't mean to pick on hybrid cars. All else remaining the same they're a definite improvement. Definitely better than the hilarious large older car I saw roaring down the highway yesterday, prominent "Boycott Gas!" sticker on the back). Many recent stories have praised absurdly high mileage vehicles, deep in the article noting that much of the vehicle's energy was supplied via an unmeasured draw from a household electric socket. That's akin to claiming that your 1984 Chevy Citation gets great mileage by going half of its kilometers slung on the back of a tow truck. That sort of energy-fraud is becoming far too common.

The Law of Unintended Consequences

Consider also how the so-called law of unintended consequences rears its head when you improve the operating costs (both economic and moral) of an activity: A driver of a fuel-guzzling SUV is likely more apprehensive about long drives, knowing how the exorbitant fuel costs will punish their wallet. Reduce the moral and economic costs, however, by replacing their vehicle with a more efficient model, and suddenly longer commutes and family drives become acceptable again, completely negating any energy savings.

Here in Ontario the power grid's supply barely exceeds normal consumption: Decades of Not-In-My-Backyardism and cost cutting has the province importing power during peak loads. To reduce demand, reducing imports and staving off the building of expensive new power plants, the province has been offering rebates on energy star appliances, and direct rebates on things like LED Christmas lights. The latter makes for an interesting study: I suspect the super-efficient LED lights have many consumers bulking their Christmas display up with more lights, and then leaving them on longer. That is the rough conclusion of some small studies done on behalf of the utility, coming to the conclusion that the programs did nothing to reduce consumption. But it did help make for a more colourful Christmas display.

I don't pretend to know the answers, or to have all of the numbers to declare basic truths about energy consumption (other than "less overall is better than more overall"), but I do know enough to know that it's much more complex than the superficial, naive analysis commonly repeated.

  Personal 
Wednesday, July 18 2007
Friday, July 20 2007

I'm going through the process of upgrading some Infragistics NetAdvantage 2007 v1 components to 2007 v2, one step in the upgrade process being the uninstallation of v1. The uninstaller has now been running for some 65 minutes, saturating both the hard drive and the CPU during the entirety of that time.

What possible explanation is there for this? Remove some registrations, delete some files and directories. Done. Where's the big complexity?

"But it's doing complex things!" a friend of MSIEXEC might retort (this is hardly the first time I've encountered outrageous installer times). Like what? Calculating the next Mersenne Prime?

In the time that it has run it could read and written my entire hard-drive several times over, and from a computational perspective it has now processed trillions of CPU operations. Trillions.

Given the basic metrics, there is simply no rational explanation beyond absolutely mind-boggling inefficiency. Par for the course, unfortunately.

Monday, August 13 2007

Stuck in traffic a few days back, my idle mind wandered to the technical feasibility of pervasive, real-time traffic flow monitoring, and how this information could be communicated and utilized.

Such perfect, real-time information could help to redistribute the roadway load for the benefit of all (or, more realistically, let the suckers boil in the midday sun while the information insiders zip around congestion points), reducing transit times and energy use, and perhaps providing emergency services with optimized transport mapping, improving their efficacy.

Something had to be better than the sparse, time-lagged reporting of the radio station, or blindly rolling down an onramp, curious why a string of cars were dangerously reversing up the shoulder, to find the entire highway at a standstill, as I had that Friday afternoon.

There are quite a few implementation options apparent to a traffic layman like myself: Cameras with AI counting cars and estimating their speed. Underground (or overhead) magnetic sensors, or underground weight sensors. Laser relays for single lane roads.

The basic problem with such solutions, however, is that they tend to be expensive to install and maintain, and from that they tend to be infrequently deployed, at best spaced at distances that greatly reduce their utility (e.g. "between highway marker 70 and 112 there is some sort of disturbance"). Add to that the communications network required to relay these telemetrics.

Having worked in the telemetrics/remote monitoring industry before (in the late-90s), I was contemplating how cellular data technologies were just become feasible for such remote monitoring communications when the thought occurred to me: Most every cell phone now is constantly communicating digitally with its base station. Further, every cell phone can be either triangulated to a location, or more recently knows its precise position with the use of GPS. A tremendous percentage of cars on the road have at least one cell phone in them, the phone company (or anyone listening in on the conversation) capable of tracking location and speed, easily overlaying that over a mapping system to determine roadway flow.

Imagine an entire roadway system that overlaid the millions of cell phones moving around, easily visualization slow downs and congestion. It would be similar to the medical procedure where they inject radioactive particles into a patient's blood system, determining flow throughout the body by measuring their movement.

It turns out that I'm not the first to think of this. A quick Google search upon getting home made it apparent that there are several commercial products that do something similar. Nonetheless I thought it a fascinating example of passive data collection, deriving secondary advantages out of widely deployed technologies like cell phones.

  Personal 

Earlier EntriesLater Entries

Dennis Forbes - Dennis Forbes is a Toronto-based software architect and technology writer