Category Archives: People

I, Engineer

Swiss Army MouseI could hardly wait for my new Linux PC to arrive. When it finally did, I ripped the cardboard box open, connected everything, pressed the power button and … was utterly disappointed.

I didn’t want an off-the-shelf PC, partly to avoid the usual Microsoft tax (aka. pre-installed Windows Vista) but mostly because I wanted a quiet PC. All the components (including a passively cooled graphics card) were selected with this goal in mind. Still, my PC sounded like a freaking lawn mower.

One option would have been to send everything straight back, but this would have been rather cumbersome; the other to take care of this problem myself.

I used to be a big fan of “McGyver”, hero of the eponymous 1980s action series. “Mac” was a wonderful person: a good-looking, daredevil who avoids conflicts and doesn’t wear firearms; instead he always carries a Swiss Army Knife and duct tape. He knows how to defuse bombs, how to hotwire cars and is able to fix everything with everyday stuff like paper clips. In short, he is a great problem solver, a great hacker and a great role model.

McGyver would not have sent back the PC — he would have taken care of this problem himself. So I opened the case and found out that — even though I had a passively cooled graphics card — there are four fans in my case: a power supply fan, two case fans (one mounted on the front and a larger one mounted on the back) and a CPU fan.

It turned out that the manufacturer saved a couple of bucks by using really cheap fans, so I ordered ultra-silent replacement fans; yet for my taste the CPU fan was still too loud. I measured the current that ran through it and did a quick calculation to find out which resistor I needed to slow it down to 1000 rpm. Alas, I only had two resistors that sustained the amount of current flowing through my fan: one that was too big (which prevented the fan from starting up) and another one that was too small (the fan was still sounding like a lawn mower). I could have ordered the perfect resistor, but this would have meant waiting a couple of days and paying 10 EUR for shipping and handling. The right “hack” was of course to connect them in parallel, which yielded a resistance very close to the one I calculated. After a little bit of soldering I protected the solder joints with heat-shrink tubing and — voila! — I had a decently quiet PC!

Too many programmers I’ve met are not able to cope with everyday situations. Maybe they know how to optimize SQL queries, but they can’t fix a dripping tap. That’s rather unfortunate as this means that such folks are forever dependent on others. On the other hand, I’ve often observed that principles from other fields can be applied to software development as well, for instance, to build better metaphors. Such metaphors play a major role in getting a deeper understanding of software development, which is very useful for explaining software issues to non-technical people. (As an example, I personally like comparing refactoring to gardening: if you don’t constantly take care of your garden by weeding, fertilizing, watering, mowing, it will require a huge investment in time and money later.)

So step out of the computer-nerd zone and rather be a “jack-of-all-trades”; try to be a true engineer, a person who is able to solve all kinds of technical problems with technical/scientific knowledge and creativity — for your own benefit as well as the benefit of the people around you, but also for fun and profit.

[update 2009-10-29: Alert reader Jörg (obviously a true engineer) discovered an embarrassing mistake: if you connect resistors in parallel, the resulting resistor value is of course smaller than the smallest resistor value of any resistor connected, which means that part of my story just doesn’t make sense. Damn! I checked whether the resistors in my PC are really connected in parallel — which they are. I tried hard to recall what the real story was but ultimately gave up. The hack works — that’s what counts in the end, doesn’t it? ;-)
— end update]

On Pragmatic Thinking and Learning (and Cats)

pragmatic catI just finished reading “Pragmatic Thinking and Learning” by Andy Hunt, one of the “Pragmatic Programmers”.

Besides explaining how our brain works and how to acquire knowledge effectively, he tells many interesting stories and gives pragmatic tips that are invaluable for any knowledge worker.

Most likely this book is going to make it on my yet-to-be-published top 10 of books that radically influenced my professional life. Some positions are already allocated. For instance, number one is Steve McConnell’s “Code Complete” because it turned me from a hobbyist programmer into a professional software developer (I hope). Next comes “Peopleware” by Tom DeMarco and Timothy Lister, because it taught me that software development is all about people and only remotely about tools or methodologies. The third place goes to “The Pragmatic Programmer” (here they go again!) for tripling the level of passion I have for programming.

So what is so special about those pragmatic guys?

I guess it is the way they entertain their audience with immediately usable advice — they are very good presenters. I first met them in 2000 at a conference about Java and object-oriented programming (JAOO) in Denmark.
They gave one of the best (correction: the best) presentation I have attended so far — full of wit, full of fun. Nobody knew them at the time (I vividly recall when at the end of the presentation somebody asked “Who are you guys, anyway?”). Regretfully, I missed the opportunity to buy their then brand-new book “The Pragmatic Programmer” and have them sign it on the spot (I learned from my mistake and had Bjarne Stroustrup sign my copy of “The Design and Evolution of C++” the next day).

