Why do software projects fail?

penseur

In the Theatetus, Plato writes that ‘philosophy begins in wonder’.  Here is Jowett’s translation of the passage:

Soc: …I believe that you follow me, Theaetetus; for I suspect that you have thought of these questions before now.

Theaet. Yes, Socrates, and I am amazed when I think of them; by the Gods I am! and I want to know what on earth they mean; and there are times when my head quite swims with the contemplation of them.

Soc. I see, my dear Theaetetus, that Theodorus had a true insight into your nature when he said that you were a philosopher, for wonder is the feeling of a philosopher, and philosophy begins in wonder. He was not a bad genealogist who said that Iris (the messenger of heaven) is the child of Thaumas (wonder).

In the Metaphysics, Aristotle continues the same theme (tr. W. D. Ross):

For it is owing to their wonder {ex archês men ta procheira tôn atopôn thaumasantes} that men both now begin and at first began to philosophize; they wondered originally at the obvious difficulties, then advanced little by little and stated difficulties about the greater matters, e.g. about the phenomena of the moon and those of the sun and of the stars, and about the genesis of the universe. And a man who is puzzled and wonders thinks himself ignorant (whence even the lover of myth is in a sense a lover of Wisdom, for the myth is composed of wonders); therefore since they philosophized in order to escape from ignorance, evidently they were pursuing science in order to know, and not for any utilitarian end.

This wonder tradition in philosophy has two principles. One is that wonder must lead to the articulation of questions, for without questions and dialectic, wonder never goes any further.  The second is that questioning must be non-utilitarian, and that its end must be contemplation, rather than the solution to a practical problem; in other words, questions must be open-ended in order to count as philosophical (i.e., pure scientific) problems.

Thus Aristotle continues, in Book II of the Metaphysics:

The investigation of the truth is in one way hard, in another easy. An indication of this is found in the fact that no one is able to attain the truth adequately, while, on the other hand, we do not collectively fail, but every one says something true about the nature of things, and while individually we contribute little or nothing to the truth, by the union of all a considerable amount is amassed. Therefore, since the truth seems to be like the proverbial door, which no one can fail to hit, in this respect it must be easy, but the fact that we can have a whole truth and not the particular part we aim at shows the difficulty of it.

Against this tradition, Descartes, an extremely practical man, argues in Articles 77 and 78 of Passions of the Soul (tr. Stephen H. Voss):

Furthermore, though it is only the dull and stupid who do not have any constitutional inclination toward Wonder {l’admiration}, this is not to say that those who have the most intelligence are always the most inclined to it.  For it is mainly those who, even though they have a good deal of common sense, still do not have a high opinion of their competence [who are most inclined toward wonder].

And though this passion seems to diminish with use, because the more one encounters rare things one wonders at, the more one routinely ceases wondering at them and comes to think that any that may be presented thereafter will be ordinary, nevertheless, when it is excessive and makes one fix one’s attention solely upon the first image of presented objects without acquiring any other knowledge of them, it leaves behind a habit which disposes the soul to dwell in the same way upon all other presented objects, provided they appear the least bit new to it.  This is what prolongs the sickness of the blindly curious — that is, those who investigate rarities only to wonder at them and not to understand them.  For they gradually become so given to wonder that things of no importance are no less capable of engaging them than those whose investigation is more useful.

Descartes found many ways to break with the Aristotelian tradition that had dominated Western thought for over a millennium, but none, I think, more profound than this dismissal of the wonder tradition.  In this brief passage, he places intelligence {l’esprit} above contemplation as the key trait of philosophizing.

A consequence of this is that the nature of philosophical questioning must also change.  In a Cartesian world, questions must have a practical goal.  Difficult problems can be broken down into their components, and if necessary those must be broken down into their components, until we arrive at a series of simple problems that can be solved easily.

Descartes’ position is only strengthened by what is often called the scandal of philosophy: why, given all this time, has philosophy failed to answer the questions it originally set for itself?

  • Does God exist? 
  • Is there life after death? 
  • Do we possess free will?
  • What is happiness, and is it attainable?
  • What is Justice?
  • What is Knowledge?
  • What is Virtue?

Another way to look at the scandal, however, is not as a problem of lacking answers to these questions, but rather as a problem of having an overabundance of answers.  Philosophy, over the centuries, has answered the question of God’s existence with both a yes and a no.  There are five canonical proofs of God’s existence, as well as a multitude of critical analyses of each of these proofs.  We are told that Occam’s Razor, originally a tool of theological discourse, demands that we reject God’s existence.  At the same time, we are told that Occam’s Razor, the principle that simple answers are preferable to complex answers, itself depends on a rational universe for its justification; for the only thing that can guaranty that the universe is simple and comprehensible rather than Byzantine in its complexity, is God Himself.

The scandal of philosophy is itself based on a presupposition: that this overabundance of answers, and the lack of definitive answers, is contrary to the purpose of philosophical questioning.  Yet we know of other traditions in which the lack of answers is indeed a central goal of philosophical questioning.

Zen koans are riddles Zen masters give to their students to help them achieve enlightenment.  Students are expected to meditate on their koans for years, until the koan successfully works its effect on them, bringing them in an intuitive flash into the state of satori

  • Does a dog have Buddha-nature?
  • What is the sound of one hand clapping?
  • What was your original face before you were born?
  • If you meet the Buddha, kill him.

