Stories about Software


Career Advancement for the Low Price of Your Soul

When I was a kid, I remember my little brother watching Disney films pretty much constantly from the ages of probably 1 to 6 or so. As a result, I have an embarrassingly encyclopedic memory of the plots and songs of the movies from that specific time window. Probably at the epicenter of this Disney knowledge for me was the film, “The Little Mermaid” and I can remember that crazed chef chasing Sebastian the crab around and still giggle to this day. But of all of the songs in that movie, there’s only one that makes me think of the corporate world. I’ll come back to that.

Claw Back, Disney Style

There are a few standard perks in corporate America (and, I’m sure the world, though I’m only familiar with hiring in the USA). Health insurance is pretty much table stakes for serious employment these days, and with a decent employer contribution to boot. Paid time off is certainly up there, along with holidays and general human decency, one would hope.  There’s another tier that includes 401K contributions or some other retirement provision, perhaps a pension of some kind, things like life and disability insurance, and so on.  And, then, you start getting into a land more exotic where employers offer weird, unexpected stuff like “take your dog to work day” or sabbaticals or something.  One that usually shows up in this slightly more exotic realm is some concept of tuition reimbursement for employees that seek degrees or want to acquire skills through classes, certifications, etc.

This perk is a classic win-win situation.  The company invests in the career development of an employee and, in exchange, reaps the benefit of the employee’s learning and added skills.  The employee becomes more valuable to the organization by virtue of new knowledge and skills and, all other things being equal, will wind up earning more money over the course of a career.  What could be better than this arrangement?  Employees donate their spare time to improving themselves for their companies and companies donate money to the cause.  Sounds like a pretty good exchange of consideration.

And the company, really, just wants to help.  Advancing one’s skill set and education isn’t cheap, and there are so, so many poor unfortunates that just can’t afford it.  You know what?  I’ll let Ursula from the aforementioned Little Mermaid explain.

Poor unfortunate souls,
In pain, in need!
This one longing for more skills
That one wants a new degree
And do I help them?
Yes, indeed!


Read More


Improving Your Craft with Static Analysis

These days, I make part of my living doing what’s called “software craftsmanship coaching.”  Loosely described, this means that I spend time with teams, helping them develop and sustain ways to write cleaner code.  It involves introduction to things like the SOLID Principles, design patterns, DRY code, pair programming, and, of course, automated testing and test driven development (TDD).  I’ve spent a lot of time contemplating these subjects and their economic value to organizations, even up to the point of creating a course for Pluralsight.com about this very thing.  And through this contemplation, I’ve come to realize that TDD is an extraordinarily nuanced practice, both in terms of advantages offered and challenges presented.

This post is not about TDD, so what I’d like to do is zoom in on one particular benefit offered by the practice.  It’s a benefit that tends to be overlooked beside the regression suite that it generates and the loosely coupled design that it encourages.  But one of the important things that TDD does is to provide a very tight, automated feedback loop.  Consider what generally happens if you’re working on a web application and you want to evaluate the effects of your most recent changes to the code base.  You build the code and then run it, and running it is generally accomplished by deploying it to some local version of a web server and then starting the web server.  Once the web server and your web application are running, you then engage the GUI and navigate to wherever it is that will trigger your code to be run.  Only at this point do you get feedback about what you’ve done.  TDD short-circuits this process by requiring only build and execution of a test suite.

Of course, TDD isn’t the only way to create a tight feedback loop, but it is a well recognized one.  And it’s also one that tends to spoil you.  After becoming used to TDD, it’s hard to go back to waiting for long cycle times between writing code and seeing the results.  In fact, it tends to go the other way and you find yourself chasing other means of obtaining fast, automated feedback.  It was this exact dynamic that got me hooked on the idea of static code analysis.  If I could get quick feedback from unit tests about whether my code worked, why couldn’t I get feedback about whether it was well written?

Read More


A Rider to the Law of Demeter

In case you were wondering who is responsible for the bounty provided by harvests each year, the answer is the goddess Demeter. In the age of global transport, harvests have stabilized somewhat, but that wasn’t always the case. There was a time when Hades, the God of the Underworld, captured Demeter’s daughter, Persephone, and held her prisoner. A desperate Demeter responded to this calamity as any parent would, by quitting her job and committing herself to a rescue effort. Trouble for the world was that Demeter being absent at her post led to widespread famine, prompting Zeus to intervene and some sort of compromise to be reached. And so, it stands to reason that a principle of software development discouraging the use of statements like Hotel.Rooms[123].Bathroom.Sink was named for her.

Read More


ChessTDD 36: Acceptance Tests for Queen Movement

