The Clean Code Blog

by Robert C. Martin (Uncle Bob)

The Careless Ones

24 October 2013

Two days ago my wife placed an on-line order at Walmart for a metal-frame bunk bed for our grandchildren to sleep on when they stay over at our house. Yesterday it arrived. Wow! One day delivery to my front door. Someone cared.

The metal-frame parts for the bunk bed came in a box that was, perhaps, 4ft X 18in X 6in, or 3 cu ft. It weight about 100 lbs. I looked at this carton with a growing sense of despair, knowing that the next several hours of my life would be in the hell of unpacking and assembly. I’ve been in that hell before. I had no desire to return to it. But I love my grand children and I wanted them to have a nice place to sleep. So…

I set my jaw and opened that box.

Have you ever seen the movie “Pulp Fiction”? Do you remember the briefcase? The golden glow? Well, it wasn’t quite like that; but it was close. The innards of that box were packed – perfectly. I had expected chaos. I had expected peanuts! (No! NO! Not PEANUTS!…. Run Away!….) Instead, I found a perfect rectangular prism of parts and well formed packing material.

The packing material was not that horrible, nails-on-chalkboard, land-fill-fodder, phosgene generating styrofoam. No, this packing material was blocks of thick corrugated cardboard. Tough. Recyclable. Form Fitting. Cardboard. And these cardboard blocks were perfectly shaped to fill any empty space in that carton.

It was a masterpiece of packing. I stood in awe of it. From the moment I opened that box, it was clear to me that someone cared.

What’s more, as I gradually took the pieces out of the box I found that each piece was nicely wrapped in clear plastic, with little cardboard end caps for those pieces with sharp or oddly shaped ends. The parts were laid in the box in an orderly fashion that was very easy to understand. Removing the parts was trivial, and did not result in any clanging or banging or bumping. It just all came apart with a trivial amount of effort.

To the packaging engineers at Dorel: Nicely Done! It was clear to me that you guys cared about that packaging. You thought about it. You must have tried many different combinations before you settled on the final strategy. I want you to know I appreciate that.

You know how most kits come with a bag of parts? This bag is usually filled with screws, washers, nuts, bushings, etc. It often looks like some dufus in the warehouse reached into several dozen bins, grabbed a handful (or a fingerful) from each without bothering to count, dumped them into the bag, taped the bag shut, and tossed it into the box. Well, get this: The parts for this bed were shrink-wrapped onto a cardboard backing, that labeled each part. I could tell, at a glance, what all the parts were, and that all the parts were there.

I won’t bore you with the story of the assembly of the bed. Suffice it to say that the bed went together with a minimum of issues. The instructions, if not perfect, were very good, and appropriately detailed. Overall, I think I made two assembly errors that I could blame on ambiguity in the instructions. Both of these errors were trivial to fix.

In short, I left that project feeling like I had been supported by a team of engineers who had thought about, and cared about, how to make the job of assembling that bed as easy as possible. Again, Dorel, Nice work!

And what about Walmart and Fedex? They fulfilled, shipped, and delivered that order in less than 24 hours. Nice going guys! Thanks for caring!

I upgraded to OSX 10.9 this morning. I sat down at my desk, ready to begin the day. My plan was to write this article. I’ve been thinking about it for several days. But up on my screen was the announcement of “OSX Mavericks” with a friendly button that said “Install Now”.

I should have known. I should have known. But it was early, and I was sipping my coffee, and… Well… I hit that button.

The download began, and that was no big deal. The download was several gigabytes, so I expected it would take a few minutes. So, in the mean time I decided to create an account on

I had heard that was having some trouble. But, since Mavericks was downloading, I figured I’d give it a try. After all, maybe I could find a better health insurance deal there.

The experience began well. The first few pages were nicely designed, and easy to read. They were informational and cheery. Then it asked me for my state, and I selected Illinois. The site came back right away with some more useful information about Illinois applications, and then presented me with a big friendly button that said: “Apply Now”. I hit that button and then…

Well, the little spinner spun. And spun. And spun. So I checked on the OSX download. It was done and ready to install, but I didn’t want to interrupt my application at, so I decided to read some email and twitter and… came back in a few minutes with a traditional account creation page. It wanted a user name and password. I could rant about the idiocy of websites that force you to put numbers and punctuation in your user names and password. I could. I could rant about that. Oh, yes, I could. But I won’t. No. No I won’t.