I dabble in the collecting of questions, and with regard to this habit, the observation Descartes makes above about the curious “who investigate rarities only to wonder at them and not to understand them” fits me well.  One of my favorite sets of questions comes from Robert Graves’s The White Goddess, a book which, starting from an analysis of The Romance of Teliesin that makes Frazer’s Golden Bough seem pedestrian by comparison, attempts to unravel the true purpose of poetry and, in the process, answers the following questions:

  • Who cleft the Devil’s foot?
  • What song did the Sirens sing?
  • What name did Achilles use when he hid from the Achaeans in the women’s tent?
  • When did the Fifty Danaids come with their sieves to Britain?
  • What secret was woven into the Gordian Knot?
  • Why did Jehovah create trees and grass before he created the Sun, Moon and stars?
  • Where shall Wisdom be found?

Another set comes from Slavoj Zizek’s Enjoy Your Symptom!, in which Zizek elucidates certain gnomic pronouncements of Jacques Lacan through an analysis of mostly 50’s Hollywood movies:

  • Why does a letter always arrive at its destination?
  • Why is a woman a symptom of man?
  • Why is every act a repetition?
  • Why does the phallus appear?
  • Why are there always two fathers?

Modern life provides its own imponderables:

  • Paper or plastic?
  • Hybrid or Civic?
  • Diet or exercise?
  • Should I invest in my 401K or pay down my college loans?
  • Should I wait to get an HD TV?
  • When shall I pull out of the stock market?

There are no definitive right or wrong answers to these questions.  Rather, how we approach these questions as well as how we respond to them contribute to shaping who we are.  In his short work, Existentialism and Human Emotions, Sartre tells an anecdote about a student who once asked him for advice.  The student wanted to leave home and join the French Resistance.  The reasons were clear to him. The Germans were illegitimate occupiers and it was the duty of every able-bodied Frenchman to fight against them.  At the same time, the student had a sickly mother who required his assistance, and leaving her would not only break her heart, but he might possibly never see her again.  To leave her would entail sacrificing his filial duties, while not to leave her would entail abandoning his moral duty.  To this student, caught in the grips of a mortal quandary,  Sartre offered the unexpected advice: choose!

…[I]n  creating the man that we want to be, there is not a single one of our acts which does not at the same time create an image of man as we think he ought to be.  To choose to be this or that is to affirm at the same time the value of what we choose, because we can never choose evil.  We always choose the good, and nothing can be good for us without being good for all.

But this isn’t the whole truth.  There are also choices we make that appear arbitrary at the time, committed without any thought of ‘man as he ought to be,’ but which turn out to have irreversible consequences upon who we become.  In the film The Goalie’s Anxiety at the Penalty Kick, Wim Wenders follows a goalie who is kicked off of his soccer team after failing to defend against a penalty kick that costs his team the game.  The goalie proceeds aimlessly through a series of pointless and reprehensible acts.  I once asked a soccer-playing friend if the circumstances of the penalty kick are as they were described in the movie, and he said yes.  Before the penalty kick, against a skilled opponent, the goalie has no idea which way the ball will go.  He stands in the middle between the two posts and must choose which in direction he will leap, without enough information to determine whether his choice is the right one or the wrong one.  The only thing he knows is that if he does not leap, he will be certain to fail.

All these theoretical questions, and the survey of the theory of questioning in general, are intended to provide the background necessary for answering the very practical question:  Why do software projects fail?

Fred Brooks’s succinct answer to this is: software projects fail because software projects are very hard to do.  In other words, we are asking the wrong question.  A better way to phrase the problem is “Why are we still surprised when software projects fail?”

This question might be extended to other fields of endeavor:

  • Why are term papers turned in late?
  • Why do we fail to pay our bills on time?
  • Why do we lie when we are asked over the phone, “Were you sleeping?”

In the discipline of software development, it is often found as one item in a larger list of software koans:

  • Why do software projects fail?
  • Why does adding additional developers to a project slow the project down?
  • Why does planning extra time to complete a task result in no additional work being done?
  • Why do developers always underestimate?
  • Why are expectations always too high?
  • Why does no one ever read documentation?
  • Why do we write documentation that no one ever reads?
  • Why is the first release of any code full of bugs?

Here we have an overabundance of questions that can all be answered in the same way.  Kant phrased the answer in this way:

Out of the crooked timber of humanity, no straight thing was ever made.

Aristotle phrases it thus in Metaphysics II:

Perhaps, too, as difficulties are of two kinds, the cause of the present difficulty is not in the facts but in us.

Zombies III

zombies2

As reported at Slashdot, Archaeology magazine has an online article about evidence of zombie attacks in ancient Egypt, circa 3000 B.C.  According to the article, written with a light hand, one suspects, the Palette of Narmer (above), found at Hierakonpolis, depicts this early encounter with the undead:

On the other hand, in support of the earlier date, some have claimed that the famous Palette of Narmer (ca. 3000 B.C.), also from Hierakonpolis, far from recording a victory in the war of unification of Upper and Lower Egypt, is instead a celebration of the successful repulse of a zombie attack. Although we tend to focus on the verso where the king is shown smiting a kneeling enemy, it is the other side that is actually the front. It is the side with the depression for mixing the cosmetics for adorning the cult statue, and so it would seem that the scene of the king marching in procession to view a pile of decapitated bodies is the really important message.

An interview with Max Brooks, author of The Zombie Survival Guide,  conducted in April of 2006, provides a more detailed reconstruction of the evidence for man’s ongoing war with the zombies:

The theory of “Undead Evolutionary Influence” has many supporters in the paleoanthropological community. Louis Leakey even mentioned it in his ground-breaking paper “Lucy Fights a Ghoul.” However, in order to test this theory, one would have to clone our pre-human ancestors, then infect them with the zombie virus.