Not all of what they write or say is truly novel. Frequently, they reuse material and wisdom from others (a very pragmatic habit, indeed) but they always present it in a context that makes me think “Wow!”. Take, for instance, this quote from Mark Twain at the beginning of chapter 7 “Gain Experience” in “Pragmatic Thinking and Learning”:

“We should be careful to get out of an experience only the wisdom that is in it and stop there; lest we be like the cat that sits on a hot stove-lid; he will never sit on a hot stove-lid again—and that is well; but also he will never sit on a cold one anymore.”

Very profound, isn’t it?

Bad Hiring Strategy, Great Interview Question

recruitmentYou have to bear in mind that this story happened in 1999, more than a year before the dot com bubble burst; senseless hiring of people was considered perfectly normal at that time.

I was working for a well-known consumer electronics company, developing mobile phones. Our CEO had a problem. The problem — which is not so uncommon among CEOs — was that the investors weren’t happy because the company didn’t sell enough handsets. So the boss went to sales and they claimed they couldn’t sell more because the development guys didn’t give them enough cool products — products the customers reeeeeelly wanted and even if they did, they’d finish too late; that is, they’d come out with a phone in March, missing the Christmas sales season by threeeeee month.

So our boss went to the development manager to find out what the problem was; our development manager told him what almost every development manager tells in such a situation: “We could develop soooooo many cool products in sooooooo little time, if we only had moooooore developers!”

This procedure repeated a couple of times until our CEO freaked out. He went to our human resources manager and commanded him to “get more software developers, no matter what!”

Our HR manager didn’t know much about hiring software developers, but he surely had a plan: he wanted to hire 100 software developers in 100 days. He had t-shirts printed, carrying these words:


[company]
100
in
100
Do YOU have good
soft(ware) skills?

Our job was to wear these (poor quality) t-shirts and attract potential software developers for our team.

This strategy was unbelievably stupid for many reasons. First, it emphasizes quantity, not quality. Second, it reads as if soft skills were more important than software skills. Last, it is very offending as it is based on the idea that good software developers stupidly fall prey to such bad HR campaigns.

Anyway, we got lots of candidates — many more than we could interview; our HR manager celebrated a victory. We, however, had to separate the wheat from the chaff and thus we developed programming tests that every candidate had to take.

One of the most successful questions was this one:

Write a routine that sorts an array of ‘n’ integers; write best-quality code.

Innocuously as it looks, this question has several good characteristics: it requires the candidate to actually write real code; since it has to be ‘best-quality code’ you can find out about his/her skills and quality standards. For instance, does the candidate

– pay attention to style issues (indentation, layout and consistency in general)?
– choose meaningful identifier names?
– write (good) comments?
– use assertions and/or checks for boundary cases?

This question can reveal even more: since no programming language is given, you can find out about a candidate’s favorite programming language. But most importantly, you can find out if a developer is smart and has a questioning attitude.

Every smart developer knows that there is no perfect sorting algorithm. The choice depends on many constraints — constraints that are not given in the problem statement and hence must be investigated. I remember one applicant commented along these lines:

[…] It all depends on how big ‘n’ is and whether we have write access to the array (that is, we can sort in-place). Are there any code/RAM restrictions? Depending on factors like these I would choose the best sorting algorithm from a text book. Unless no further information is given, I would use the sorting algorithm that comes with the standard library (e. g. qsort() in C, java.util.Arrays.sort() in Java). Since I know that you want me to write some code, I’ll implement an insertion sort algorithm which is easy to code and its O(n^2) behavior is acceptable for ‘n’ < 1000 [...]

Naturally, we made an offer to him, which he turned down a couple of days later. I guess he was scared of having to work with too many soft skills experts.

How to become a better programmer

plant.jpgGood programmers often wonder how to become even better programmers. They constantly seek for new tools and techniques that help them getting their job done better and faster.

If you want to know what helps the most, here is some advice:

“You must do two things above all others: read a lot and write a lot. There’s no way around these two things that I’m aware of, no shortcut.”

These words are from the best-selling author Stephen King; he should really know — he makes 45 million bucks per year from his books.

I believe that programming and writing novels have a lot in common and that King’s words of wisdom are applicable to software development as well.

Let’s first focus on reading. It’s a well known fact that programmers read too little. In their book “Peopleware”, Tom DeMarco and Timothy Lister assert that the average developer doesn’t own a single book on the subject of his or her work. If this is true, it might be an explanation as to why our industry is performing so badly: if developers don’t know about the fundamentals of software engineering (not just coding issues — also topics like software quality, configuration management and peopleware in general) how can they explain them to non-technical folks like sales and upper management once they’ve become technical leaders?

What about code reading? Fortunately, we live in very privileged times. Twenty years ago, almost all code was closed source; nowadays, there are billions of lines of open source code out there from which we can learn. Alas, there is the fundamental law of programming: “It’s harder to read code than it is to write it.”

