Thursday 31 March 2011

OOP Spaghetti code explained

The term "spaghetti code" is usually attributed to pre-OOP code, but there is a lot of OOP code out there that is definitely entangled and a mess. I have seen quite some of it in my carreer, and this kind of spaghetti is characterized by its dependencies.

An class is nothing else than a data structure with associated code, mainly written in a way that puts both into the same source code file. However, if a method for class A depends on a class B, it generates a dependency from class A to class B, no matter if this method is used or not. If class A is about business logic (e.g. "Customer"), and class B is an API thing (e.g. "File"), then the problem isn't that big. A smart compiler can figure out that the method is not used, that there is no active reference to "File", and then maybe not include the File object in the final app. However, if both class A and class B are of the same level in a hierarchy, for instance, if A is "Customer" and B is "Product", then it is usually the beginning of a messy friendship. It doesn't take a lot of these to create a hairball. It gets really bad, if a lower-level class depends to an upper-level class - for instance, if a MySortedListImplementation depends on AppSettings, which depends on Customer.

Wednesday 30 March 2011

Why startups don't use .net

There have been several articles over the last couple of weeks about the usefulness of .net for startups. I will mention three:

* Did the Microsoft stack kill MySpace?
* Why we don't hire .net programmers
* Why Microsoft could kill your startup career

Even though our company is now several years old, our HQ is still located in an office facility that is mainly for startups. Well over the time we have had many companies, including Microsoft, Mozilla, IHTSDO and a few others, but most of the companies are startups. I recognize the same thing: I have not heard the word .net been used by any of the startups, yet. Would I hire a .net developer? I see no problem with .net, but also no significant value of having it on the resume. There are so many other parameters that are important.

I think the last article describes the problem best: Do large companies use their software engineers well enough? I think most have a problem here. A good software engineer is a serial decision maker, who writes down decisions about how things should be done in an automated way. Seen from the management POV, this is not a deterministic process, but a stochastic process, simply because the human mind is shaped by so many things, that influences the outcome. Many attempts have been made to improve the value generated by software developers, including agile software development processes, better ways to write specifications etc., but often these methods are confined within the software development department. If you want to get problems solved, for real, a larger part of the organization needs to be involved, thinking out-of-the-R&D-box must be allowed, and innovation must be rewarded.

Is there a correlation between having spent many years on .net, and not being a good choice for startup companies? It seems so. But it is not about the technology.

Friday 4 March 2011

Apple leaves the PC era

In the recent iPad 2 announcement by Apple, Steve Jobs revealed, that Apple now earns most money on post-PC products like iPad, iPod, iPhone, Apple TV etc. This tendency does not need to continue for a long time, before the Mac computers are reduced to merely strategic products for the company.