14

As practicing (as much as I can at least) "egoless programming", I'm focused on solving problems whoever wrote the code related (if that person don't make dangerous code) and I like to understand the problem fully to be sure to solve the source of this problem.

However, when someone point my code to show an error, I often try to remember what was my mindset while writing the defect code and I try to explain it to the guy pointing the error to make clear what was the error source (for example when some names are badly choosen, you might use them in a way they were not intended too and with apparent success...).

Now, I do this by reflex and most of my coworkers does understand this reflex. But I also worked in companies where coworkers were in a mentality of blaming the people that made the identified problems, with or without humour (for me it have the same not-sane effect anyway).

In this kind of environnement, explaining why you got to write wrong code makes others think that you're trying to build an excuse. I remarked that most non-technical people (or non domain-expert, not sure, it's only personal experience) also react exactly like that when you try to explain why you did something wrong.

So, when dealing with this kind of people/environnement, how do you manage to explain the real source of the error without looking like "making an excuse"? (and is it even worth trying to explain?)

gnat
  • 21,442
  • 29
  • 112
  • 288
Klaim
  • 14,832
  • 3
  • 49
  • 62
  • had this happening to me (on non-technical stuff) during an HR interview... not fun :/ – Matthieu M. Dec 16 '10 at 19:17
  • 1
    possible duplicate of [Getting non-programmers to understand the development process](http://programmers.stackexchange.com/questions/4/getting-non-programmers-to-understand-the-development-process) – durron597 Jul 09 '15 at 14:08

9 Answers9

12

These kinds of misunderstandings are common between pragmatists and idealists. The pragmatists just think, “something went wrong... who can we blame?” The idealists are already trying to figure out how to prevent that thing from going wrong ever again.

Ashton got into San Francisco in the afternoon. He took a SuperShuttle to Fisherman’s Wharf and, famished, went into a restaurant and ordered a big stack of pancakes.

That’s when the implications of abandoning his former life in Michigan really started to sink in. He had no job, no place to sleep, his car was gone, he owed $40,000 in student loans, and had exactly $173 in his wallet.

But goll-ee, they sure do have pretty waitresses in San Francisco, he thought, admiring the strawberry curls of the Molly Ringwald-lookalike standing by the front cash register. A little over five feet tall, maybe. Crazy freckles.

While Ashton stared at her from across the deserted restaurant, a couple of well dressed boys came in and started talking to her. Tourists, maybe, or students? Were there any schools around here? There must be schools in San Francisco. He couldn’t hear what they were saying, but it seemed a little bit more complicated than “can we have a table and buy some pancakes please.”

“Molly” got out her purse and rummaged around. She gave the kids some money. The conversation continued. She tried to make a phone call; nobody answers. Eventually she opened the cash register and counted out rather a lot of money, which she gave to them.

“That’s weird,” Ashton thought, but he paid the check, and went across the street to an Internet cafe to look for an apartment on Craigslist.

The first thing that hit him was that the prices for apartments were insane. Back in Michigan, he was paying $475 for a really nice one bedroom, but in San Francisco, things seemed to be triple that. Without a job, he wasn’t even sure if anyone would rent to him. While he was pondering this problem, he noticed the waitress from the pancake place come out, clearly distraught. She sat down at a bus stop and started crying.

Now, the old Ashton would never, never just go up to a random girl on the street, least of all one who was crying, but the magical spell of San Francisco somehow made him lose his inhibitions, so he bought two cups of peppermint tea, went to the bus stop, sat down next to her, and said, “I seem to have an extra cup of peppermint tea. Would you like it?”

The girl looked at him, perplexed, and then laughed a little bit.

“I’m sorry,” Ashton said. “I don’t usually do this. I saw you working in the IHOP, and then when I saw you out here.... Oh. I’m Ashton, by the way. With an N.”

“I’m Becca,” she said. “With an M.”

Ashton said, “The M is silent, I assume?” They laugh a little bit. Becca sniffs. Ashton finds a handkerchief in his coat pocket, a vestige of living in a really cold climate.

They start talking. It turns out Becca just got fired.

“That stupid old man. He wouldn’t listen to me! I took some money out of the register to bail out his own son, but he didn’t want to hear about it. He just assumed I stole it.”

“What?”

“Well, these kids came into the restaurant, they were schoolmates of Daryl, Mr. Dimitrious’s son.”

“That’s the owner?”

“Right. Anyway these kids seemed nice, they said that some drug dealers got pissed off at Daryl for some reason and they needed $200 to rescue him.”

“Rescue him from what? I don’t get it. How does that work?” Ashton asked. It didn’t sound like a real story. But maybe this was how things worked in California.

“I gave them $40 of my own, but they were very insistent that if they didn’t come up with $200, Daryl would be hurt. I couldn’t reach Mr. Dimitrious by phone, and I was scared, so I took $160 out of the register and gave it to them. But when I tried to explain that to him, he just flipped out and wouldn’t listen to me. I was trying to tell him that Daryl was in trouble, and all he wanted to talk about was that I was stealing from him. How could he fire me for trying to help his own son? What is wrong with that man?”

Ashton was pretty sure Becca had just gotten scammed, but he couldn’t quite bring himself to break it to her. And even though she was visibly upset, he was really enjoying talking to her, so he dragged the conversation on. He started blabbing about how, when he was working at the furniture company in Michigan, everyone had to take a course called “Five Whys.” The idea was that every time something went wrong, you had to ask why to get the immediate cause. Then you asked why again, to figure out what caused that, and you kept doing that, about five times, until you found the root problem.

“So, for example, you got fired. Why? Because money was missing from the cash register. Why? Because you gave it to some kids. Why? Because they told you Daryl was in trouble. Why?”

“Wait, why what?” Becca asked.

“Why did they tell you Daryl was in trouble?”

Becca thought for a minute.

“I got scammed, didn’t I.”

“I think maybe you did.”

Becca was silent for a really, really long time. Then she started laughing, and it infected Ashton, and they were both laughing like crazy, and it felt great, after a stressful day.

“You’re a total nerd,” she said. “Five whys.” He had to concur.

They were having a good time. They walked all over the North End, and they talked for hours. He told her about being a programmer, and the furniture company, and how, in two years, not a single thing he did at work mattered, and he was sick of it, and starting a new life, and here he was, without a place to stay, on a winter night in San Francisco.

“Oh gosh,” Becca said, “I know just the place. I’m living in a big shared house in Russian Hill. There’s an empty room now.”

“Where’s Russian Hill?” Ashton asked.

“It’s not far. I’ll take you. But wait... would you mind waiting so I can go try one more time to get my job back?”

Ashton was happier than he had been all day. Things really do have a way of working out.

“Sure!” he said, almost giddy. “Just a sec.” And he took out $160 from his wallet, leaving exactly three dollars, and he gave it to Becca, and said, “Take this, it might help you get your job back.”

“Oh I couldn’t!” she said, but Ashton insisted, and they agreed to meet in half an hour at the Steps of Rome on Columbus Ave., where Ashton went to sit and nursed a single cup of espresso while Becca walked back towards the restaurant.

And it got kind of late.

And an hour passed, then another, and the Italian waiter obviously had a crush on Ashton, so he didn’t bother him about just ordering one coffee and sitting at the table for hours, and it’s midnight, then it’s one a.m., then it’s two a.m., and the waiter finally says, “Look, I’m sorry guy, we’re closing, you have to leave.”

Joel Spolsky
  • 7,074
  • 21
  • 56
  • 49
  • 6
    Hey, Joel, there are some really great ideas here... maybe you should consider a blog? – Macneil Dec 16 '10 at 04:58
  • 2
    -1 for another non-answer. This is not a [thoughtful answer to a complex question](http://meta.programmers.stackexchange.com/questions/632/how-to-encourage-thoughtful-answers-to-complex-questions/634#634) but rather a train-wreck in progress. – Josh K Dec 16 '10 at 04:59
  • @Josh: It's kind of like comedy. No, wait, it's kind of like fashion. OK, it's like both: Andy Kaufman can stand up and read The Great Gatsby and be funny. You can't. (Nor I.) Brad Pitt can wear white socks and French cuffs without cuff links and pull it off. You can't. (Nor I.) This? This is Joel's white socks. – Macneil Dec 16 '10 at 05:05
  • 2
    @Macneil: This? This is a ramble and a mess. A farce of an answer. I respect Joel, and think he has written some decent stuff. This? This is a joke. – Josh K Dec 16 '10 at 05:36
  • Perfect example of why we shouldn't blab our inner monologues: they all sound like a boring shaggy dog story to everyone else. But the really important points are: Did Becca get her job back? Did she get the quarter ounce of Humboldt County weed she paid for out of the cash register? Did Ashton go home with the waiter? Did Ashton and Becca run into each other the next week at the Marina Safeway? Inquiring minds want to know! – Bob Murphy Dec 16 '10 at 05:37
  • 2
    @Bob: Inquiring minds should look somewhere else for an answer. – Josh K Dec 16 '10 at 05:48
  • @Josh K: Art is all about the fact that answers you discover while on an intellectual journey stick better than if somebody spells them out for you. It's like the fact that writing code for yourself, or maintaining code someone else wrote, will teach you more than if you just listen to a podcast by a great programmer. Joel's answer is art that answers the OP's question, which is why I upvoted it. – Bob Murphy Dec 16 '10 at 06:00
  • @Bob Murphy: Could you please sum up the moral of the story? I totally don't get it. – sharptooth Dec 16 '10 at 06:02
  • 1
    @sharptooth: The OP blabs his inner thoughts about his bugs to people who don't care about what he thinks and just want their bugs fixed. It's an irrelevant waste of their time, just like Joel's pointless shaggy dog story. Joel took what the OP does and translated it into the SE context, and demonstrated that it's really irritating to everybody but the person doing the blabbing. There's no moral *in* the story; the story *is* the moral. – Bob Murphy Dec 16 '10 at 06:11
  • 1
    @Bob Murphy: So is the point that noone was that interested in Ashton's problems? – sharptooth Dec 16 '10 at 06:15
  • Of course, what Joel did would go right over the head of most SE readers. Programmers are a pretty literal lot. This may not be the best place to put art. – Bob Murphy Dec 16 '10 at 06:18
  • @sharptooth: Yep, pretty much. Or, if like me, you think it's kind of a cool yarn, like reading the slice-of-life webcomic http://www.questionablecontent.net/, it's still completely irrelevant to the problem at hand. If the OP wants to talk about his ruminations about bugs, he should find some friends who care, and do it after work over a beer. – Bob Murphy Dec 16 '10 at 06:24
  • 1
    The moral of the story is that beautiful waitresses are not to be trusted, just like developers who make excuses for their code. And also, if you have only $3, you should try to buy something with some nutritional value. At Steps of Rome they have biscotti, which would've been a better choice than coffee, since tap water is okay to ask for in the US, though in North Beach they do frown upon anything that's not San Pellegrino. – Dan Rosenstark Dec 16 '10 at 07:06
  • @Yar: Actually, I think the moral of the story is you should do your research before coming to SF. Skip the IHOP, and the Johnny-come-lately coffee joints, and get your coffee at Caffe Trieste where the Beats used to hang out. Then forget the waitresses and bop across Columbus to City Lights Bookstore. They have mega-cool weird magazines, and if you manage to pick up an artsy chick there, she's not likely to roll you. But if you want to pick her up, you better know something about art or literature or at least be a socialist. – Bob Murphy Dec 16 '10 at 08:08
  • Hi Joel. I'm starting to think you're exercising your writing skill because you're preparing a book about programmers life and mindsets VS the "real life" through adventures of an "idealist" programmer that you named Ashton. Am I correct? :D – Klaim Dec 16 '10 at 10:06
  • @Bob: Your explanation might be plausible if this were the *first* shaggy dog story, but [it's not](http://programmers.stackexchange.com/questions/25432/how-can-a-new-programmer-impress-the-software-engineer-boss/25459#25459). Joel, you're a great writer, really and truly, but you've chosen an excessively convoluted and roundabout way to make whatever point you're trying to make. Even if Bob's assumption is right, then I don't think a shaggy dog story really helps to demonstrate the (lack of) value of inner monologues. Or maybe this is an experiment you're doing with Programmers.SE... – Aaronaught Dec 16 '10 at 17:20
  • I think if he don't exercise for a book, then he's just trying to provoke reflexion. – Klaim Dec 16 '10 at 18:06
  • @Bob Murphy, I think you're right on with that analysis (and plus one for using the verb "roll"). If only there were some way to communicate that information back to Ashton. Perhaps Joel will choose-your-own-adventure his stories? "What should Ashton do next?" – Dan Rosenstark Dec 16 '10 at 19:48
  • Maybe he select questions+answers to put as morales of some kind of novels? – Klaim Dec 16 '10 at 21:19
  • Well, I think we've beaten this one to death. Anybody for a beer? Seriously - I plan to be at GUADEC in Berlin this summer, and maybe the Ottawa Linux Symposium. Come grab me and I'll buy you one. – Bob Murphy Dec 16 '10 at 21:57
  • Since no one spelled out the moral yet I'll give it a shot. Clearly Ashton is an idealist and Becca is a pragmatist. Whereas Ashton first reaction is to make a proper analysis and fix the root cause of that is ultimately not his problem, Becca looks for an exit, a quick win: "Things gone wrong? C'est la vie. I won't jump through the hoops, so I can get my old job back working for the boss I now dislike; Will it not be much more practical to just keep the cash and move on?" In essence, try to understand the true motivation of your co-workers first or risk being taken advantage of. – Vlad Gudim Jul 12 '13 at 16:13
10

I think it's just a matter of making your words match what you are feeling inside, and putting the thing you feel most strongly (egoless problem solving) first in your response. When a coworker points out a terrible variable name, you could say "I was really tired that day," or you could say "You're right, that is a terrible name; I was really tired that day." or "I am the one who did that; I was really tired that day." or "Thanks for finding that for me; I was really tired that day." Etc. If you lead with the reason, it sounds like an excuse. If you lead with owning the mistake, thanking someone for finding it, or just agreeing with them, the reason doesn't sound like an excuse so much.

As a bonus, when you practise this, you will almost certainly find less need to offer the explanation for those "I was tired, I didn't think anyone would use it for that, I was in a hurry" situations. You can still use it for "well sales never mentioned that they told the user that feature would be added, Bob didn't explain that to me properly, if Joe chose a better variable name I would have got it right, it worked until you changed the spec" situations, when root cause and underlying change analysis may be needed.

Kate Gregory
  • 17,465
  • 2
  • 50
  • 84
  • I guess that's the best solution. In the end I'll get more time and more energy focusing on agreeing and fixing the problem and only explain the problem source I thought about if asked about it. After all, by default, I'm the only one to care about it. If they care they'll ask I guess. – Klaim Dec 16 '10 at 10:09
6

I feel like the best option would be to just admit the problem and promise to fix it quickly. People in general aren't interested why and how you made a mistake, the only exception being your manager for he needs to continuously assess you professional fit.

As for blaming the one who made a mistake, it's in human nature and you can't help it. The best advice is to build a mental barrier and try no to take it too personally, not to let their criticism "touch" you. It's difficult though.

6

Short answer: you don't

Chances are that whoever is pointing out the error is not interested in why it's wrong, they just want it fixed. That fact that you want to discover why the error was made and what you can learn from it and thus improve upon is laudable, but again whoever is pointing out the error is probably not interested in hearing your internal monologue.

keep doing what you're doing, it helps you improve. But don't do it out loud in front of the user.

Steven A. Lowe
  • 33,808
  • 2
  • 84
  • 151
  • Absolutely right. If a waiter in a restaurant brings me somebody else's meal, I just want him to take it away and bring me my meal as fast as possible. I don't want to hear about why he did it. – Bob Murphy Dec 16 '10 at 05:28
  • @Klaim: Just say, "Sorry for the problem. I'll fix it." That's all you should say, because that's all most people care about. – Bob Murphy Dec 16 '10 at 05:44
  • @Bob Murphy, why bother with "sorry?" Why not just say, "Noted, next?" Sorry is part of a blame cycle. It's broken and needs to be fixed. Nothing to apologize for. – Dan Rosenstark Dec 16 '10 at 07:07
  • @Bob Murphy: Yeap, you see, *I'm sorry* is used waaay too often, and usually it doesn't mean that someone is sorry - it's just a protocol keyphrase. Do we need protocol keyphrases where real action and attitude is what's actualy needed? – sharptooth Dec 16 '10 at 07:23
  • @Yar & sharptooth: I regret it whenever other people are truly inconvenienced. I also take a lot of pride in my craftsmanship, so when someone demonstrates I wrote a bug, I not only am sorry, I consider it a personal failure. I don't blow it out of proportion into some neurotic self-flagellation, since we all make mistakes. But for me to say, "I'm sorry my bug caused you a problem" is completely honest. I'm all for "egoless programming" in general, but that has to include professionalism, taking responsibility, and recognizing other people as fellow humans who sometimes deserve apologies. – Bob Murphy Dec 16 '10 at 21:53
  • @Bob Murphy, I see your point. On the other hand, I just got back to the US after 10 years of living and working in other places, and the torrent of "sorrys" being used in every context here -- and it's worse in other Anglosaxon cultures -- just sounds like noise to me. It's hard to get a true "sorry" across... but I digress. Point taken. – Dan Rosenstark Dec 17 '10 at 00:44
  • @Yar: A friend from New Zealand has also remarked on how Americans seem excessively polite and say "sorry" or "excuse me" a lot. My wife and I thought about it, and it may have developed because the US is a cultural melting pot and you never know when you might inadvertently offend somebody. For instance, a friendly left hand on the shoulder to an Irishman is a major insult to people from some places in India. – Bob Murphy Dec 17 '10 at 01:06
  • @Bob Murphy, while that seems like a good explanation, for some reason I never thought of it ;) Very interesting... – Dan Rosenstark Dec 18 '10 at 15:11
  • @Yar: There are lots of things like that. Different notions of personal physical distance during conversation used to lead the English and Italians to think each other were rude. An Ecuadorean I knew couldn't understand why Americans got fidgety when he'd answer "Hey, Felipe, how's it goin'?" with a ten minute dissertation. I'm reading a book about Tibetan yak-herders who stick their tongues out to be polite. People from every human culture have harmless rituals and behaviors that seem odd to people from other cultures, but would make sense if the history were known. – Bob Murphy Dec 18 '10 at 17:36
  • @Bob @Yar "An armed society is a polite society" -- Robert Heinlein http://www.brainyquote.com/quotes/quotes/r/robertahe100989.html – Steven A. Lowe Dec 18 '10 at 17:57
  • 1
    @Steven: I completely agree. In fact, I often think American politics would benefit greatly by a return to dueling. – Bob Murphy Dec 18 '10 at 19:24
1

Regardless, you made a mistake, so you should admit it. You may have had an infinitely small chance avoiding it, but you wrote it and it got released.

When dealing with people with no domain or technical expertise, why are you giving detailed explanations? It either sounds like an excuse or an explanation that is over their heads which they'll interpret as an excuse.

JeffO
  • 36,816
  • 2
  • 57
  • 124
0

In many respects I don't think you can avoid this conflict.

Explaining the rationale as to how you arrived at whatever point you are at is important in understanding the "big picture" around the issue in many cases, but there will always be people that see this as an excuse.

Selecting who you have the conversation with is the closest I have ever gotten to managing this issue. In general that boils down to don't discuss it with the business folks and only discuss it with people that are going to be involved with the technical solution.

Even that approach fails at times because today's wrong is often linked to a previous requirement and you get drug down that path anyway.

In general I try not to worry about it too much as if people are going to pick that as something to raise as an issue about you they are likely sufficiently motivated they will find another issue as soon as you can "correct" this one.

Bill
  • 8,330
  • 24
  • 52
0

Take responsibility for it. Steven Covey phrases it as response-ability: your ability to respond. Say what you will do in the future to prevent doing something like that again, and follow through. Overall you should be concerned about your long-term reputation, and not the immediate moment.

If you own up to mistakes, people will appreciate it and respect you more. It will give you more credibility when something isn't an error (or at least not your own) and does need explanation.

Also, even if not delivered well, take it as constructive feedback and thank whoever pointed out the problem. If you are unsure what they say is wrong with your code, ask follow up questions.

Macneil
  • 8,223
  • 4
  • 34
  • 68
  • I'm not sure your answer answer directly my response. I take responsibility for the problem and try to provide a good solution, but to do this I first need to find why I did the wrong code in the first place. Whatever the why, that's the explaination (or the very fact to try to explain maybe?) that seem to trigger "you're making excuse" cutting sentences that just stop you trying to explain anything. That said, it's not a big problem for me as I still can solve a problem, but it's more a communication problem I guees. – Klaim Dec 15 '10 at 17:09
  • Your urge to "explain" is trying to save face. I'm saying you should do that in a different way. I'm not answering your question at the surface, I'm helping you with the root cause. – Macneil Dec 15 '10 at 21:11
0

Here's what you say:

"I take full responsibility. I'll do my best to correct it and not do it in the future."

What can someone say then? They either accept what you have said and move on or they discipline you. That's it. It puts the onus back on them to do something or, as I said, move on.

johnny
  • 3,669
  • 3
  • 21
  • 35
  • Not so good when the reason for your mistake is someone else's mistake which also needs to be corrected. – Kate Gregory Dec 15 '10 at 18:29
  • @kate you might be surprised how much a responsible person can get away with. – johnny Dec 15 '10 at 19:02
  • I"m not worried you won't get away with it, I'm worried nobody will go over to the other guy and get him to stop doing whatever he did wrong, or change it, or whatnot. The root cause is often (almost always) way more important than who to blame. – Kate Gregory Dec 15 '10 at 19:03
  • @kate depends on the supervisors and the atmosphere. He could always say I take full responsibility for whatever my part is. – johnny Dec 15 '10 at 19:14
  • He could also say, "Sorry there's a problem. I'll work with my other team members to get it fixed." – Bob Murphy Dec 16 '10 at 05:45
0

Most of the times errors are there, because programmer forget to consider all the cases. Sometimes you write the code keeping one scenario in mind and then the other scenario failed. In this case if one asks your answer should be "That case was not considered. Let me correct it, and we will document that whoever is touching this part of the code should code according to this case also".
Normally making mistakes are not the issues, but repeating them is problem. Hence when someone shows you the mistake you should say, "Thanks for finding that out. I will correct it, and mention it in the coding guideline."
But if someone is continuously finding the stupid errors and if that bothers you, then every time you change the code, go to that person and tell him to check the code for errors. Some day he/she will get frustrated and stop it.

Manoj R
  • 4,076
  • 22
  • 30
  • 1
    If someone keeps finding stupid errors in your code, you should make sure to double-check your work before bothering that person to do your error checking for you. The goal is to eliminate errors, so trying to frustrate someone who's trying to improve quality is not the way to go. – Adam Lear Dec 16 '10 at 05:37