If browsing through huge open source code bases gives you headaches, check out “Code Reading” or “Code Quality” by Diomidis Spinellis. These two fine books quote (and criticize) countless examples from open source projects — in my view, a lightweight and often entertaining way to improve your programming Kung Fu.

But what about code writing? Isn’t a professional software developer already writing enough code? Not so! Typically, software developers only spend a fraction of their time writing code. In fact, most of their time is devoted to meetings, email, reading specs, writing documentation and so on. With this little time given for writing code, it is vitally important that developers keep their programming skills active.

A good way to practice is by contributing to an open source project. Another possibility is doing Code Katas — little practice sessions, based on a concept borrowed from karate and other martial arts, where the practitioner fights against an imaginary opponent. But by far the best way is to work for your employer in your leisure time — for free!

Have you recovered?

I presume that to most people, this idea sounds shocking, almost insane — but I really mean it. Often, good ideas arise during the day that your boss doesn’t understand and hence doesn’t approve. If you think your idea is challenging and useful for the company — do it at home! Not only does this improve your coding skills, it helps your company; as a bonus, your reputation within the company increases. So we have at least a win-win, if not a double-win-win situation. But only choose interesting topics, things that improve your skills; leave the drudgework for the office.

Constant reading and practicing is the key to success. It doesn’t take much time, but it needs to be done habitually. Don’t expect that your company or your boss or anyone but you is responsible for improving your skills. Even if those days existed in the past, they certainly don’t exist anymore.

Internal Developer Turnover

Everyone is familiar with the term ‘staff turnover’: it is the number of people leaving a company in a year divided by the total number of employees in that year.

It is also common wisdom that high turnover rates in development shops are an indication that something is going wrong. Maybe people have to work long hours far too often, the money is poor compared to competitors or the boss beats up developers for checking in bugs. Who knows…

This classic definition of turnover does not show when people, who were once hired as developers, voluntarily move to jobs — within the same company — where they don’t write code anymore.

To me, such developers are also lost, much like they would have quit the company completely. This common phenomenon can give a more subtle insight into what exactly is going wrong within a company.

Why do developers leave their developing jobs but decide to stay within the company? It is quite obvious that the company can’t be so bad after all — otherwise they would have gone elsewhere. I think that there are two chief reasons for this internal developer drain: either there is something wrong with the hiring process or there is no career path for developers, or both.

If there is something wrong with the hiring process, a company will employ developers who aren’t really developers; that is, they only do coding because they wouldn’t know how to make money otherwise. Sooner or later, they get bored (or frustrated) or bullied by peer developers who are fed up with cleaning up after them. So they decide to work as ‘requirements engineers’, ‘project leads’ or join the marketing department.

A missing (technical) career path for developers means that if developers want to get more money (to raise a family, for instance) or responsibility, they have to follow the only career path available. Often this means that they are ‘forced’ to do a job that they don’t particularly like and that they never learned to do properly — a clear manifestation of the well-known “Peter Principle”.

These two sources of internal turnover are an indication that a software company is in serious trouble; they are typically found in companies with a traditional (non-software) background. Such companies were once successful in a certain technology which has been been replaced or heavily augmented by software. Their processes that worked so well in the past don’t work anymore…

It is very hard to establish a software culture in these traditional companies because a) the top management doesn’t understand the problem at all and b) the middle management is afraid of change — change that might ultimately have a negative impact on their own career.

The Policy

I have witnessed the following scenario many times in my life – sometimes it happened to me, sometimes to some colleague. It always goes like this:

1. A company wants to protect itself against loss of something very important (e. g. company reputation, money, life); some prominent people sit together and devise a strict policy for everyone to follow.

2. The policy is cumbersome, so over time, people either ignore it (at least every now and then) or clever people find loopholes and work around it.

3. Years go by; by sheer luck nothing really bad happens.

4. Someday, someone (maybe a new colleague) discovers the truth and in a rush of creativity comes up with a smart and simple solution that achieves 99% of the desired effect while at the same time keeping those who have to use it happy.

5. The idea is rejected by management on the grounds that a) the proposed solution is not perfect either and b) the original policy can’t be so bad as nothing really bad has happened so far!

6. Our once-proud hero gets frustrated.

Why is this obviously good idea rejected? Answer: for political reasons!

Even though our inventor had the best intentions, by suggesting a new approach he caused a lot of problems to many people. He indirectly claimed that:

1. There has been a big threat over years.

2. There are people in the company who haven’t followed management’s policies for years.

3. The designers of the original policy did a poor job.

4. The managers failed to see the obvious: the policy is cumbersome and hard to follow.

5. The managers failed to ensure that the policy is actually followed.

6. He is much smarter than others (i. e. his managers).

Had the new approach been accepted, management would have admitted all these “accusations”. Now it should be clear why the idea was dismissed.