The Hell I Won’t!

Dear website creators. Upper and lower case, numbers and punctuation, DO NOT INCREASE SECURITY. What number do people use? They use the number 1. What punctuation do they use? They use a period. Where do they put the number? At the end. Where do they put the period? At the end. What do they capitalize? Words! Do you really think theres a big difference between “unclebobmartin” and “UncleBobMartin1.” Actually, there is! The difference is in my frustration level with your stupid website.

Anyway… I filled out the form with my appropriately numbered, punctuated, and capitalized user name, and my appropriately numbered, punctuated, and capitalized password. And then clicked the “Create Account” button.

I was quickly rewarded with another page that asked me for security questions. You know the kind. What is your mothers maiden name? What is your eldest sibling’s height? How many times have you been arrested in Nevada? That kind of thing.

I chose three questions that were easy for me to answer. One of them was: “A personally significant date”. That was easy. I was married on July 21, 1973. So I entered 7/21/73.

A little red sentence appeared beneath my cursor. It said: That entry is invalid!. My mistake was immediately evident. We don’t use two digit years anymore, do we? Not since Y2K. Oh no. Now we use 4 digit dates. And we will, I suppose, until Y10K. So I entered: 7/21/1973. But, again, I got the little warning: That entry is invalid!

Hmmm. What could be wrong? Given that I am a programmer, I started thinking like a programmer. Perhaps the programmer was matching a regular expression like: \d{2}/\d{2}/\d{4}. So I tried: 07/21/1973. No dice. So I tried a number of other variations. No cigar. I spent 10 minutes or so trying to figure out what the demented programmer who wrote this code was expecting me to enter.

And then it occurred to me. The programmer did not write the questions! Some bureaucrat wrote the questions. The programmer never talked to that bureaucrat. The programmer never read the questions that the bureaucrat wrote. The programmer was simply told to display a set of questions from a database table, and to store the responses in the user’s account. The programmer had no idea that this particular question was asking for a date! So the programmer was not trying to match a date! The programmer was just accepting any string.

Well, not any string. After all, I had been typing strings for the last ten minutes. No, someone had told the programmer (or the programmer simply decided on his own) that certain characters would not be appropriate in the answers to the questions. One of those inappropriate characters was probably: "/". I think numbers must also have been considered to be inappropriate since I had tried: 17 July, 1973. Or perhaps it was the comma. Who knows? Who cares? (Apparently not the bureaucrat, the programmers, or the people who tested this system.)

So I typed: My Wedding Day. And all was well!

I was quickly sent to a new page that told me my account had been created and that an email was being sent to me to confirm that I was who I said I was. I expected this. It’s gotten to be pretty normal step nowadays.

So I went to my inbox, and there was the letter. And the letter had the expected confirmation link. So I clicked on that link, and my browser reacted immediately with a new tab on the site.

“Wow!” I thought. That was pretty fast. Then I read the notice on the page in that new tab. It said: OOPS, you didn't check your email in time. Uhhh. Huh? I clicked on the link within 10 seconds of the email’s arrival. Was I supposed to be faster than that? Should I have been poised with my finger on the mouse button just waiting for that email to show up so I could click it faster than lightning?

But then I noticed that the page also told me that If I had already confirmed my account, I could just log in using another link. So I tried that link, but got nowhere with that either. In the end I concluded that my account had not been created, and that the entire process would have to be repeated. (Sigh). Someone didn’t care about my account. Perhaps lots of people didn’t care about my account. I wonder why?

But then I looked over at the OSX installer and I thought, “Well, let’s get on with this.” So I clicked the install button. Up popped a warning box telling me that I needed to close all the other applications that were running. It gave me a button that would do that for me, and I dutifully clicked it.

One by one my applications melted away. Windows closed. Warning dialogs popped up requesting permission to close their respective applications, which I dutifully accepted. Click, click, click, down, down, down. Until there were just two left. The OSX installer window, and the Software Updater window that had told me about the new OSX version.

And that’s where the process stalled. When I clicked on the installer’s Continue button, it told me to close all the other applications. When I tried to close the only remaining application, the Updater, it told me it could not close until the current installation was complete.

This is a classic deadlock! Both processes were waiting for the other to complete. Neither could continue until the other finished. WHO TESTED THIS? WHO CARED ABOUT IT?