This episode went smoothly until I discovered a bug.  Philosophically, I suppose this is the natural state of software development.  For my purposes here, though, hunting down the bug caused the episode to balloon to 26 minutes, so I’m going to try a new thing so as to keep the videos a reasonable length of time.  I’m splitting it into 2 videos: parts A and B.  Please let me know if this approach is preferable to sometimes having long videos or not; if you leave feedback, I’ll more likely do it the way you prefer, since I’m just trying to go with what people like.

What I accomplish in these clips:

  • Created a couple of code snippets in CodeRush to get rid of the hand typing in the specflow scenarios.
  • Wrote acceptance tests for the queen’s movement.
  • Squashed a subtle bug (or at least half of one).

Here are some lessons to take away:

  • Projects go better when there are more eyeballs on them.  Run things you’re doing by other people and see if they have suggestions that might help.  They may think of things that never would have occurred to you and might later seem obvious.
  • Whenever you make mistakes copying and pasting, it’s a crapshoot whether fixing them takes more time than you would have spent hand-typing or not.  In my experience, most of the time you don’t come out on the winning end, and wholesale copy-paste obscures your understanding.  This is why I try to avoid the practice.
  • What I find is that unit tests should be very directed and specific about system behaviors.  But acceptance tests let you put on your exploratory testing hat, dreaming up scenarios in which users might use this thing that could potentially break it.  For you unit testing newbies, fight the urge to write unit tests with lots of assertions that cover a lot of ground.  You can express that in your acceptance tests.
  • Once again, don’t do low-hanging fruit refactorings (e.g. deleting dead code) when you have red tests.  It might seem like it’s not a problem, but it will come back to haunt you at some point.
  • Another example in this episode of finding a bug with a failing acceptance test, and drilling in to get closer by writing failing unit tests.  This is an excellent and helpful practice.
  • TDD facilitates Eureka moments where you try something you think might work and you see all of your tests go green.  However, just like trying something in your code and seeing the application magically behave correctly next time you run it, it’s important to cement your understanding of why it worked.  Don’t program by coincidence, even if you have a green test suite backing you.  Keep writing tests and/or reasoning about the code until you’re sure you understand what’s happening.  (Writing tests provides an excellent way to prove your understanding to yourself).


Are Your Meetings Worth Attending?

“Remember, kids, your projects are due a week from Monday, so you’d better get started if you haven’t already.”

This imminently relatable phrase, or one like it, is probably the first exposure to nagging that most of us had outside of the home. Oh sure, Mom and Dad had nagged us for years to clean our rooms, say please and thank you, and wear jackets. But our teachers introduced us to business nagging. I’m using the term “business nagging” to characterize the general practice of nudging people to do things for common professional effort.


If you fast forward to your adult life, business nagging morphs into things like, “don’t forget to sign off on your hours in payroll,” and, “everyone must update their email signatures to use the company’s official font by next week.” The subject matter becomes more adult in nature, but the tone and implications do not. When you hear these phrases, you’re transported back in time to junior high, when you needed to rely on a teacher to help prevent your general incompetence at life from creating unfavorable situations for yourself.

There’s a subtle problem with business nagging growing up alongside of us. As children, we actually are pretty incompetent at looking out for own interests. Left to our own devices, we’ll procrastinate on the school project and then pull an all-nighter ahead of turning in something that earns us a C minus. But as we grow to adulthood, we learn these lessons firsthand and wind up being generally decent at looking out for ourselves. We tend not to need nagging nearly as often to do things that will benefit us, so being nagged to do things that will benefit us winds up becoming largely superfluous.

And that leaves the most common form of business nagging: being nagged to do things that offer no obvious benefit to the recipient of the nagging. Signing off on your hours in payroll doesn’t benefit you directly (except, perhaps, by removing the artificial threat not to compensate you for the work you’ve done). Changing your email signature doesn’t benefit you directly. According to someone with some degree of power somewhere in the organization, you doing these things will benefit the company. Presumably, if the company benefits, so do you, somehow. But there is as much vagueness in that equation as there are “somes” in the previous sentence. From where you’re sitting, it’s just bureaucratic procedure having only one tangible benefit—getting the administrator of the business nagging to go away and leave you alone.

This was a post I originally wrote for Infragistics. Click here to read the rest.


ChessTDD 35: Acceptance Tests for Knight Movement

Things are really starting to flow with the acceptance tests now. In this episode, not only did I mercifully not uncover any important bugs, but I defined knight movement in acceptance tests in a way that I feel pretty good about. I’m learning as I go about using SpecFlow, which is cool, and as the cherry on the sundae, I actually got episode length back under control with a 17 minute episode.


What I accomplish in this clip:

  • Fixed the poor naming I left off with last time.
  • Wrote acceptance tests for the knight’s movement.