All discussions of these various zombie related resources tend to include the phrase tongue in cheek — a term I am not familiar with — which suggests the visceral experience of a zombie devouring its own tongue in the early stages of zombification.  Whatever the true origin of this term, it is clear that zombies and tongue in cheek will indelibly be linked in my mind.

What Mary Knows

metropolis1

Software engineering is a young discipline.  The process of developing software has been compared to building houses (software patterns), craft (pragmatic programming), gardening, manufacturing on an assembly line (ask your boss about this), and no doubt other metaphors will appear as the discipline’s teeth get lengthier.

Despite the relative youth of the profession, and despite the constantly changing nature of the game, there are nevertheless certain articles about the industry, the discipline, the phenomenon of software programming that have proven to be indispensable, if only because they continue to reveal truisms about ourselves, as coders, that we continue to forget.  The simplest lesson is that software projects are always harder than we think they are going to be.

What Mary Knows is a philosophical essay by Frank Jackson which poses a thought experiment in order to explore what we mean when we speak of ‘knowing’.  Mary is an imaginary person locked in a darkened room and deprived of all sense impressions.  At the same time, she is fed all the knowledge she needs in order to develop a scientifically descriptive and scientifically full picture of the world.  Eventually she is released from her room and encounters something she has never comes across before, despite the completeness of her education.  She comes across the color yellow, and finds that she doesn’t ‘know’ what it is.

Software developers often suffer from a similar condition.  While we feel fully knowledgeable about the specific things, and the specific trends, we are currently working on in our cubicles, we tend to lose sight of the big picture. 

To this end, I’ve been trying to build up a library of things every developer should know.  The only condition on this canon is that the articles must be publicly accessible for, to my thinking, if an article is hard to get or is something that someone else is making money off (which they certainly deserve to — I don’t have a particular beef with monetizing denken) then it is not something that everyone needs to know.  That’s a bit of sophistry, of course, but it serves my purposes.  Any suggestions for extending this list (quite short at the moment) are most welcome.

Here’s the beginnings of the canon:

1. Alan Turing’s 1950 essay, Computing Machinery and Intelligence — software programming constantly runs into questions about artificial intelligence, if only because, in developing business solutions, we often are trying to translate human activities into software enforced rules.  This article is the original source for many of these considerations.

2. Vernor Vinge’s influential 1993 article on The Singularity — if the Turing paper tells us where software developers come from, Vinge’s paper tells us where we may be headed.  It combines two notions: first Moore’s Law, which has become a metaphor for the exponential rate at which technology improves, and second the observation that we are not in control of this progress.

3. Nicholas Carr’s IT Doesn’t Matter is rather hard to find, but is important in that it questions the primacy of software development, and proposes that we, as software developers, may all be working ourselves out of a job.

4. Fred Brooks’s No Silver Bullet tells us why software development on reasonably large projects is so, very hard.  More importantly, he reveals some of the preconceptions that often make it harder than it needs to be, and dooms us to frequent failures.  Brooks’s essay The Mythical Man-Month is also essential reading, but I cannot find an Internet source for it, alas (fortunately, the title, for the most part, tells you what you need to know).

5. In the same vein as Fred Brooks’s skeptical essays about the nature of software development is Michael Oakeshott’s Rationality in Politics.  Though not really about software programming, it does examine some of the preconceptions about rationality that underpin how we view software programming, and provides some intellectual underpinnings for Fred Brooks’s work, should you like to explore it.

The Oakeshott also makes a good segue for discussing some free podcasts worth listening to.  Since I spend an inordinate amount of time in Atlanta traffic, I am always on the lookout for these sorts of things.  And like the software canon above, I like my listening to be free.

First, you might enjoy Learn Out Loud’s philosophy podcast.  By subscribing to this podcast through iTunes, you have the opportunity to listen to dramatic readings of the major philosophers, including Plato, Aristotle, Hobbes, Hume and Wittgenstein.  This may seem, at first, like a recipe for falling asleep at the wheel, but they are actually quite engaging, thanks largely to the fact that the reader used in most of these recordings is a dead-ringer for Captain Picard from TNG.

(For some reason, I get many hits for Kierkegaard’s essay The Crowd is Untruth on my blog.  For those readers, in particular, I’d like to point out that Learn Out Loud has a 3.6 MB download of K’s essay.)

You might get a kick out of Open Court Publishing’s podcast of excerpts from their Popular Philosophy series.  Subscribe today, and you will have the opportunity to hear:

  • Why Make a Matrix? And Why You Might Be in One
  • Enjoying the So-Called Iced Cream: Mr. Burns, Satan, and Happiness 
  • Seven Lessons in Philosophy You Already Learned Playing Texas Hold’Em
  • When They Aren’t Eating Us, They Bring Us Together: Zombies and the American Social Contract
  • Tony Soprano as Ethical Manager
  • Monty Python and David Hume on Religion
  • … and many more …

Proost 133t

Madeleine

 

This is my first public translation effort, other than several fruitless attempts to translate Baudelaire as an undergraduate.  This translation is based on Moncrieff’s excellent work.  I beg your indulgence, and wud, natchrli, appreshi8 ani correkshunz u wud lik 2 offr:

