The Codist - Programmerthink

The Absolute Need To Understand

Posted: 02/06/2007, Perm Link Readers: 21740


One sign of a good programmer is their absolute need to understand. Whether the environment they are coding in, the language or frameworks they use, or even the theory behind what they are trying to develop, the need to understand is a driving force in people who make good programmers.

Sometimes it's hard to explain to people who are not programmers what we do. Programming is part creative, part technical, part detective and sometimes part lunacy. We work in an abstract medium that then becomes a tangible thing when people are invited to interact with it. Our job is basically telling a computer what we want it to do. The challenge comes in how really stupid the computer is, and how difficult it is to explain our needs precisely enough to get it to work correctly. So we try to abstract the problem, building on top of layers of systems that hopefully are dependable, and hoping the bits we add are also dependable. Since we can't hope to understand everything we try as much as possible to understand as little as possible to get the job done.

That's where the trouble comes in. In our haste to make things easier to work with, we begin to lack the understanding of what is going on "under the hood". Programmers that focus only on "knowing the recipes" of a particular set of systems, languages and frameworks shy away from anything new, since it would involve learning a new set of recipes (possibly unknown). With no actual understanding of how their original technologies worked, the knowledge necessary to easily move to something new is beyond them. Think of a cook who can follow a familiar recipe, and a chef who understands how food is prepared; one can do the same recipe every time but is lost when faced with a set of new ingredients, whereas the chef sees a whole set of possible dishes. Of course there are times when it's enough to follow a recipe but in our industry change happens a lot and the ability to understand how to use a new technology becomes a necessary skill.

So what do I mean by "understand"?

You want to call a method on an object supplied by some framework, so you look up the parameters and description in some document (in Java, usually javadoc). Then maybe you find an example with Google and apply it in your code. That's the recipe at work, and usually it's enough to get the job done. Later on someone reports a bug in your program, and you have no idea what's going on, as the bug report is vague, it only happens sporadically, and your clues are few and far between. Pressure mounts from management to find a solution, customers are angry, and you begin to wish for a new job. Maybe talk begins of hiring consultants or contractors to help solve the problem, or managers begin promising upper management that they (you) will work around the clock until its fixed.

Then someone looks at the code and realizes you used a hashed data structure (in Java, let say HashMap) but failed to supply a hash function, just using the default supplied by the framework. It turns out the keys your were using in the hash were not consistent with equality, and failed the assumptions of the hash structure, leading to occasionally losing objects when they were mapped to the "same" key.

I have seen this happen. Of course anyone can write buggy code, unless you are NASA and can afford to spend tens of millions on a rigid programming methodology. The difference lies in wanting to understand not just the recipe, but the reason why something works. Understanding the concept is more important than just knowing the recipe. Even if a new system is radically different than the old, the concepts remain applicable, and the need to understand how the new system works will make it easier to master.

The best programmers I have worked with understand the nature of understanding. It's why good programmers are always looking for open source alternatives, even if they never need to change the source, being able to understand what is going on inside the system is the most powerful aspect of having the source. If you need to you can even fix it. I remember dealing with BEA Weblogic 5.X and getting patches to problems I reported, which in turn generated new problems, leading to new patches which lead to new problems, etc. For my own web projects I always use Jetty. If something really stupid appears to be happening in my web application, I can even stick the jetty source into my application, and follow the path in the debugger until I do understand. If I really need help I can even communicate with the people who wrote it and have an even deeper understanding.

Yet I have also worked with a lot of programmers who are content to know one set of things, to know nothing of why they work, and who refuse to see beyond their limited skillset. A lot of companies have staffs which value a standard set of technologies, buy only commercial closed-source packages (to have someone to blame when things go wrong), and suppress any desire to learn new things. In such an environment understanding is reduced to compliance with a set of recipes. One place I interviewed a long time ago prided itself on having architects who never coded, project leads who only wrote API's and programmers who only filled in method bodies. No time for understanding, no ability to learn, no opportunity to make things better.

The concept of Tao (from the Chinese philosophy of that name) is based upon the understanding that the only constant in the universe is change. Dealing with change requires understanding far deeper than just doing your job. If you want to become a better programmer, read, play, experiment, dig into source, demand time to learn, even at your own expense. Don't just learn the basic recipes but dig into why they work.

Understand?

Dropout 02/07/2007 07:19

You may be correct that this makes for a better programmer, or you may just be rationalizing the obsessive compulsiveness of programmers like you--and me! ;)

Mike 02/07/2007 07:55

It was all going so well until this:

"It's why good programmers are always looking for open source alternatives"

Using or not using open source software is irrelevant when determing if someone is a "good" programmer.

Matt 02/07/2007 08:02

