06 June 2012

Ducks and House assistants

It's not usual for me to talk about work in this blog, but that's what I'm going to do today. Although this kind of situation is equally likely to happen outside of work. It's something we can experience often in our daily routine. And, although I learned it from programming blogs, it can also be found in any kind of profession.

Assume you have a brilliant mind. Nah, just kidding, you don't have to assume. You already have a brilliant mind. But we all know how our brilliant minds get distracted sometimes, or too much concentrated, and more often than not we suddenly find that we don't seem to be able to solve the easiest problem. Remember how mad it drives you?

The easy fix for this is finding out a mind that is more brilliant than yours and ask for their help. Problem solved. Except that, sometimes it's not that easy to find that person. The person may not exist (if you're the most brilliant mind in your field of expertise); they may exist but be unreachable; they may be reachable but also a total asshole who doesn't like to help others; they may not be an asshole but be tired of total assholes like you who waste their time with kindergarten questions. Whatever the case is, you cannot immediately ask for help. But you're not completely screwed yet. There are two other things you can try that I will show next.

1. Ask the duck


"Asking the duck" is the term I chose to describe this solution. Others may call it Rubber Duck Debugging or Rubber Duck Problem Solving. The method has been around at least since 2002, but it was a recent story that made me understand it and praise it as a great problem solver. In this story, a young designer's boss who is tired of being always asked the same simple questions finds an original way to get rid of them:
Bob pointed into a corner of the office. "Over there," he said, "is a stuffed duck. I want you to ask that duck your question."

I looked at the duck. It was, in fact, stuffed, and very dead. Even if it had not been dead, it probably would not have been a good source of design information. I looked at Bob. Bob was dead serious. He was also my superior, and I wanted to keep my job.

I awkwardly went to stand next to the duck and bent my head, as if in prayer, to commune with this duck. "What," Bob demanded, "are you doing?"

"I'm asking my question of the duck," I said.

One of Bob's superintendants was in his office. He was grinning like a bastard around his toothpick. "Andy," Bob said, "I don't want you to pray to the duck. I want you to ASK THE DUCK YOUR QUESTION."

I licked my lips. "Out loud?" I said.

"Out loud," Bob said firmly.

I cleared my throat. "Duck," I began.

"Its name is Bob Junior," Bob's superintendant supplied. I shot him a dirty look.

"Duck," I continued, "I want to know, when you use a strap hanger, what keeps the sprinkler pipe from jumping out of the strap when the head discharges, causing the pipe to..."

In the middle of asking the duck my question, the answer hit me. The strap hanger is suspended from the structure above by a length of all-thread rod. If the pipe-fitter cuts the all-thread rod such that it butts up against the top of the pipe, it essentially will hold the pipe in the hanger and keep it from bucking. 

I turned to look at Bob. Bob was nodding. "You know, don't you," he said.

"You run the all-thread rod to the top of the pipe," I said.

"That's right," said Bob. "Next time you have a question, I want you to come in here and ask the duck, not me. Ask it out loud. If you still don't know the answer, then you can ask me."
Be sure to check the original post for the whole story.

The whole idea here was that putting your problem in form of a question helps you solve it. Until you pose your problem to someone, the problem makes sense in your head. However, when you try to structure it in form of a question you might find it more difficult to do so than you thought. You try to work around it to make the question more clear, and suddenly, you realize that you are looking at the problem the wrong way. The solution comes easily afterwards.

I have dealt with the "ask the duck" solution countless times. Not that I have a rubber duck per se, but you can do this with virtually anything. The original poster of the story later used a photograph of Newt Gingrich. And you can use your own favorite mascot, or none at all. I, personally, prefer using emails to ask my questions instead of chat (and sometimes even instead of talking face to face). 40% of the times I end up discarding the email because I found the solution in the middle of writing it. And for people that ask me questions on chat, sometimes I tell them to wait 5 minutes before I answer. After 2 minutes I get another message saying "Never mind, I solved the problem myself." (and at that point, I reply "See? I made you ask the duck!")

2. Ask a House assistant