teh siet uv teh littl madeleine had rekalld nuthn 2 my mind b4 i tastd it… prhps bcuz i had so ofn seen such thingz in teh meantiem witowt tastin dem… on teh trez in pastri-cookz windowz… dat ther imaeg had disposezd itzlf frum thoz Combray dayz 2 tak itz plaz among othrz mor recent… prhps bcuz uv thoz memriz… so long abandund n put owt uv mind… nuthn now survivd… evrthn wuz skattrd. teh shaepz uv thingz… incldng dat uv teh lttl skallop-shell uv pastri, so richli senshual undr itz seveer, religuz foldz, wir ithr obliter8d or had bin so long dormnt as 2 hav lost teh pwr uv expanshun wich wud hav allowd dem 2 resuem ther plaz n mi conchuznez.  but wen frum a long distnt past nuthn subsitz… aftr teh peepl r ded… aftr teh thingz r brokn n skattrd… tayst n smel aloen… mor fragl but mor endurin… mor unsubstanshl… mor persistnt… mor f8hfl… remain poyzd a long tiem… liek soulz… remembrin… w8in … hopin … amid teh ruinz uv all teh rest.  n baer unflinchnli… in teh tini n almoz impalpabl drop uv ther essenz… teh vast struktur uv rekollekshun.

Technical Interview Questions

flogging

Interviewing has been on a my mind, of late, as my company is in the middle of doing quite a bit of hiring.  Technical interviews for software developers are typically an odd affair, performed by technicians who aren’t quite sure of what they are doing upon unsuspecting job candidates who aren’t quite sure of what they are in for.

Part of the difficulty is the gap between hiring managers, who are cognizant of the fact that they are not in position to evaluate the skills of a given candidate, and the in-house developers, who are unsure of what they are supposed to be looking for.  Is the goal of a technical interview to verify that the interviewee has the skills she claims to possess on her resume?  Is it to rate the candidate against some ideal notion of what a software developer ought to be?  Is it to connect with a developer on a personal level, thus assuring through a brief encounter that the candidate is someone one will want to work with for the next several years?  Or is it merely to pass the time, in the middle of more pressing work, in order to have a little sport and give job candidates a hard time?

It would, of course, help if the hiring manager were able to give detailed information about the kind of job that is being filled, the job level, perhaps the pay range — but more often than not, all he has to work with is an authorization to hire “a developer”, and he has been tasked with finding the best that can be got within limiting financial constraints.  So again, the onus is upon the developer-cum-interviewer to determine his own goals for this hiring adventure.

Imagine yourself as the technician who has suddenly been handed a copy of a resume and told that there is a candidate waiting in the meeting room.  As you approach the door of the meeting room, hanging slightly ajar, you consider what you will ask of him.  You gain a few more minutes to think this over as you shake hands with the candidate, exchange pleasantries, apologize for not having had time to review his resume and look blankly down at the sheet of buzzwords and dates on the table before you.

Had you more time to prepare in advance, you might have gone to sites such as Ayenda’s blog, or techinterviews.com, and picked up some good questions to ask.  On the other hand, the value of these questions is debatable, as it may not be clear that these questions are necessarily a good indicator that the interviewee had actually been doing anything at his last job.  He may have been spending his time browsing these very same sites and preparing his answers by rote.  It is also not clear that understanding these high-level concepts will necessarily make the interviewee good in the role he will eventually be placed in, if hired. 

Is understanding how to compile a .NET application with a command line tool necessarily useful in every (or any) real world business development task?  Does knowing how to talk about the observer pattern make him a good candidate for work that does not really involve developing monumental code libraries?  On the other hand, such questions are perhaps a good gauge of the candidate’s level of preparation for the interview, and can be as useful as checking the candidate’s shoes for a good shine to determine how serious he is about the job and what level of commitment he has put into getting ready for it.  And someone who prepares well for an interview will, arguably, also prepare well for his daily job.

You might also have gone to Joel Spolsky’s blog and read The Guerrilla Guide To Interviewing in order to discover that what you are looking for is someone who is smart and gets things done.  Which, come to think of it, is especially helpful if you are looking for superstar developers and have the money to pay them whatever they want.  With such a standard, you can easily distinguish between the people who make the cut and all the other maybe candidates.  On the other hand, in the real world, this may not be an option, and your objective may simply be to distinguish between the better maybe candidates and the less-good maybe candidates.  This task is made all the harder since you are interviewing someone who is already a bit nervous and, maybe, has not even been told, yet, what he will be doing in the job (look through computerjobs.com sometime to see how remarkably vague most job descriptions are) for which he is interviewing.

There are many guidelines available online giving advice on how to identify brilliant developers (but is this really such a difficult task?)  What there is a dearth of is information on how to identify merely good developers — the kind that the rest of us work with on a daily basis and may even be ourselves.  Since this is the real purpose of 99.9% of all technical interviews, to find a merely good candidate, following online advice about how to find great candidates may not be particularly useful, and in fact may even be counter-productive, inspiring a sense of inferiority and persecution in a job candidate that is really undeserved and probably unfair.

Perhaps a better guideline for finding candidates can be found not in how we ought to conduct interviews in an ideal world (with unlimited budgets and unlimited expectations), but in how technical interviews are actually conducted in the real world.  Having done my share of interviewing, watching others interview, and occasionally being interviewed myself, it seems to me that in the wild, technical interviews can be broken down into three distinct categories.

Let me, then, impart my experience, so that you may find the interview technique most appropriate to your needs, if you are on that particular side of the table, or, conversely, so that you may better envision what you are in for, should you happen to be on the other side of the table.  There are three typical styles of technical interviewing which I like to call: 1) Jump Through My Hoops, 2) Guess What I’m Thinking, and 3) Knock This Chip Off My Shoulder.

 

Jump Through My Hoops

tricks