I don't think that's a good programmer. I think that's a good anything. Take a good sysadmin. He/she should want to know why they make the ndd changes on solaris as well as what is being changed as opposed to "I dunno. All the other machines are setup like this." Also, look at the example of a good chef. He/she wants to understand why a hollandaise can break and how to prevent it as opposed to just re-emulsifying with some cold water or a bit of heavy cream.

Mike #2 02/07/2007 08:17

Mike #1: On the contrary, Open Source is critical to understanding. If you don't have the source code, you are greatly hindered in this regard. Using a closed-source library is basically "faith-based programming". (Or voodoo, as I like to think of it.)

Sean 02/07/2007 08:36

I have to agree with Mike #1. I think open source software can be one way to be a good programmer, perhaps depending on the project, but I don't think it's required.

Geoffrey 02/07/2007 08:55

I'll bridge the Mikes here. I think that understanding the technologies you're using can be an important part of development, and it's certainly true that Open Source gives you another avenue to that understanding, and that other avenue can be important for the very detailed comprehension.

That said, sometimes, Open Source (and, to a lesser extent, commercial products) lack the clear documentation that make getting an initial understanding easy. This can be just as damaging.

tbwolfe 02/07/2007 09:00

great post.

Computer Engineer 02/07/2007 09:04

I have the drive to understand, so I know what you mean, but my question is, where is the reasonable end-line of understanding and the beginning of big picture abstractions?

Is it the programmer's layer where they could have solved their issues by writing automated unit tests and following a Test Driven Design approach?

Is it the object itself where a competent framework programmer should have written automated unit tests and overriden hashCode() if they've overriden equals()? The underlying Java compiler and byte code? operating system calls? computer architecture? logic design? transistors? VLSI design? Understanding of p substrates and n substrates? Understanding of electrons? quantum theory?

While I have some conceptual understanding of all of these layers, there is too much specialization for me to be an expert in all but maybe 2-3 of them. Especially with all of the layers above the "physics" layer changing so frequently, and our knowledge of the physics layer constantly changing.

I think you should be a chef, but follow superior recipes. Winging all your dishes will get you fired pretty quickly.

Student 02/07/2007 09:21

I wholeheartedly agree with your article, however your inclusion of the Tao confuses me. Taoism is all about accepting things as they are and not trying to define things (as once you've defined something you've limited it) and that you don't need to understand how it works in order to appreciate it. Confucianism, on the other hand, focuses on the understanding of everything.

landon 02/07/2007 09:39

One example where you need to understand a system clear down to the metal is when you're pushing performance. "This API needs to be structured such-and-such a way because the Flash memory we're using at the bottom has specific timing and bandwidth issues." Or modern video game consoles: You have to understand the caching architecture and the details of the GPU or you're not going to get the frame-rate you need.

I disagree with "You have to have open source." Mostly that's a nice-to-have. The down-side of having a completely exposed system is that you might -- conciously or unconciously -- couple to stuff beneath abstractions, making it much more difficult for the system to change in the future. This was rife on the first versions of the Macintosh, where programs depended on low-memory system globals that made compatibility a nightmare for the Apple folks (and for the companies whose software kept breaking) for the next decade. Sometimes "open" is bad for you.

John 02/07/2007 10:19

RE: Mike's comment -

While preference for open-source may not make or break a 'good' programmer, I have met very few good programmers who use strictly closed-source tools. As the post argues, an effective programmer is inquisitive and constantly looking to improve his or her craft. The visible nature of the open-source development ecosystem fosters these attributes whereas closed-source tools have a tendency to spoon-feed and obscure technical merit with marketing.

Gary the Llama 02/07/2007 10:36

I absolutely agree with you because I'm that kind of programmer. Unfortunately, it slows me down at times because I have to stop and do research. It's a good day if I write only two lines of code but know everything there is to know about those two lines.

Ty 02/07/2007 14:17

The open-source question is very interesting in this context. I've been developing for quite a while now, and while I probably wouldn't argue that ALL 'good programmers are always looking for open-source alternatives', I would argue that most good programmers gravitate towards open-source tools and software. They may not use them in their job all of the time, but they usually end up using them when they can. This isn't because you cannot be a a good programmer using only closed-source software, because of course you can. It's because of curiosity. If you're a person who is extra-curious, then you'll probably become a better programmer, and you'll probably also enjoy open source (you can satisfy your curiosity down to bare metal). The two don't necessarily cause each other, but they often go hand-in-hand. The worst programmers I know are not curious at all, never try to understand anything beyond what is required to do a particular job 'well enough', and don't get this 'open-source' thing at all.

Gabe da Silveira 02/07/2007 15:20

