Archive for the ‘Uncategorized’ Category

If It Has a Timer, It Needs a Pause Button

Saturday, February 28th, 2009

My electric toothbrush and the flashcard (jMemorize, very nice) program I am using to learn Spanish both have timers. The toothbrush has a builtin 2 minute timer with beeps every 30 seconds to switch quadrants. I knew 2 minutes suggestion for effective brushing and thought I was fairly close; turns out not to be the case. jMemorize has a selectable lesson size either by time or by number of cards. Two 17 minute sessions works better for me.

Both have a problem handling interruptions, e.g. the phone rings or my wife asks me a questions.  If you are creating a program or device with a timer, have a way to pause it.  Only hermits have the luxury or reality of no interruptions, for the rest of us, most things need to be interruptable.

System Monitoring = Real-time Regression Testing, AKA Continuous Integration

Thursday, February 5th, 2009

I’m noticing a convergence between the tools and widgets I’m using for system status monitoring and for software testing. There are red/yellow/green backgrounds for specific components, RDD strip charts to track status over time, hierarchies of sub-systems/components, etc. I wonder how much I can leverage the tools and expertise on one side to improve the other.

Manufacturing Applied to Software Development Makes Me Nervous

Monday, January 26th, 2009

There is a rash of recent software development methods (e.g. Lean, Kanban) that are based on manufacturing, usually Japanese.  Manufacturing is doing the known over and over, trying to squeeze the last nickel out of the recurring costs.  Software development is largely exploring the unknown.  There aren’t repeatable, consistent tasks.  Many of these methods strike me as attempts to replace expensive, talented individuals with cheap, generic labor.  And sacrificing long-term viability (and costs) for short-term gain.

There are consistent, repeatable parts of software development and where they exist they have been pushed into compilers, scripts, and code generators.  Valuable effort has gone and is going into squeezing another couple of percent performance out of the optimizer in compilers.  This is so successful that few projects generate assembler/machine code by hand any more.  The repeatable parts of well run projects are automated, compiler back-ends, scripts, automated builds, automated tests, etc.  Much more cost-effective than hiring poorly paid, poorly educated, unexperienced people.
Or not bothering with documentation, comments, and clean code because it doesn’t provide immediate “customer value”.

Less is More

Tuesday, September 2nd, 2008

I am preparing for a talk at the Lone Star Ruby Conference on Ruby and Rails on NetBeans, a IDE written in Java.  It’s only ten minutes long and so a bit of a squeeze.  With practice and dropping all the “You knows…” and such I can shorten it, but I still have a 20 minute talk.  Listening to a podcast last night by the Common Craft folk, I was reminded that it is more about what you leave out than what you leave in.  It was reinforced this morning by a video on the Guardian’s site on New Orleans and Hurricane Gustave.  There is no voice over, just the sound of the wind and pictures of trees, sofas, and people being pushed about by the wind.  The last third is President Bush boarding a plane.  Again no voice over, just the whine of an idling jet.  Powerful.

Linux Promoters Chasing the Wrong Angle

Thursday, August 14th, 2008

Two blog entries muse on what works in the marketplace and why Linux isn’t making huge inroads: Matt Asay on
The Linux desktop, Macs, and barking dogs and Seth Godin on The intangibles.  My experience agrees, cool sells, in spades.  Linux’s promoters, advocates, etc. are bucking a strong headwind in the anti-business and RTFM attitude.  Volunteers rarely have the time, patience, etc. to build an maintain the kind of relationship Seth talks about.  The cool Matt talks about may be easier to push, but Seth’s approach has the better payoff.

Programming, Process, & Feedback

Monday, June 2nd, 2008

The original waterfall model of programming process had no feedback loops, i.e. “complete and correct” requirements were handed off to the architects who produced a “complete and correct” system architecture, etc. It quickly became obvious that the various documents were seldom completely “complete and correct” so some rework was required. But the various process “gurus” still make pronouncements like “complete and correct” is still doable and try to pretend that the various feedback loops wouldn’t be necessary if you would just do the process right. It’s pretty obvious that that emperor has no clothes.

Most of the agile processes elevate feedback to a first class part of the process. On-site customer or stakeholder representatives give feedback, unit tests give feedback, if pair programming is used, programmers give each other feedback, etc. Feedback is no longer reluctantly allowed in to accommodate imperfect programmers but is encouraged, built into the process, and pushed to as early as possible. Testing can begin as soon as there is executable code.

