What will I teach my children about the job?

YOU HAVE TO LOVE AND RESPECT YOUR JOB

Just that simple!

But why? why do you teach them the things that should be a common sense/ common knowledge?

Because, I started to realize that NOT many people actually love their job, or even respect the job they are doing. Usually I heard this when asking them about the job:

  1. It would be better if i am a singer, it would be better if i do other job. The job that someone get a very well-paid
  2. I would do better if I get more salary. If the boss is fair
  3. I would … If

You get the point. I do not say that everyone says that. Just the fact that i met some of them. And actually quite a lot in IT industry. Therefore, I want to make sure I have the right mindset to teach my children.

Here are what I think about the job and why I love, respect it:

  1. I spent 16 years studying to have the job (12 years at high school + 4 years at the university). Therefore, I respect, love what i have been doing in that 16 years.
  2. The job helps me pay my bills, allows me to buy food, water, beer, … all the necessaries stuff for a living
  3. It helps me foster my family, my children
  4. It gives the feeling that: I am alive, I am a human. I create things everyday.
  5. Without a job, I am nothing, no job, no money, no thing.

Some people said: hey what are you talking about?

I LOVE MY JOB

My response:

REALLY??

Did you remember when you love someone? did you tell them:

I will love you IF …

There are more in though about this topic in my mind. But it is enough for a morning 🙂 Someday, I hope my children will read this post 🙂

Should you give the IQ (Logical) Test for Sr. Developer Candidates?

These days, my company is doing a lot of interviews for both Junior and Senior Developers. Most of the Juniors are happy to do the basic programming (just some for loop test) and the IQ Test. Of course, there were some who refused and just left. The thing that got my attention is not the result of the test, rather the number of Senior Candidates refused to come to the interview and even when they came, they refused to do the test and asked for direct interview.

A big question came out of my mind: WHY? I guess, most of them felt: Offended. I asked around and most of the answers i got:

Senior Developer does not want to take the test since they think they are better, they feel offended. And the test does not tell anything about them.

And some of them look down on the company that send the invitation.

That’s fine and we respect that. We are happy to learn that we should change the hiring process to fit the situation. Yeah. And we actually did change:

So, now, we remove the test for Sr. Developer candidates. And we do interview directly instead.

However, it did still not make much sense to me. Then I asked myself, what if I am looking for a job, and they ask me to do the test. This came out of my mind:

FEAR.

And i recalled that it is actually natural. When i was in the school or university, I got those feeling when the teacher gave me the test. Even I was a good student. Still the same feeling. Not really a good or bad thing. It is just a fact that we have to deal with 🙂

So far we are happy with the hiring result. We have many candidates applied for the Job Ad. And lost of them have very high skills.

We keep interviewing, we keep hiring 🙂

Unity Container: What was wrong with this code?

Recently, I reviewed code from a candidate. He wrote a simple Web Application using WebApi. And he used Unity as IoC Container. And this is part of the code I asked him the question

SampeCodeWithUnity

My question to him: What is wrong with that code?

And his answer: Due to from best practice from this post:

http://www.asp.net/web-api/overview/extensibility/using-the-web-api-dependency-resolver

And it is good to use suggestion implementation from Mike Wasson. However, I think he should think a little deeper with my question.

Anyway, I think it is interesting to explain my answer here.

  1. Exception handling: When the unity cannot resolve a component, and throw that exception, how to know: WHY? There is something wrong with your code. And you just assume it will be null and move on. Most of the time, the container should tell us why it cannot resolve a component. In the windsor container world, most of the time, it is lacking of component registered.
  2. About caller code: With that resolve strategy (return null on failed), the caller code have to check for null every time. Else you have a chance to get: NullReferenceException. Which means you introduce the unstable in your code, and the chance to debug it – in production code.

My suggestion: Lets it failed and throw exception. And you should have a error handler in the application scope.

Support serialization with Expando object

Recently I have a chance to work with project that need to store dynamic data, work with dynamic data. The data will be stored in RavenDB. After some considerations, I decided to use this implementation from Rick  Strahl. Everything works fine, except saving to database. It is store as empty object in RavenDB.

Just add these lines of code will solve the problem


public override IEnumerable<string> GetDynamicMemberNames()
{
return Properties.Keys;
}

The end result is nice

ExpandoRavenDB

WPF: Mystery bug: Hunt, fix, but still not understand why

I got a bug report from client for a WPF application. Please look at the picture below:

mysterybug

The expected dropdown values are: I , unique II, III, IV, V

But it displayed “II” instead of “III”. I then check the value from data source. The data was correct. I then brought up my Visual Studio and ran the app. No, issue found.

After some discussion, I then tried with Windows 7, and Windows 8. And after some tries with changing the value for “III” item. The conclusions are:

  1. It works fine with Windows Server 2008 R2.
  2. It does not work on Windows 7 and Windows 8
  3. Only happen if “III” stands alone. If you add space (“I II”), it works

After hunting down the code, I ended up at the template to display the combo box item ( I need to use custom template for my own purpose)

<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Name}" Height="35" Padding="5"></TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>

Accidentally, I changed Padding from “5” to “3” ( I love number “3”). To my all surprise, it worked Smile. I then tried with number “4”. It did not.

It will work with value less than or equal 3.

But I still do not understand the reason Sad smile Just post it here if someone can explain to me or if someone has the same problem might find the answer.