As a programmer, I choose open source more often for cost, platform support and long term stability purposes. For instance, I'll probably never look at Ruby, Apache or MySQL source code, but I do have some faith that those projects will be around for the long haul, and will continue to pursue their stated goals rather than being shelved for marketing/profitability concerns. If I build something on top of these tools I feel fairly confident that it will be able to run and be supported as long as it needs to be.

The open source tools I use for the purpose of actually looking at the source tend to be higher level stuff. Web frameworks for instance. These are more likely to contain bugs and maybe even need a little coercion beneath the abstraction in some cases as a result of greater specificity and fewer eyeballs.

Then there's a whole slew of tools for which I don't care at all. Some programmers prefer Linux because they love the ability to tinker. But personally I prefer OS X because I just want the OS to work and let me focus on what I'm interested in. I use Photoshop instead of the GIMP because I just want to push pixels as efficiently as possible.

I agree the need to understand is a prerequisite for being a good programmer. However to be a great programmer I think you need to know when you've understood enough and how to accomplish your goals balanced against future maintenance needs. To be a truly legendary programmer I think you need a vision and knack for the architecture of systems... eg. what's most important? how can the problem best be characterized? what's the simplest architecture that meets this set of needs robustly? how might the system grow in the future?

Buford Twain 02/07/2007 15:51

"Of course anyone can write buggy code, unless you are NASA and can afford to spend tens of millions on a rigid programming methodology"

Unfortunately, NASA writes buggy code as well. For example:

http://www.ksc.nasa.gov/facts/faq08.html

-Buford Twain

Danno 02/07/2007 16:13

I'm not sure just how useful Open Source is to an inquisitive programmer. I don't consider myself an idiot in terms of programming, but trying to find the code that affects what I'm doing in some of the Open Source frameworks and libraries I use can be close to maddening. If anyone here has tried to figure out how the Ruby on Rails association functionality works you might have an idea of what I'm talking about.

James Taylor 02/07/2007 18:20

I think there is also an issue of understanding the business being automated. I am not sure that the kind of deep, technical understanding you (rightly) value is compatible with also understanding the business and being able to talk to the business people who run it. And if programmers must pick between the two, how can we make sure the business logic we code into the sysem matches the business needs?

JT

http://www.edmblog.com

Stuki 02/07/2007 19:22

The need to understand is one trait of a good programmer. It needs to be balanced by an instinct for when digging deeper becomes detrimental to solving the problem at hand, and when to trust that the slightly higher level apis available work the way they claim. Or attempt to work around their peculiarities. For example, If You were tasked with building a simple, intranet frontend to a database in the 90's, using then available open source tools instead of 'shitty, bad programmer' Visual Basic would rarely be a sign of programming genius. Also, good and plentiful documentation, and an active and literate user community can make up for lack of source in many cases. Good programmers can be distinguished by the quality of their programs, not how they went about writing them.

Yaron 02/08/2007 11:25

@Stuki - I was involved with a couple of projects that requested just that sometime in the (late) 90's. And had a few others of the sort in the organization I worked for. And you could see a lot of difference between the applications of people who wanted to just get it done, using data-bound controls in VB or tools like Power Builder, and between the people who had some clue how databases work, how to write SQL, or how to create UI that fitted the user's needs better than what came bundled with the controls.

The point wasn't "open source - good, closed source - bad". It was that a tendency to check open-source solutions is good, because it shows interest in knowing how things work internally, so that you'd know what happens behind the scenes, and have a clue what to do when it doesn't work quite as it should.

@Student - Confucius didn't try to understand, and certainly didn't try to get anyone else to understand. Just to follow a set of rules. He defined how things are, how people should act, sometimes being quite vague of course (So he did expect understanding from his student, but only of the points he was trying to make, not anything else) and that is that. As a philosophy, it's practically the opposite of trying to understand. "These are the APIs, these are the docs, all you need to do is use the APIs according to what the docs say" would be how Confucius would teach programming. Though of course he'd write docs which are not well defined. ;)

Luke 02/08/2007 21:42

Have you seen Alistair Cockburn's abstract titled "Unknowable and Incommunicable"? http://alistair.cockburn.us/index.php/ASDbookextract:"Unknowableand_incommunicable" It's more about the nature of communicating knowledge, which is another crucial part of good programming, unless you're willing to rely on your programmer outliving his/her code.

Ray 02/14/2007 16:10

I agree with the statement that good programmers look for open-source projects. In the event of a problem the programmer can "do something about the problem". Possibly even apply a patch, rebuild and give it back to the community. In this case everyone benefits. The good programmer doesn't have to fight through the red-tape (to get a patch) and other people benefit from his/her willingness to debug someone else's code.

So the "good programmer/open source" comment is about taking ownership of a problem and diving into it as deep you can go.

Mike #9239 02/14/2007 23:05

I agree with mike #1. If the commercial alternative is better than the open source equivalent, then use the commercial alternative. Not all software should be open source.