Nokia N810 – GPS

Wednesday, February 13th, 2008

The GPS receiver in the Nokia N810 isn’t very strong.  I have yet to get a position fix indoors or even in a car.  Outdoors it does acquire position fixes, but there is a fair amount of uncertainty/jitter.  Standing still my “position” wanders about.  It is good enough to figure out which block in a city your are on and even which end if it isn’t a tiny block.  The maps in the database are low resolution, i.e., line segments, not smooth curves.  The Points of Interest (POI) are sometimes out of date (e.g., restaurants that have closed).  Only roads are included, no footpaths, so not very useful for hiking with the included maps.  (Is there a source somewhere for the USGS topographic maps?)

Firebug

Thursday, December 27th, 2007

The last few months I’ve been writing a Web application in Ruby on Rails.  At first I used the view source function of the browser when things didn’t display like I expected.  But as I’ve used more AJAX, this doesn’t work, it displays the page as originally sent, not the current contents with the changes to various sections.

Firebug is an add-on for Firefox that makes debugging easy again.  Or at least easier.  It displays the page content hierarchy with collapse/expand buttons, shows the HTTP dialog with  the Web server, etc.  Very useful.  If you write Web apps, like looking at how a Web site does something, etc., Firebug is wonderful.

Take the Horn Out of Your Mouth

Saturday, December 22nd, 2007

A story, perhaps apocraphyal, quotes John Coltrane’s response to someone commenting on his overplaying, “I have so many ideas, I don’t know how to stop.” Miles Davis’ reply was, “Take the horn out of your mouth.”

Right now I have so many programming ideas tumbling out of my head that I am hard pressed to pay attention to driving, being with my wife after work, etc. Ruby on Rails helps because it is so fluid and as I learn how to work with it, I am so productive, I can implement ideas in a fraction of the time it would have taken in PHP or any other language for Web sites I’ve tried (it’s a short list).

Creativity is like any other muscle/skill, the more you exercise it, the stronger it gets. And the stronger anything is, the more it gets used. And wants to be used.

TDD vs. BDD, First Impressions

Tuesday, September 18th, 2007

Computer programming is always evolving. Several years ago I encountered automated unit testing (i.e, the many Junit, CXXunit, etc. frameworks). Having a good test suite covering your back is confidence building. I started using it on CPIA (a re-implementation of PIA, the Platform for Internet Applications, a Java Web app framework, in C) about half way through. Translating Java to C can be a bit tedious, but after building some patterns, habits, and tools, it becomes rather straightforward. However, bugs, especially memory management bugs, can persist for months. Since I started writing tests half-way through, they tended to be added top-down, i.e., written for the newest code with additional tests for the older, lower level code written as problems were encountered and fixed. The experience convinced me further of the value of a good test suite.

Since then I have progressed to writing the code, testing it by hand, and then writing automatic tests.

Test-Driven Development (TDD) turns the order around: write the tests, run them (failure expected), then write the minimum code necessary to pass the test. Then write more tests and repeat until done. It is a hard habit to develop, but I am beginning to see the value of writing the tests first. One reason is if it passes on the first try, then something’s wrong! Either one of your colleagues has already done the work, the test framework (or your understanding of it) is broken, or you aren’t testing what you think you are. (Quis custodiet ipsos custodes?, roughly, who guards the guardians?) If your tests always pass, your confidence that your back is covered may be rudely shattered.

Behavior Driven-Development (BDD) is sort of TDD with the push of “you should” replaced by the pull of “I expect the code to behave like this”.

To illustrate, in an application I am currently writing (TagFlow, coming to a RubyForge near you soon), in the list of tasks, the task description is shortened to just a single line.  In the task’s page, the full description is displayed. Recently when cleaning up code, I inadvertently shortened all descriptions in a misguided attempt clean up the API.  (The same template is used for both versions of task, I just missed that the description as well as the complete task object was passed to the template because the description may have been shortened by a higher-level template).

I fixed it, added some comments to explain the more complex API, and pondered whether to write some tests. It looked like they would be a pain to write and brittle.  Maybe more trouble than they are worth. I wasn’t likely to make that mistake again, was I?

However, from the BDD perspective, my course is clear. I should have an executable specification of how I expect the application to behave, even before coding it.  Focus on what first, then work on how.  So I am off to write a behavior specification using Rspec that indicates to a human reader the expected behavior and also tests for that behavior.