Ducks can alone solve some of your problems. But sometimes asking the duck is not enough. They seem so... quiet. Sometimes you need some kind of feedback, and if you need feedback, you need a House assistant.

I coined the term "House assistant" after the Dr. House / House, M.D. series. If you have seen the show more than a couple of times, you probably know by now that it's always House himself who finds out what disease the sick guy has at the end of the episode. So what does he need three assistants for?

Well House, the character, said it a number of times, he needs his assistants. He needs the brainstorming sessions that they make to try to solve the patient's problem. He needs to have someone talk back to him, because it's in the middle of the conversation that the solution appears suddenly.

One of my favorite House episodes happens when he is stuck on a plane with a guy having a potential contagious disease. Since he doesn't have access to his assistants, he select three random passengers to talk back to him. Even if they don't know anything about medicine, they help him figure out what the guy has.

So if you need help with your problem, just ask a House assistant. Your House assistant can be anyone else: they don't need to know anything about what your working on; it's probably even better that they don't know. Explain your problem to them in a way that they would understand (a form of asking the duck), and then just let them talk back to you and suggest things. A House assistant gives you a new perspective of the problem, even though it seems to them that they are just saying random stuff. You will be amazed with how fast the solution has come to you after speaking to a House assistance, especially if you previously spent hours dwelling alone on the subject.

I personally don't have much experience in using House assistants, but I am asked to become one sometimes. In the end, my colleague thanks me enthusiastically for solving his problem, even though I feel like I didn't do anything, really. I just blabbered some random stuff and suddenly the problem was solved without me even knowing. So if you are ever asked to be a House assistant, you should know that it feels a little weird, but that's the way it is.

Problem solved.

(versão portuguesa)

04 March 2012

How can you tell if a person is a programmer?

Programmers (and computer "nerds" in general) are strange beings. Their natural state is stuck in front of their computer, hammering their computer furiously, and writing stuff even a polyglot couldn't understand. But even when they're not programming, their behavior and way of living are so typical of their kind that could be recognized from miles away. Am I right or what?

What follows is a list of little expressions that give away the programmer's profession. The expressions were taken from the site Stack Overflow, which is a Q&A site for programmers (obviously). The expressions that follow are some of the most voted ones.

