Thursday, February 28, 2008

A discussion about creation

.. too early in the morning

Every now and then I am invited to a job interview to sit at the employers side of the table.'That is kind of fun as well. I do enjoy sitting on the other side, because I have the feeling that I am the one who is to make the decision whether to take the position or not. Once they have invited me for the interview I am pretty close to getting hired. At least that is the mood I try to get myself into on most of these occasions.

As I am a developer I mostly attend the interviews for developers. I am usually the ally of the prospect in that sense. The manager that sits there as well is most of the time a non-developer. Someone who knows we need someone with .NET and C# skills, but has no real idea what that means. I am there to see if he or she has any real developer's skills.

Questions to ask

A colleague of mine has very goo question to ask the candidate. He tells the candidate that we would like the manager start programming or at least understand some more what we are doing. One of the things the manager still can not understand is, what is Object Orientation? Can the candidate explain that so the manager can understand the concept. I have heard some hilarious answers to that question. One of the apparent advantages of Object Orientation is that you can spread the objects across multiple servers. The same candidate explained some of the aspects of OO with a dog as an example, one the methods could be Bark() or Sit(). When asked how one would distribute such behavior across multiple servers he fell silent.

Another good and slightly more tricky question to ask is about difference between the terms class, type and object. I must admit that I had to think about that one to come up with a good example. I propose the following example of a Person class, with as properties: first name, last name and birth date. Let's pass those along in the constructor and you get to the following code:

Person person = new Person(firstname, lastname, birth date);

The first word "Person" is the type of the object "person" being created. The class is Person in which a.o. the used constructed is found.

All right, purists, kill me in the comments, but it gently.

A question to ask

I then started to let my mind go wandering where it will go.

I thought about namespaces. I happened to have been in some discussion with namespaces and doing it better than it was in common practice at this job I was at.

The class Person would be in something called

  • Human

Then I started expanding:

  • Nature.Human
  • Earth.Nature.Human
  • Creation.Nature.Human
  • God.Creation.Nature.Human

Hmm, sounds like intelligent design. Note that I haven't named God, that would turn off some other Persons from the namespace Hardcore.Christian.God.Creation.Nature.Human.

Or for those rather having the Evolution Theory, it could be something like:

  • Darwin.Evolution.Mammal.Primate.Human

But working along these ideas, ultimately, all namespaces would be positioned below God or Darwin. That would be strange idea. And what about the Flying Spaghetti Monster?

The God Class

Then I found myself wondering about the God class. "You should never create a God class." It must be one of the ten Developer's Commandments. Which namespace would that God class be in? I became stuck at this point. I at least understand now why I should never create a God class, because there is no namespace to put it in.

On top of that does the God class derive from object? Or from a divine object? Or the other way around: does object derive from God?


So, there I was completely philosophical before 9 in the morning. Suffice to say, I didn't get much work done all day. Especially no Divine Work.

Please someone help! Define divine!