Jump Through My Hoops is, of course, a technique popularized by Microsoft and later adopted by companies such as Google.  In its classical form, it requires an interviewer to throw his Birkenstock shod feet over the interview table and fire away with questions that have nothing remotely to do with programming.  Here are a few examples from the archives.  The questions often involve such mundane objects as manhole covers, toothbrushes and car transmissions, but you should feel free to add to this bestiary more philosophical archetypes such as married bachelors, morning stars and evening stars, Cicero and Tully,  the author of Waverly, and other priceless gems of the analytic school.  The objective, of course, is not to hire a good car mechanic or sanitation worker, but rather to hire someone with the innate skills to be a good car mechanic or sanitation worker should his IT role ever require it.

Over the years, technical interviewers have expanded on the JTMH with tasks such as writing out classes with pencil and paper, answering technical trivia, designing relational databases on a whiteboard, and plotting out a UML diagram with crayons.  In general, the more accessories required to complete this type of interview, the better.

Some variations of JTMH rise to the level of Jump Through My Fiery Hoops.  One version I was involved with required calling the candidate the day before the job interview and telling him to write a complete software application to specification, which would then be picked apart by a team of architects at the interview itself.  It was a bit of overkill for an entry-level position, but we learned what we needed to out of it.  The most famous JTMFH is what Joel Spolsky calls The Impossible Question, which entails asking a question with no correct answer, and requires the interviewer to frown and shake his head whenever the candidate makes any attempt to answer the question.  This particular test is also sometimes called the Kobayashi Maru, and is purportedly a good indicator of how a candidate will perform under pressure.

 

Guess What I’m Thinking

brain

Guess What I’m Thinking, or GWIT, is a more open ended interview technique.  It is often adopted by interviewers who find JTMH a bit too constricting.  The goal in GWIT is to get through an interview with the minimum amount of preparation possible.  It often takes the form, “I’m working on such-and-such a project and have run into such-and-such a problem.  How would you solve it?”  The technique is most effective when the job candidate is given very little information about either the purpose of the project or the nature of the problem.  This establishes for the interviewer a clear standard for a successful interview: if the candidate can solve in a few minutes a problem that the interviewer has been working on for weeks, then she obviously deserves the job.

A variation of GWIT which I have participated in requires showing a candidate a long printout and asking her, “What’s wrong with this code?”  The trick is to give the candidate the impression that there are many right answers to this question, when in fact there is only one, the one the interviewer is thinking of.  As the candidate attempts to triangulate on the problem with hopeful answers such as “This code won’t compile,” “There is a bracket missing here,” “There are no code comments,” and “Is there a page missing?” the interviewer can sagely reply “No, that’s not what I’m looking for,” “That’s not what I’m thinking of, “That’s not what I’m thinking of, either,” “Now you’re really cold” and so on.

This particular test is purportedly a good indicator of how a candidate will perform under pressure.

 

Knock This Chip Off My Shoulder

eveready

KTCOMS is an interviewing style often adopted by interviewers who not only lack the time and desire to prepare for the interview, but do not in fact have any time for the interview itself.  As the job candidate, you start off in a position of wasting the interviewer’s time, and must improve his opinion of you from there.

The interviewer is usually under a lot of pressure when he enters the interview room.  He has been working 80 hours a week to meet an impossible deadline his manager has set for him.  He is emotionally in a state of both intense technical competence over a narrow area, due to his life-less existence for the past few months, as well as great insecurity, as he has not been able to satisfy his management’s demands. 

While this interview technique superficially resembles JTMFH, it is actually quite distinct in that, while JTMFH seeks to match the candidate to abstract notions about what a developer ought to know, KTCOMS is grounded in what the interviewer already knows.  His interview style is, consequently, nothing less that a Nietzschean struggle for self-affirmation.  The interviewee is put in the position of having to prove herself superior to the interviewer or else suffer the consequences.

Should you, as the interviewer, want to prepare for KTCOMS, the best thing to do is to start looking up answers to obscure problems that you have encountered in your recent project, and which no normal developer would ever encounter.  These types of questions, along with an attitude that the job candidate should obviously already know the answers, is sure to fluster the interviewee. 

As the interviewee, your only goal is to submit to the superiority of the interviewer.  “Lie down” as soon as possible.  Should you feel any umbrage, or desire to actually compete with the interviewer on his own turf, you must crush this instinct.  Once you have submitted to the interviewer (in the wild, dogs generally accomplish this by lying down on the floor with their necks exposed, and the alpha male accepts the submissive gesture by laying its paw upon the submissive animal) he will do one of two things;  either he will accept your acquiescence, or he will continue to savage you mercilessly until someone comes in to pull him away.

This particular test is purportedly a good indicator of how a candidate will perform under pressure.

 

Conclusion

moderntimes

I hope you have found this survey of common interviewing techniques helpful.  While I have presented them as distinct styles of interviewing, this should certainly not discourage you from mixing-and-matching them as needed for your particular interview scenario.  The schematism I presented is not intended as prescriptive advice, but merely as a taxonomy of what is already to be found in most IT environments, from which you may draw as you require.  You may, in fact, already be practicing some of these techniques without even realizing it.

Gypsy Groove

sleeping

Why are gypsies commonly believed to be able to foretell the future?

This is the question that sets Pierce Moffett, the hero of John Crowley’s novel Aegypt, in search of the true origin of the Roma, and with it the true meaning of history.  In his novels about Moffett, Crowley unravels a world in which history not only can be broken into different periods (The Dark Ages, The Renaissance, The Enlightenment, et. al.), but in which the rules by which the world works shifts and ruptures between these eras. 