Having said that, you can tell if a certain person is a programmer if they:

  • Use parentesis inside parentesis in their normal writing (at least that's what I do (sometimes)).
  • Start counting from zero instead of one and consider 256 a round number.
  • When asked a simple question like Would you like a cup of tea?, they make a small pause before answering, like if they were saving their previous thoughts on disk before processing the question.
  • (Alternative) When asked a simple question like Do you prefer A or B they answer Yes.
  • Are more interested in buying and choosing a keyboard than in cars, shoes, etc.
  • Interpret the questions as precisely as possible, like for instance:

          Wife: Do you want to take the trash outside?
          Programmer: No. (I could go, but I don't really want to...)

          Passer-by: Do you have the time, please?
          Programmer: Yes I do.

          Wife: Bring me a loaf of bread, and if there are eggs, bring 6.
          Programmer: OK.
          Wife (after the buying): Why did you bring 6 loafs of bread?
          Programmer: Because there were eggs.

  • Laugh at stupid jokes like "There are 10 kinds of people: those who understand binary and those who don't".
  • If asked what languages do they know, they list a whole bunch of them but never say "English" or "German".
  • After a long conversation they try to remember where did the conversation started and what steps did they take to get to the current point.
  • Have a tendency to end their sentences with a semi-colon;
  • If asked to solve a problem, they list all possible and imaginable ways to solve it.
  • Male programmer: when he sees an attractive woman with a last generation cell phone in her hand, he looks at the phone first.
  • Say their favorite color is #0000FF.
  • If asked which kind of computer do they use, they cannot answer with just one word (well, unless it's a Mac).
And finally:
  • It should be noted that no ethically-trained programmer would ever consent to write a "DestroyBaghad" procedure. Their basic professional ethics would instead require them to write a "DestroyCity" procedure, to which "Baghdad" could be given as parameter.

01 February 2012

Powerful you have become, the dark side I sense in you

You might not get it from the title, but this is still about the german language. It is still the strangest thing I've been experiencing here, and thus the most fascinating. Like we say in Portugal, to speak German you just have to put a hot potato in your mouth. Yeah, you can do that and sound like a German, but German people won't be able to understand you. Duh...

So why am I quoting Jedi Master Yoda? Because, even though the legends tell he was born in an unknown but distant home planet, I truly believe that Master Yoda was german. Yes, this is the planet, this is the country where Yoda learned to speak. Because if there's people that can turn an entire sentence upside down (or right side left, in this case), it's the Germans. They switch everything: the subject and the verb, the subject and the object, the object with its pronoun... They even switch units and tens when telling numbers, but then they tell hundreds and thousands in the correct order (I mean... just... why???).

If you still don't know what I'm saying, I'll make a little exercise: I'll try to tell you one of my stories here in English, but with the word order of German sentences. OK, here it is:

So, when I my apartment contract got, told they me that I in my town's Burgeramt register had to. I warned was that probably no one English spoke in there, so asked I one of my German-speaking colleagues, to with me on the next Saturday go. However, when he found out was the place only in the morning open on Saturdays, convinced he me to to a week day postpone it, saying that on Saturday mornings he sleep had to.

Saturday morning came up, and I found myself suddenly on number three and twenty of Schulgasse, the Burgeramt's place. I figured I could my luck try and went in. When I my favorite German words told to the person at the front desk, Sprechen Sie Englisch, replied she Nein, and I was a bit disappointed. But then looked at she my papers and asked Anmelden? And I knew that meant "registration", so replied I Ja. She pointed at some stairs and said some incomprehensible things. I didn't bother asking what she meant, just left her and went towards the stairs.

When I the stairs climbed up, found I nothing. No offices, no desks, no people. At that point gave I up, I wasn't be able going to get my registration on that day, I'd later back come with someone else.

In the next Saturday came I later back with another colleague of mine. He was German so knew I I would make it this time. He talked to the lady at the front desk, said she some stuff again, and we left her.

We were towards the stairs heading again when my colleague suddenly stopped and sat on a sofa that on the way was. He was the only one who what to do knew, so sat I on the sofa as well. But I wasn't getting it at first, weren't we supposed to somewhere else go? And that's when it me hit: the lady wanted me to sit and wait, that's why she at the sofa - not the stairs! - pointed the first time.

(versão portuguesa)

31 January 2012

Tschau and the cosmological constant

For those who don't know yet, I embarked on a new journey. And I must really like winter, because after I extended the past one going to Brasil just when winter was starting there, this time I decided to pass winter in an even colder climate. The climate of the alleged "owners" of Europe, the Germans.

The city of Frankfurt is actually very pleasant, but the german language is at the moment the main obstacle for me, who came here without understanding one word of the language. Not that I can't make people understand me, because almost everyone speaks English (and don't mind doing it, unlike what I heard in some urban myths), but because I always have this habit of wanting to pass by as a native person. As such, I keep every little German word I catch in order to use in the next chance. The problem is that after I say Ein Milchkaffee bitte they answer me with a bunch of stuff that I can't understand, and I end up having to ask them to speak English. Anyway, just me being stubborn.

But what has this to do with the cosmological constant? Well, first I have to explain what that is. No wanting to go into much detail, but going in some, because I don't want my readers to die stupid, the cosmological constant was an artifact created by Einstein for his general theory of relativity, which he needed to make it consistent with a static universe. However, after Edwin Hubble (the one that named the telescope) discovered that the universe was permanently expanding, Einstein realized he didn't need the constant after all, and even said that that was the biggest mistake of his career. In spite of all this, years later other scientists brought the cosmological constant back, because it turns out they actually needed it to explain why the universe expands even more faster that was predicted. Enough science for now, the important thing to retain is the definition of a cosmological constant as something that was created as to be right, then discovered to be wrong, then discovered to be right after all.

All of this to explain what happened in my first days in town: after I meet my new coworkers and start getting used to an anglophonic work environment (which I did without problems), at the end of day one of them left, he said Goodbye to everyone, and I throw him a Tschau!, portuguese style. Even after being speaking English all day, it just came out like that.

I suddenly realized that I had said something that no one understood there, and immediately tried to explain myself, taking advantage of the presence of an italian colleague to say the the portuguese Tschau was equivalent to the italian Ciao, although we only used it when saying goodbye. They understood, and I was pleased for having corrected my mistake.

Imagine my surprise when, in the next day, I hear two German people saying goodbye each other with a Tschau.

And then I see my coworkers doing the same thing! After I asked around to see what was going on, I learned that, in addition to the more formal Auf Wiedersehen and the more popular Tschüß, the Germans also use Tschau as a form of goodbye. So the portuguese Tschau that I had said earlier was also correct as a german word! And that's why Tschau is my cosmological constant.

Bonus: although I quickly learned terms like Danke, Bitte and the latest Kaputt (for instance, "my card doesn't work" - meine Karte ist kaputt), at first I was a bit traumatized for not knowing how to say "I'm sorry" in German. Just being able to pronounce Entschuldigen Sie took me more than a week. Until one day a german lady stumbles at me in the tram and says Pardon, french style, which turns out it's a word the Germans also use. Oh well...

(versão portuguesa)

18 January 2012

We are the microwaves who say "ding"


Normally I enjoy very much the advances in technology, but I must say that sometimes technology hinders more than it helps. In the digital era, people just want to stick the digital in everything they can. They must think it's more modern, more avant-garde. They don't realize, however, that it also is less practical.

One of the examples is the replacement of knobs with press buttons. In my microwave oven, which is an old-school one, I have two rotating knobs, one to set the power and another to set the timer. The knob just rotates backwards as time runs out, giving me an idea of the time it has left. Simple.

In today's microwaves, the two knobs were replaced by about sixteen press buttons and an electronic display. Here's an exercise, get one of those microwaves and put it to work, doesn't matter how much time. Come on, make it work! Ah, so you must figure out first which is the On button, from among the sixteen buttons that the microwave has. It should be the button with a ball and a vertical line... oh, no, it turns out it's the one with an inverted triangle. Oh, and now it says it doesn't work because you forgot to put in the time. Simple? I don't think so. Some of these microwaves even have a button to open the door! Really?!!! A simple handle in the above-mentioned door wasn't enough?

But the example I really want to talk about is the sound that microwaves do. The classic microwave oven has a little bell that goes "ding" (or "plim" in portuguese - it's funny how even the onomatopoeias have to be translated) when time runs out. And that's how it should be: "tchaaaaaaaaaaaaannnnnnnnggg... ding!"

But the new microwave oves of the digital era ended that old-fashion think that was the bell and replaced it with, oh what a great idea! a digital buzzer. Results: "tchaaaaaaaaaaaaannnnnnnnggg... beep beep beep!". Beep beep beep?!! What the hell is this?

No offense to homossexuals, but "beep beep beep" seems a little gay... And it doesn't make any sense. A microwave that prides itself must say "ding", it's the "ding" that defines its identity. The stories people tell of terrible and even gruesome events always end with a "ding". "Beep beep beep" is just what almost any electronic devices does nowadays, why can't we distinguish the microwave at least for that?

But the fabulous engineers of the digital microwave went even further and added an uninterrupted "beep beep beep", which DOESN'T SHUT UP until someone goes there to open the door. And that is truly irritating. What were they thinking? Is it that urgent to have to open the microwave door, when it already stopped? Is it really that serious that someone forgets the food is already heated? As I see it they should beep insistently in the event of malfunction, or food overheating, not when the process has finished and everything is OK now!

A microwave that ceases doing "ding" to start doing "beep beep beep" is like when The Knights Who Say "Ni" suddenly stop saying "Ni" and start saying "Ekke Ekke Ekke Ptang Zoo Boing"! It's not the same thing, is it?