Here are some lessons to take away:

  • Naming is so, so, so important.  It may seem like a trivial thing, but leaving a method about chess piece movement where “origin” and “destination” were reversed would, sooner or later, cause someone a serious headache.  It would also probably make them hate me when they looked at the history.  Make sure your names are good.
  • You have to do a fair bit of fumbling when you’re figuring out a new tool/tech/framework on the fly.  Stick to your principles and be sensitive to the idea that there’s probably a better way to do a lot of the things that you’re trying to do.  Ask people, and read a lot if you can.
  • There’s a lot of out of the box stuff that comes when I make a SpecFlow feature, but I just get rid of it.  For me, it’s helpful to eliminate everything that I’m not using so as not to be confused about what’s mandatory and what isn’t and also not to be confused later about what functionality I’m even using.
  • An interesting tradeoff emerges in my use of SpecFlow.  Duplication is, by and large, pretty bad in a code base.  But, in the case of visualization, showing the chess board for each individual acceptance test may be helpful in that it makes it crystal clear what’s going on in each test.  There are probably various strategies to try optimizing for minimized duplication and maximized visualization simultaneously, but it’s worth bearing in mind that everything in software development is a matter of tradeoffs and it’s best to be deliberate about whatever choice you make.


Low Cost Legacy Help

If I think back a number of years, I can remember sitting in a software shop and feeling like the iconic stranger in a strange land.  I valued writing clean code, practicing TDD, refactoring away from procedural, legacy cruft, and generally improving my craft.  This was not otherwise common.  There were architects in that place that were long on seniority and opinions but short on chops, and they really, really liked them some global state.  And class size?  The bigger the better.

I seriously felt like I was in some kind of weird, parallel reality.  We’d have lunch & learns and watch things like Uncle Bob videos or talks from Channel 9 or whatever, and I would leave thinking that some kind of brainwashing A/B trick had resulted in me watching a different video from everyone else.  It was discouraging.  

I made progress in fits and starts.  I’d refactor a method here, kill a singleton there, inject an interface here, delete some dead code there.  But, then I’d go for a long weekend trip and come back to find a new singleton with more global state than its recently deceased cousin.  It was two steps forward and one step backward on a good week.  Like wading upstream against a raging, waist-high river, it was slow, exhausting progress.

I remember thinking that it’d be great if I could plead with one of the speakers in the video to come in and talk to people in this shop.  Maybe if one of the folks from the video was there, speaking live to them, something would finally get through.  Or maybe the video hero would take pity on me and offer me a job.  But I also knew that this was a pipe dream because hiring a consultant like this would be wildly expensive.

A lot of years have passed since then, and my life has evolved considerably.  I make most of my living doing coaching and helping improve software development craft.  Other parts of my living come from making videos and writing books about the same.  And through it all, I’ve never forgotten that feeling — a feeling with which, I’d imagine, many reading are familiar.

I’ve recently piloted with great success a new coaching model.  Think of the Chess TDD series, but imagine that instead of building a (non-trivial) toy application, I was doing a codecast in which I refactored some nasty legacy method in your code base to make it testable and narrated over it, explaining what I was doing and why.  The beauty of this approach is that we can pick some problems that are representative of your code base, and you can refer to the videos for context when doing refactorings from then forward.

This has proven to be a good option for small shops because it’s low touch.  It doesn’t require much if any synchrony, and, perhaps more importantly, it doesn’t require flights, hotels, a multi-day engagement fee with opportunity cost, or advanced schedule clearing.  It’s really just a matter of billable hours, which winds up being something like three hours per hour of video footage.  And five-ten hours of video footage is a surprisingly large, helpful amount.

Think of it this way.  It’s like someone recording a Pluralsight course wherein they refactor your code.  So if you’re reading this, and you think your code base and/or team could use a kick in the pants, feel free to reach out, even if it seems like a long shot.  There’s no charge for us to talk and even for me to sign an NDA and take a look at your code.  You can tell your boss or whomever that I really just kind of jump into problem solving mode and only start to think about billing arrangements once I’m convinced that I can contribute meaningful value to you.

Because, honestly, it’s also a lot of fun.  :)


Appeasers, Crusaders, and Why Meetings Usually Suck

I think this is about to get weird, but bear with me, if you’re so inclined.  This is going to be another one of those posts in which I try to explain myself by way of a vague apology for my abnormality.  But maybe if enough of you are similarly abnormal, it’ll gain a little steam.  I’d like to talk today about my odd, intuitive approach to disagreements over the rightness of opinions or beliefs. (For epistemological purposes, consider anything that you’d think of as a “fact” to fall into the belief category.)