And there are in fact people who believe such things.  A friend once told me about a history professor of his who lectured on the prevalence of sightings of angels and spirits in Medieval and Renaissance literature, and questioned how so many people could believe such things.  His radical conclusion, which he believed irrefutable, was that such things must have once been real.

John Crowley himself is a skeptic on such matters, as people often are who play too much at pretending to believe.  At a certain point, one must choose either to cross the line into a possible madness, or draw back into a more definite epoche — a suspension of belief.

We, who have not stepped so deeply into these mysteries, are in a safer position to toy with possibilities, engaging in what Coleridge called the suspension of disbelief.  It is what allows us to understand and even share in Don Quixote’s delusions, without thereby succumbing to them ourselves.

When I lived in Prague a few years back, there were stories about a gypsy bar on the edge of the city where one could meet gypsy princes and sip absinthe, a concoction that is illegal in much of the developed world.  I never went of course, partly from a lack of courage, and partly out of a fear that confronting the thing itself would dispel for me the image I had already formed in my imagination of that magic place.

Over the years, I’ve privately enjoyed several fantasies about that bar.  In some of these, I drink the absinthe and am immediately transformed, through a sudden revelation, into a passionate artist who spends the rest of his life trying to paint something he cannot quite capture.  In others, I am accosted by a gypsy prince, and, defeating him in a bloody duel with knives, I leave with his gypsy bride.  In most, I simply am kidnapped by the gypsies while in the grips of an absinthe induced haze, and eventually learn their ways and join their tribe, traveling across Europe stealing from the rich and conning the gullible.

Such is my secret life, for what it is worth.  Inspired by this secret dream to be a gypsy, I have been listening to an album called Gypsy Groove, groove being the postpositional modifier that does in the 21st century what hooked-on did for us in the 20th.  The copywriting claims it is “a collection of Balkan beats, gypsy jams and other treats from the leaders of this vibrant music scene.”  I prefer the way my son (a natural poet, I believe) describes it: “it makes my ears sing and my butt dance.”  I am especially fond of the song Zsa Manca, by the Czech group !DelaDap.

According to Pierce Moffett, the gypsies are refugees from a time that no longer exists, from a country called, not Egypt, but rather its mythical homophone, Aegypt.  In order to explain this strange origin, Crowley builds a fictional story on top of a true story about how scholars in the Renaissance mistakenly projected the origins of certain texts, already ancient in their own time, to a pre-history even more ancient, and a provenance somewhere in the geographical Egypt.

If you don’t already know this story (either the false one or the real one), and you have the patience for it, here is John Crowley’s explanation of both, from Love & Sleep:

It was all true: there really had once been a country of wise priests whose magic worked, encoded in the picture-language of hieroglyphics.  That was what Pierce had learned in his recent researches.  It did lie far in the past, though not in the past of Egypt.  It had been constructed long after the actual Egypt had declined and been buried, its mouth stopped because its language could no longer be read.

And this magic Egypt really had been discovered or invented in Alexandria around the time of the Christianization of the Roman Empire, when a Greek-speaking theosophical cult had attributed some mystical writings of their own to ancient priests of an imaginary Egyptian past of temples and speaking statues, when the gods dwelt with men.   And then that imagined country really had disappeared again as those writings were lost in the course of the Christian centuries that followed.

And when they were rediscovered — during the Renaissance in Italy, along with an entire lost past — scholars believed them to be really as ancient as they purported to be.  And so a new Egypt, twice different from the original, had appeared: ancient source of knowledge, older than Moses, inspiring a wild syncretism of sun-worship, obelisks, pseudo-hieroglyphs, magic and semi-Christian mysticism, which may have powered that knowledge revolution called science, the same science that would eventually discredit imaginary Egypt and its magic.

And yet even when the real Egypt had come to light again, the tombs broken open and the language read, the other country had persisted, though becoming only a story, a story Pierce had come upon in his boyhood and later forgot, the country he had rediscovered in the City in the days of the great Parade, when he had set out to learn the hidden history of the universe: the story he was still inside of, it seemed, inescapably.

Aegypt.

Just this year, John Crowley finally published the fourth book in his Aegypt Quartet, bringing the series to a close.  It is called Endless Sleep.

Giornale Nuovo Stops Its Presses

gn

 

Giornale Nuovo, a blog written anonymously by someone calling himself Misteraitch, is coming to an end after five years.  Without any exaggeration, it has been one of the best things available on the net over that time, and Misteraitch’s  efforts will be sorely missed.

Giornale Nuovo falls into that strange category of erudite blogs in which the author takes a personal passion and draws one into it.  M.’s passion happens to be rare books, and in particular rare illustrated books.  Based in Italy, and later somewhere in Scandinavia, he would haunt the odd bookstores of Europe tracking down rumors of quaint and curious volumes of forgotten lore — so to speak — and once acquired, he would digest them through his scanner and publish them on his blog, pointing out the peculiarities of his acquisitions.  He is also an art lover, and was quite good at finding painters, sculptors, and installation artists that you had never heard of before but whom, after reading the blog, you would never forget.

And now, M. is hanging up his spurs.  Fortunately, he will be leaving the archives of his blog up for a while, giving readers a chance to catch up on his industriousness somewhat belatedly — I almost said posthumously.  M.’s main complaint, I take it, is exhaustion.  It takes much out of a person to continuously publish writing of this caliber, and no doubt M. was concerned that his output would eventually flag.  Going through the archives, however, I see little sign of this.  All the entries are consistently good.  Take, for instance, his contribution to our common knowledge with Curiosities of Literature, or his frequent entries on Emblem Books, or this one about Anthropomorphic Alphabets.  These I selected randomly, just to give you a taste of what I have been enjoying for many months.