So, using my great powers as a software super hero, I managed to convince the Software Updater that it should close. And then the OSX installer took hold, restarted my computer, and entered that quasi-state, neither rebooted, nor halted, in which it does it’s installs. This is the state you don’t want to interrupt. Indeed, you can’t interrupt it without powering down – and powering down while it’s in the midst of rewriting your operating system is seldom advisable.

And that’s when it informed me that this process was going to take 34 minutes.

Note to Apple: Please have the courtesy to tell me, in advance, if something is going to take a long time. Don’t let me start an irreversible operation without letting me know that my computer will be out of commission for the better part of an hour?

So I went upstairs and took a shower. When I returned the install process was nearly complete; and I happily watched my computer reboot.

Up came the windows, one by one. Email. Calendar. Chrome. Finder. UP, up, up. What a nice sight. And so I began to do my daily work.

And while I was typing away, up comes the Calendar app – right on top of my current work. Calendar throws itself in front of me, grabs the keyboard focus while I am typing and then pops up a warning dialog: A new event has been added. Please choose the calendar for this event.

What event? You aren’t showing me the event. I can’t select a calendar unless I know what event you are talking about. What event it is? All I see is an entire month on my screen, a month full of events. Are any highlighted? No. Does the dialog name the event? No. What event it is? I can’t tell. Ugh.

So I choose a random calendar to get the annoying dialog off my screen. I go back to the article I am writing. I read the last paragraph I wrote in order to reengage the flow of my writing and…

Up comes the Calendar app, right on top of my article. It’s got another event to add. And, same as before, it doesn’t tell me what event it is? So, once again I click on a random calendar to make the ridiculous app go away. I focus again on my article, reading – again – that last paragraph. Up comes the calendar app, right on top of what I am reading. It’s got another event to add.

WTF? OK, I guess this upgrade of the OS is going to walk through all old events and add them all over again. Indeed, as I am reasoning this out, several dozen more warning boxes pop up telling me of new events, and demanding I assign a calendar.

So now, for the next twenty minutes, I am a slave to the calendar app, as it requires calendars that I have no context to supply. I simply hit the buttons by rote, assigning the unspecified events to whatever calendar is on top, hoping (against hope) that this does not destroy my carefully constructed calendar.

Of course the Calendar finally settled down – though I expect it will rudely inject itself any time a new event is added by my assistant, or my wife, or… And, as far as I can tell, no damage was done to the events that were in my calendar, so the reasons for that furious storm of warning dialogs remains a complete mystery.

So just what is the moral of this Halloween Horror Story? The moral is that some people care, and some don’t. Walmart cared about my bunk bed order. Fedex cared about delivering that bunk bed promptly. Dorel cared about packaging that bunk bed, and about guiding me to assemble it, and about it’s overall structure and integrity.

Because these people cared, my grandchildren will have a place to sleep at my home. did not care about my account, did not care about the answers to the security questions, did not care about response times. And, in the end, did not care about providing me with healthcare insurance.

Apple did not care about the deadly embrace between the Updater and the Installer, did not care to inform me about the installation time, did not care about the rudeness of it’s Calendar application.

What did and Apple care about? Schedule. Not me. Not my needs. They cared about their schedule.

I didnt’ need a new OSX update today. It could have waited for a week, or two, or ten.

I do need health insurance. But cared more about their schedule than about being the place where I buy my health insurance.

I find it sad that the careless people in this story are so obviously software people. Perhaps that’s not fair since the Walmart website worked perfectly. Still, the carelessness was all on the software side.

Is that who we are? Is that how we want our industry to be viewed. Are we: The Careless Ones?

Now perhaps you think I’m being too critical. After all is new, and OSX10.9 is new. Shouldn’t we cut them some slack because of their newness? I mean, they’ll get the problems ironed out eventually. So, shouldn’t I just lighten up?

They don’t have to iron out their problems on my back, thank you very much. If they cared, they could have prevented the trouble they caused me. They didn’t care. They released software that they knew did not work properly and had not been tested enough. Nobody at tested that damned date question, or if they did, they didn’t care. The people at Apple had to know about the incredible rudeness of their calendar app; but they didn’t care. They cared about their schedule not about me.

And that leads me to my question. What kind of organization do you want to be associated with? One that cares? Or one that is careless. And if you aren’t in the right kind of organization, what are you going to do about it?