So, let’s say that Alice and Bob are sitting on a bench, and Alice proclaims that blue is the best color.  Bob might agree that Alice is right.  He might disagree with her on the basis that red is actually the best color, or he might disagree with her on the basis that this is a purely subjective consideration, so the idea of a “best” color is absurd.  In short, Bob thinks that Alice is wrong.

Perception of rightness affects different people differently, it appears to me.  There are a lot of people out there for whom rightness is extremely important, and the idea that someone might be wrong and not corrected offends them deeply (as shown here, ably, by xkcd).  I am not one of those people.  I might be baited into the occasional back and forth online (or in any asynchronous form) when someone directly accuses me of wrongness, but that’s pretty much it.  I almost never seek out people to correct general wrongness, and I certainly don’t do it in person — with the exception of very close friends and family, and only then in casual conversation.  By and large, other people being wrong about things doesn’t matter to me.  If I’m sitting in the bar, having a beer, and some drunk is yammering political opinions that get increasingly moronic with each boilermaker, I have an innate gift for quietly enjoying the free spectacle.

But there are situations that require cooperation, often professional ones.  Working with another person, there may be some debate or disagreement over the course of action that ought to be taken, and, in such cases, the moment happens when I’m convinced that someone is wrong, and they’re equally convinced that I’m wrong.  The first thing that I do is evaluate whether or not the wrongness negatively impacts me.  If not…meh, whatever. Read More


A New Kind of Blog

This comic from The Oatmeal is one of my favorite pieces of internet.  That’s true for a variety of reasons, but one of them is how he explains that it’s much easier to be told what to write than to be given the instructions, “write about whatever you want.”  He’s not alone in feeling this way.  Strangely, when it comes to writing, I find that restrictions on the content are oddly liberating.  And I have a hypothesis that this doesn’t only apply to Matthew Inman and me.  It probably applies to a lot of you as well.

This is one of the reasons that I think it’s so hard for new bloggers to get started.  You build up a bunch of momentum, picking a host, a platform, a theme, etc.  You procrastinate by doing these things, subconsciously terrified of the moment where you sit down, stretch, and say, “everything done — now to produce a little content!”  Because then the next thing to happen is a quick moment of anti-climatic dread as you realize you have no idea what to say.  Self doubt creeps in, and you start thinking things like, “what could I say that others haven’t already said better than I could?”  It’d almost be better if you had a time crunch and content restrictions/parameters.


Well, that’s exactly what I’m proposing. Read More


ChessTDD 34: Specflow for Pawn Movement

This episode featured a return to progress toward shippable features.  I refactored the first feature that I’d started to use the new, idiomatic Specflow approach.  This resulted in it making the most sense to have this be the feature for pawn movement and thus progress toward implementing the pawn’s movement as well as shaking out more bugs.

What I accomplish in this clip:

  • Refactored the old Specflow feature to look like the newer one.
  • Deleted a bunch of now-dead code and made the Specflow backing class a lot more concise.
  • Implemented HasMoved from the board perspective.
  • Fixed a bug in GetMovesFrom

Here are some lessons to take away:

  • I made a mistake in deleting dead code when I had a red test.  Part of the reason I got this wrong was that the IDE crashed and I sort of lost my place, but there’s a lesson here.  It’s easy to get distracted when you see dead/unused code (or something else similar) and go off on a tangent.  That’s fine, but be sure you’re green when you go off on tangents.
  • Thinking ahead about how they code you’re writing will be useful elsewhere is a double edged sword.  It’s good because it can lead to more efficiency and less future rework, but it’s also the first step along the path to gold-plating.  There’s no exact how-to I can offer for walking this line, but just being aware of it will help.
  • When things go wrong with acceptance tests, which are coarser-grained, integration tests, your next stop in figuring out the problem will generally be to move down the test pyramid and look for more details in your unit tests.  Unit tests are going to exercise the code in more granular fashion, so you should get good insights there.
  • I recommend favoring domain-specific, communicative exceptions coming out of your code rather than allowing boilerplate exceptions to be thrown to your callers.  If someone using your code gets an array index out of bounds exception or a null reference exception, they can’t be sure whether you screwed up in your code or whether they screwed up calling your code.  If you, instead, throw “BadBoardCoordinateException”, it’ll be very clear to callers of your method that you’ve anticipated what’s going on right now, and that they’re doing something wrong.
  • Deferred execution with Linq is really powerful and allows you to do some great things, but it also leads to subtle bugs.  I’ve written about this in the past, even.  Be careful and always remember to make sure you’re aware of whether or not you’re enumerating the sequence when you run into stuff like this.

Acknowledgements | Contact | About | Social Media