M. is also rightly famous for his giveaways.  Every so often, he would decide that his bookshelves were too full, or his CD collection too disorganized, and he would simply list the overflow of books or music on his site, with charming descriptions, and then mail them, gratis, to the first person who showed any interest (one year I received Rachmaninov’s Vespers from him). 

Such generosity was not uncommon with M., and his entire site is, in fact, a five year act of generosity in which he artfully lay out his personal tastes for the world to view.  If you have never visited Giornale Nuovo before, then I heartily recommend that you take this opportunity to browse through its archives while it is still available.  It is a monument of the Internet not to be missed, and a rare example of how technology, rather than twisting the human soul, can actually make it soar.

Install Visual Studio 2008 beta without a DVD Burner

I had a weird problem with my DVD player, such that while I was able to burn the Visual Studio 2008 image successfully, I was not able to use it to install.  Instead, the DVD would just lock up my XP operating system.  So I resorted to my backup plan, which involved simply mounting the image as if it were a media device and running the install from there.

I was able to do this using free software provided by Microsoft called the XP Virtual CD Control Panel.  But first, a public service message: beta software such as Visual Studio 2008 should not be installed on a production machine since it is not supported.  Likewise, the Virtual CD Control Panel is unsupported, by which I mean if you have problems with this you can’t call Microsoft for help, and should be installed at your on risk.

With that out of the way, the Visual Studio 2008 (Orcas) beta image file can be downloaded here, while the Virtual CD software can be gotten here.  The Virtual CD download is a executable zip file, which you should unzip to an easily accessible location on your harddrive.  It includes the VCdControlTool executable, a readme file, and a file called VCdRom.sys.  Copy VCdRom.sys file to your system32\drivers directory.

VCdControlTool

  1. Run VCdControlTool.exe
  2. On the first run, the driver will not have been loaded yet, so click “Driver control”, click “Install Driver”, navigate to the %systemroot%\system32\drivers folder, select VCdRom.sys, and click Open. Click “Start”. Click OK.
  3. Click “Add Drive” to add a drive to the drive list. Ensure that the drive added is not a local drive. If it is, continue to click “Add Drive” until an unused drive letter is available.
  4. Select an unused drive letter from the drive list and click “Mount”.
    Navigate to the directory to which you downloaded the OrcasBeta2VSTSX1394647.img image file.   In your dialog window, change the “files of type” option to All files (“*”). Now you should be able to see the Visual Studio 2008 image file. 
  5. Select the image file and click “OK”.  (You can leave all the option check boxes unselected.)
  6. Return to your windows browser, where you should find the image file under Devices with Removable Storage.  Double click it to begin the install.

orcasinstall

Session Expired Monitor with ASP.NET AJAX

timeout

code download

Sessions are a way of preserving information on a web site between page hits, allowing the programmer to emulate a stateful application when, in fact, web pages are not really stateful.  They are also one of the banes of web development, since sessions eventually timeout when there is no interaction between the user and the web app for a prolonged period of time.  In ASP.NET, this period has a default of 20 minutes, which is really hardly enough time to pick up a donut, refill one’s coffee, and chat with fellow workers before returning to one’s computer.  What this often means is that the user, upon returning to their computer and continuing work after a 20 minute break will find that all of the data entry they have been doing has been lost.  Worse, strange errors will begin to appear in his web browser if the loss of a session is not handled gracefully. 

The most common workaround is to increase the session grace period, called the session timeout.  This is set in your web.config file, and typically looks like this (the timeout period is measured in minutes):

  <system.web>
    <sessionState
      mode="InProc"
      cookieless="false"
      timeout="20"
     />
  </system.web>

A second way of handling this is to add extra code to an app that keeps the session state alive even if the user isn’t doing anything.

A third, and the most common, way is to provide code that redirects a user to a “session expired” page if they try to interact with a web page for which the session has timed-out.  This can be a bit awkward, however, since it is a passive solution that can cause the user some dismay as they hit a submit key only to be taken to a completely unexpected page.

This post deals with an active approach to the same problem.  When the user’s session has expired, it will generate a popup message in the user’s browser window letting him know that he has been inactive for too long.  Additionally it can redirect the browser to a new page with a warning message letting him know what happened.  The user still loses all of his work, of course, but at least this way he knows what happened when he returns to his desk following his coffee break.

This solution uses three tricks.  One is the event model for Master Pages in ASP.NET:  whenever a Content Page is refreshed, its OnLoad event is called,  along with the OnLoad events of the Master Page and any user controls hosted by either the Content Page or the Master Page (the actual order of these events is 1. controls on the Master Page, 2. controls in the Content Page, 3. the Master Page and finally 4. the Content Page).

The second trick is the way ASP.NET Extensions Timer control gets reset.  This is done simply by setting the interval to a new value.  Every time the interval is set to a new value, or even the same value, the countdown on the timer begins again.

The third trick is that the session timeout one sets in the web.config file can be read programmatically simply by querying a property of the Session object.

Putting all of this together, one can build a web user control that simply sits on a Master Page and knows when the user session is ready to expire.  It resets itself to the full timeout period any time a Content Page is refreshed.  when the session expires, the user control can raise an informative message, redirect to another page, or, potentially, simply extend the session timeout (not covered here, but easy to do if you are interested).

A user control to monitor the session timeout is included in the code sample linked at the top of this post.  Here is how you can build your own.

Session Timeout Monitor Recipe:

