Archive for February, 2009

Don’t believe everything you’re told

February 13, 2009

One of my collegues had an intereseting error report from our test suit today:

Error: “Expected 3 but was 3″

At first glance it might seem that everything is as expected!! actually it’s not but finding where the error is might be a little tricky. There’s not a lot of information to start with.

The problem is a some what shaky implementation of the unit test framework we’re using. The line of code that reports the error looks like
ASSERT_EQ(++errorCount, errorHandler.Errors.Count);

I personally don’t like the ++errorCount argument but would expect it to be fine except ASSERT_EQ is a macro and the argument is used once for comparison and once for outputting and hence incremented twice

Moral: If you’re not 100% sure what a macro does and you need it to work on a value pass a value. Only pass expressions when the macro needs an expression and not a value.

Changing habits

February 13, 2009

I’ve been reading a few posts on http://www.hanselman.com/blog/ lately under the category “I suck”. A typical Scott way of putting things and very educational.

It’s so easy to just say every one else are stupid and if they would just listen it would be so much easier and I do it a LOT.

So of that is due to my job requires me to analyse every one else job and find where they can improve. It’s a lot easier to improve what people are doing badly than improving what they are already doing well so I focus a lot of my work on the first but that’s just part of the reason. It’s a lot less costly to find some one elses faults thatn your own or at least so it seems.

I used to work in a company that made different measuring devices and our tag line was “If you can’t measure it, you cant’ improve it” I used to use that a lot a few years ago when I was envolved in pro sport but after retirring from that I’ve kinda forgotten it again. Reading Scott’s post reminded me of the value of measuring yourself once in a while.

Part of my work is changing peoples habits and one of the things I need to improve is the way I communicate what they should do differently. If you take a look at some of my posts you’d see that I’m quit capable of telling people what not to do! that’s seldom a productive way to change habits.

Try saying the following to your kind one day “Don’t put your toast in the VCR” (only works if they actually knows what a VCR is and you actually have one :-) ). The NLP community would call that an embedded command. The visual cortex is not capable of visualizing negations so all the kind will visualize is “put your toast in the VCR” the chances of that visualization helping you reach your goal of no food in the VCR could be improven if you told your kind to eat the toast or asked “how does you toast taste”. After all they can’t answer that if the toast is already in the VCR.

The point is that Im sure I would have more success in changing peoples habits by telling them what to do instead of telling them what not to do.

I personally reacts badly to people telling me what not to do. If my girl friend tells me I spent to much time with my computer and probably end up getting made if she says that to many times. Not because I wouldn’t gladly prioritize her needs. I just hate guessing what they are. If however I got questions like “Wanna go to the movie with me/Sit in the couch and chat” or what ever she would want to do she can’t do because Im working/playing poker at my computer my reaction would probably be a smile and “sure honey”

I might be more extreme in my reactions to being told what not to do. It easily pisses me off but Im sure that Im basically no different from others.

If you want people to do things differently tell them what you want them to do, not what you want them not to do. So instead of telling my self not to tell people what they shouldn’t do I think it’s time I told my self that I should tell people what they need to do.

and as a final note never tell people the should do somthing you want them to do and never say they shouldn’t do something if you really don’t want them to. Say youi would like them to do something. Why? imagine yourself standing in front of an open fridge look at your favorite chocolate cake and a brocolli. You’d probably be thinking I should eat more brocolli that would be so good for me when you look a the brocolli while when you look at the cake you’d think I really shouldn’t have more cake. Im betting you rarely ends up in the couch enjoying a big chunck of brocolli. Usually our “shouldn’t”s are rewarded and our “should”s are followed by punishment. 

Don’tget people to  associate want you what them to do with punishment by saying they should instead use words as “need”, “wish”, “like to” and similar