Feb 16, 2012

Jedi programmers

There are three levels of coding that you can master: dumb, professional and jedi.

Dumb level is for those, who go for straight solutions, who never learn anything new, who do not care to find a better solution that they already know. Dumb programmers are best seen when they receive a bug report. Upon receiving a report, they start adding messages to the web page content at every possible code point, including points that are far from the cause of the problem (meanwhile visitors wonder what does that rubbish mean on the site). Sometimes dumb programmers just go and “fix” the issue by making the straightest, fastest and dumbest solution possible: the solution, which is neither good, nor it is entirely correct. Fixing typically happens on the live host and disrupts host's work with error messages and down times. Well, it is dumb.

Professional level is for those, who understand the importance of learning, the priority of the quality and that the first solution is not necessarily the best one. When it comes to bug fixing, they realize that to fix the issue, they need to find its cause. Professional people typically investigate first. Often they use developer's log, debug messages that are visible only to them or a debugger. People, who mastered the debugger, usually figure out the cause of the bug faster. Next they try to resolve the bug in a good way. Professionals do not take the first obvious approach but try to evaluate it from all sides and see the consequences of their fixes. They usually work at development host and choose to integrate their changes to the live environment with no or minimal disruption.

Jedy never do like dumb people but they often do the same as professional people do. Often, but not always. For example, with bugs a jedy can investigate the bug by just clicking and looking. Often they do not need to use the debugger or debug messages at all. And here I can't resist posting a quote from a sixth Harry Potter book:

Dumbledore was standing in the middle of the cave, his wand held high as he turned slowly on the spot, examining the walls and ceiling.

"Yes, this is the place," said Dumbledore.

"How can you tell." Harry spoke in a whisper.

"It has known magic," said Dumbledore simply. Harry could not tell whether the shivers he was experiencing were due to his spine-deep coldness or to the same awareness of enchantments. He watched as Dumbledore continued to revolve on the spot, evidently concentrating on things Harry could not see. "This is merely the antechamber, the entrance hall," said Dumbledore after a moment or two. "We need to penetrate the inner place. . . . Now it is Lord Voldemort's obstacles that stand in our way, rather than those nature made. . . ." Dumbledore approached the wall of the cave and caressed it with his blackened fingertips, murmuring words in a strange tongue that Harry did not understand. Twice Dumbledore walked right around the cave, touching as much of the rough rock as he could, occasionally pausing, running his fingers backward and forward over a particular spot, until finally he stopped, his hand pressed flat against the wall. "Here," he said.

"We go on through here. The entrance is concealed." Harry did not ask how Dumbledore knew. He had never seen a wizard work things out like this, simply by looking and touching; but Harry had long since learned that bangs and smoke were more often the marks of ineptitude than expertise. Dumbledore stepped back from the cave wall and pointed his wand at the rock. For a moment, an arched outline appeared there, blazing white as though there was a powerful light behind the crack.

This is how a "jedi" works. Jedies do not need bangs and smoke. They do the work by looking and thinking. They evaluate options and go for the best one. And they always succeed.

Jedi's success comes from the experience and character. Not everyone can become a jedi. Mostly people stop at professional level. When you become a jedi, you start feeling the code. You start seeing the perspective. It is almost mystical how you know what will happen next, where the trouble is and how to fix it. It is inexplainable. You just know it. It comes to your head.

How to become a jedy? Think more. Always think before you do something. Think what will happen if you apply the solution. What will change? How it will affect other modules? Could you do it differently? How? Why? Will it be better or worse? Make a circle asking the same questions again and again until you exhaust your options. Next choose the best one. This is jedi's way.

Go on your way to become a jedi. Have luck.


  1. especially using complex code IMO it is not possible to evaluate code and its alternatives just by looking...

  2. Yes, first you must find yourself a customer who understand your way of thinking and happily pays for you looking at the code and coming up with solutions that are the best (but not fast neither cheap).

  3. @A,

    well, if the customer is willing to pay for the crap code first, for months of fixing next and than go away from the developer in disgust, than, yeah, he can live with dumb way :)

    Nobody said that thinking is slow. Actually thinking often reveals the solution, that can be implemented much faster than a first obvious but dumb solution. It makes better quality, a happier customer and a better relationship with him.

    There always be customers, who want cheap, quick and dirty. They get what they want. However, there will be always customers, who want good, clean and trouble-free solution and are willing to pay for it a bit more.

  4. Cheap clients can't afford professionals much less Jedis. These days, I spend more time puttering about code, thinking about a solution and then why it'll not work before I do much actual work. The result, my actual time needed is frequently 33% to 50% of that budgeted.

    English is a pain, first sentence, knew should be new.

    Nice write up Dmitry.

  5. Michael, thanks :) Was the text hard to read?