Ingredients:

  • One Master Page
  • One User Control
  • An Update Panel
  • An ASP.NET Ajax Extensions Timer
  • A Panel control
  • A Button control

1. Create a new User Control in your project. 

2. Drop an Update Panel on the User Control and set its mode property to “Always”.

3. Add an Extensions Timer (not to be confused with the Futures TimerControl) to your project, dropping it in the Update Panel.  Name it TimerTimeout.

Normally, this configuration of the timer control and a conditional update panel is used to refresh a portion of a web page on a regular schedule, for instance in order to create a self-updating clock display.  In this case, however, the timer and update panel are used simply to trigger a notification that the session has expired. 

4. In the User Control’s code behind, add the following lines to the OnLoad event:

        protected void Page_Load(object sender, EventArgs e)
        {
            int milliseconds = 60000;
            TimerTimeout.Interval = Session.Timeout * milliseconds;
        }

This event will be called any time a content page is refreshed.  Whenever this happens, the code inside the event handler resets the AJAX Extensions Timer control to the full session lifespan as set in the web config file, in effect making the timeout for the Timer match the timeout for the session.

Since the Timer control’s Interval property is measured in milliseconds, while the session.Timeout is measured in minutes, a conversion factor of sixty thousand must be used to translate one time period into the other.

To finish this notifier, the Timer’s Tick event needs to be handled.  The Tick event gets called when the Timer’s Interval finally runs out.  In this implementation, the Tick event can either generate a popup message or cause a page redirect.

5. Place a Panel inside the Update Panel.  Set its Visible property to false.

6. Write a simple message inside the Update Panel, such as “Your session has expired.”

7. Drop a Button inside the Panel.  This Button will be used to allow the user to hide the popup message.

8. Add a public property to the User Control called SessionExpiredRedirect:

        private string _sessionExpiredRedirect;

        public string SessionExpiredRedirect
        {
            get { return _sessionExpiredRedirect; }
            set { _sessionExpiredRedirect = value; }
        }

This will be used to set the web page to which the Timer will redirect the user upon session timeout.  If no value is set, a popup message will appear, instead.

9. Handle the Timer’s Tick event:

        protected void TimerTimout_Tick(object sender, EventArgs e)
        {

            if (!string.IsNullOrEmpty(SessionExpiredRedirect))
            {
                if (SessionExpiredRedirect.IndexOf("~")==0)
                    Response.Redirect(
                        VirtualPathUtility.ToAppRelative(
                        SessionExpiredRedirect));
                else
                    Response.Redirect(SessionExpiredRedirect);
            }
            else
                this.PanelTimeout.Visible = true;
        }

This handler checks to see if a value has been set for the SessionExpiredRedirect property.  If not, it makes the Panel control inside the Update Panel visible.

10. To make the Panel control truly popup, set its CssClass property to “timeoutMessage”.  Add the following css style to the page.

<style type="text/css">
.timoutMessage
{
    position:absolute;
    top:100px;
    left:200px;
    background-color:#F5F7F8;
    border-style:groove;
    border-color:Navy;
    padding:15px;
}
</style>

11. Finally, compile this User Control and drag it on to the Master Page.  In design mode, the user control will display a misleading exception message.  Just ignore it.

12. Make sure the Master Page includes an ASP.NET AJAX Script Manager component.

This completes the recipe.  Any Content Page in this project will now automatically include the timeout monitor you have built.  Cookies are optional: this recipe will work with a session managed either with cookies or in cookieless mode.  It will only work if the session mode is InProc.

Garnish with buttered radishes.  Serve at room temperature.

(Code snippets formatted using manoli.net.)

C Sharp’s Double Question Mark Operator Recipe (??)

riddler

At a recent Microsoft conference, the presenter did some quick programming that raised a gasp of excitement from the audience (I kid you not).  He inserted two question marks in a line of code as if they were an operator and Intellisense did not protest.

“Is that a new language feature in .NET 3.5?”, a member of the audience asked.

The presenter looked somewhat puzzled.  “No, it’s in 2.0.” 

At which point half the audience suddenly realized that this was a secret 2.0 feature they could now use to impress friends and colleagues, while the other half smiled knowingly because they had been using it for over a year.  Such is the way programmers distinguish the wheat from the chaff.

So, if you aren’t using the Null Coalesce Operator, yet, you should.  It is basically a syntactic device for setting a default value for nullable types.  The ?? Operator is the equivalent of the ISNULL function in T-SQL, or the NVL function in PL-SQL, and is very handy when you are trying to translate database values into your business classes.

If, for instance, you have a nullable number type in your Oracle database, or a nullable int in your SQL Server database, it is very convenient to map this to a nullable int in your C# business object.

int? myNum = null;

or

Nullable<Int32> myNum = null;

Being now able to represent this database value, you probably also want to be able to test for the null case and return an alternative value if it turns out to be true.  Here are four ways to do the same thing, in increasingly cool ways, because they are increasingly obscure.

With an IF ELSE block:

if (null == myNum)
    return -1;
else
    return myNum.GetValueOrDefault();

With a SWITCH block:

switch (myNum)
{
   case null:
        return -1;
   default:
        return myNum.GetValueOrDefault();
}

With a Ternary Operator:

return myNum == null ? -1 : myNum.GetValueOrDefault();

And with a Null Coalesce Operator:

return myNum ?? -1;

 

For those who think that in coding compactness == elegance, then this is the syntax for you.  For everyone else, it is a nice recipe you can use to impress co-workers at the next code review.  The most likely, and desirable, response will be:

??