Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A Tale of Two Programmers (linux.ie)
125 points by frisco on June 28, 2009 | hide | past | favorite | 55 comments


This story is troubling for several reasons.

- "Lines of code" is a meaningless metric. Please stop using it.

- Charles obviously did something when he appeared to be doing nothing. What? Unfortunately, we're never told.

- There is no treatment of the things that likely are important: analysis, design, prototyping, feedback, fine tuning, etc. Did either programmer try any of these?

- The story infers that using modern magical brilliance is better than using tried and true methods, without ever mentioning what either one is.

I can imagine this story being true. Just as likely, I can imagine the opposite being true. Nothing offered, nothing learned.


* "Lines of code" is a meaningless metric. Please stop using it.*

I can agree that LOC is a terribly abused metric, but it is not completely without meaning. It's just really rough and better left untouched in decisions involving money.

I can imagine this story being true. Just as likely, I can imagine the opposite being true. Nothing offered, nothing learned.

I think it's just an invitation to reflect on the ways that this story comes true. People mistake needless, unhelpful processes for "tried and true methods" and software "architects" frequently over-engineer and create solutions worse than the problems.

I'm not under any illusions that you (and most people here) don't already understand this. It probably wasn't aimed at you. There are many programmers today who don't understand that this kind of story plays itself out every day to some degree. The fact that the opposite story can also happen doesn't detract from the point that is being made.


No, "Lines of code" is not a meaningless metric. I recently had to take over an existing code base for a module in our system and upgrade it to support the next version of our system's ICD. After spending some time trying to wrap my head around the existing 8800 lines of code, I concluded that it would be better to do a complete rewrite. The rewrite took a week or two and ended with 1950 lines of code that did essentially the same thing!

Now, if we make the reasonable assumption that my rewrite was not a candidate for the IOCCC or Perl Golf, I think it's pretty clear that lines of code is not meaningless. A >75% code reduction while maintaining the same functionality under reasonable development conditions is almost always going to make it easier to test, debug, and maintain the system/module. (This assumption isn't unsubstantiated either. In a code review, I was even complimented on the quality of my documentation.)

You hear about these kinds of vast disparities among software developers all the time, but I still find myself shaking my head that I actually saw it in real life. Now I'll freely admit that "lines of code" is mostly meaningless the way it is usually used. But don't throw the baby out with the bath water.


What if your 1950 was less expressive and more cryptic to understand, and the 8800 was very verbose and easy for a newbie to pick up?

So you can't measure less LOC means it's better, it really depends on the quality of the code from a maintainability standpoint not just the size of code.


First of all, it wasn't. Like I said, as long as we assume reasonable effort towards readability (i.e. we're not code golfing), this kind of size difference is usually going to be much easier to maintain. Code size correlates very well with maintainability.

The guy who did the code review found the 1950 very readable, and much simpler.


On the other hand, the instant a manager starts making salary/bonuses proportional to the inverse of code size, you'll find that my assertion becomes completely false. But if you start from an empty slate of two developers making a genuine effort to code a good solution, the less LOC rule will probably be pretty accurate. Especially when one program is 4x the size of the other. (See http://paulgraham.com/head.html for a related take on the same idea.)

There are no absolutes. But that doesn't make these metrics useless.


There is actually one point missing from his list. I would put it after #5 and that is "write provable programs". I suspect Paul does this anyway, but it is a good thing to mention. This is scary to some, but PAIP has some very nice examples of this.

And rereading this essay again shows at least part of the motivation for making arc a smaller language than lisp.


I disagree: LOC is useful, but in an inverse way than many large organizations claim. Smaller is better.

As a long-time programmer, it was pretty clear to me what Charles was doing when others around him thought he was doing nothing: analysis, design.

And sometimes if you get a problem solved right, it doesn't need tuning, and if the solution is a small number of lines of code, your prototype might be just what you ship. Many large entrenched shops cannot imagine that this can possibly be true, so the bureaucracy resists or eliminates any such solutions.

To me what is troubling about this story is that it represents what happens in software organizations--both sides.


I took the 'lines of code' thing as satirizing management.


The thing that really rings true in this story for me is the difficulty that management sometimes has understanding how hard the things we do are. It particularly shows up in cases that might sound like this one, where the solution is simple but hard to see.

For instance, I recently corrected a bug in my code that had been there for a long time. The final code is dead simple. But it took years to detect the bug, and weeks of hard work and analysis to figure out that simple solution. (And of course, who knows -- maybe it's not as hard as I thought, and if I were just brilliant enough I would have instantly seen the solution. If I have no clue what the truth of the matter is, how is my (hypothetical) one step removed boss supposed to make sense of it?)


I really dislike these kind of stories. A programmer that is not understood by management.

First, they are anecdotal. Second, why are the programmers not taking control of management positions if they know so much better?

I sure would like to get to play computer games at work, design software from scratch, always end up with clear and short code, make software with usability that users love, and be showered with money.

But realistically, I think Alan created the best product for the company. He analysed what was needed, to avoid the risk of creating the wrong software. He got several programmers into the project so the bus-number was higher. He set up facilities for reporting bugs. He started testing early.

Now imagine how good Charles would be if he could learn to cooperate and participate in a group like Alan's. Once the software has been written he could leave the maintenance to the others and move on to something more interesting than maintaining accounting software.


First, they are anecdotal.

There is no inherent evil in anecdotes. This is obviously fiction and was not intended to be used as evidence. If it were, then you would have a reasonable complaint. The purpose of a little story like this is (from Wikipedia): "to reveal a truth more general than the brief tale itself, or to delineate a character trait or the workings of an institution in such a light that it strikes in a flash of insight to their very essence."

Second, why are the programmers not taking control of management positions if they know so much better?

I see this asked a lot and I don't understand why. First of all, the traits (not skills, but traits) or interests needed for taking control of management positions are different (vastly different depending on the company) than the traits/interests needed to be a good developer. Second, don't forget that our fictional hero Charles eventually quit the company and presumably found a better place. Finding a place that fits you more is sometimes better than trying to change yourself to fit the management mold in a particular company.

I think Alan created the best product for the company.

Did you read the same story I did, or are you rewriting it into your own parable?

Now imagine how good Charles would be if he could learn to cooperate and participate in a group like Alan's.

That would be good I think. Let's also imagine how good Alan could be if he could learn to see past the inflated corporate policies, procedures, and checklists and focus on the crux of the problem.


Let's also imagine many Alans (corporate engineers) and Charles (hackers) and from this bigger sample, measure how consistently each approach produces an acceptable outcome.

It may be that the Charles, on average, produce better solutions with less resources than the Alans, but that individually, more of the Charles projects fail catastrophically.

Now imagine how good Charles would be if he could learn to cooperate and participate in a group like Alan's.

Let's also imagine how good Alan could be if he could learn to see past the inflated corporate policies, procedures, and checklists and focus on the crux of the problem.

Both excellent, I think. But further, let's imagine an organization that arbitrates the risk of each Charles by simultaniously working many cheap, risky Charles on the same problem and managing the results with an Alan-like process.

If the Charles are software startups and the Alan-like process is "the Internet," this could work.


you're joking, right? Charles did analysis too, but up-front, and apparently better than Alan.


You write "first, they are anecdotal." Fictional, in fact: "once upon a time..."

And you write "second, why are the programmers not taking control of management positions if they know so much better?" That question is outside the scope of the fictional dataset of the original post, but see "Jack and the Beancounter" in http://www.skotos.net/articles/BTH_27.shtml for a related fictional study.

And you write "but realistically, I think Alan created the best product for the company." Perhaps I am just being trolled. But at least this was a good excuse to refer to Jack and the Beancounter!


There is another level to this anecdote, and that is how HN readers respond to it. It seems that some of them identify with Charles, and some with Alan. Some identify because they are or act like Alan and Charles, or they choose the opposite because they had a bad experience with someone like one of them.

In other words, in this case the reader identified with Alan because that best describes how that reader works and acts, and they are just instinctively defending their position, even though, clearly, the parable portrays Charles as the better of the two. (Of course, that could be my bias, as I identify with Charles).


The story isn't so much about the right way to solve problems, but about how management perceives competence and accomplishment. Alan did all the right things for implementing and supporting a complex piece of software. Charles accomplished the project requirements with a simple piece of software that didn't need as much support as Alan's software. The end result is far better for Charles's company, but Charles was perceived as less competent than Alan. In brief, the problem is this: management understands that complexity is the enemy, but unfortunately, management tends to judge people only by their ability to manage complexity, and not by their ability to avoid creating gratuitous complexity in the first place. That is the point of the parable.

Someday Charles will encounter a challenge that does require a complex project with sophisticated processes and support. Maybe he will fail -- after all, he hasn't proved his ability to manage such a project. However, suppose you have a project that requires four programmers, a well-documented analysis phase, and infrastructure for ongoing support. Would you really rather assign Alan to the project?

Alan did prove that he could manage a complex project. However, he also proved that he designs software that is much more complex than it needs to be. If he needed four programmers and a bunch of infrastructure to handle what should have been a one-man job, how big a team will he need to handle what should require four programmers? Sixteen is an optimistic answer. The project is likely to fail.

Plus, considering that Alan's solution created unnecessary ongoing costs in terms of training and support, how many projects can you afford to let Alan implement? Even this simple project resulted in ongoing costs in training and maintenance. Imagine if you expected Charles's solution and got Alan's instead. Blammo, there goes your budget. I hope you know where you can make some cuts so you can afford to maintain Alan's software. You talk about Charles leaving the maintenance of his code to other people. What are you talking about? His five hundred lines of simple, well-designed code needs no maintenance and can be enhanced later by any competent programmer.

There are many projects my company has done in the last several years that were simply done right and never touched again. They hide in plain sight, flawless but basically forgotten. That's the kind of code Charles produces. There are also lots of projects that we touch over and over again. That's Alan's code. Those projects have snappy names that everybody knows -- we need good names, because we refer to those projects constantly. Every little change in operating conditions exposes new bugs and requires more tinkering. They're like sores that won't heal. Everyone regrets that when we had the time and money to do those projects right -- like Charles would have -- we instead produced a never-quite-right time suck -- like Alan did. The quality and cost of maintenance of a company's software depends entirely on how much Alan code it has. The more Alan code, the more bugs and the higher the cost. A company can only support so much Alan code on a given budget. A company can support a nearly unlimited amount of Charles code.

Finally, you are unwise to assume that Charles needs to "learn to cooperate and participate in a group like Alan's." Maybe he already knows how. Should he have used more resources and incurred more overhead than he needed just to prove he knows how to manage them? That's the kind of bureaucratic head-count-whoring waste that companies are constantly trying to fight. Frugality should be encouraged, not punished.


While I agree the bus-number is an important factor. Most products, programs, languages, platforms early on were developed by 1-3 programmers, maybe closer to one.

Also, the bus number is usually only applied to programmers whereas product managers, executives, etc all dont' have the same bus number over their head. It is almost like companies hate the fact they have a valuable technologist or programmer and try to consistently offset that.

Now of course if the single programmer is not communicating or after the project is done they play complexity games then that is different (only one person can read their code) but usually I see the 1-2 man teams obliterate the 3-7 person teams on a regular basis.

Programming is not construction, the number of programmers on a project has little to do with success ever. So the bus-number is quite silly. What about the bus-number for the CEO, or the project manager, or the one person that handles billing etc.


Well, with a contrived made-up example you can prove just about anything.


It's not intended to "prove" anything. It's an anecdote, used in the simple, appropriate way that anecdotes are always used.

http://en.wikipedia.org/wiki/Anecdote


You're right, the problem with anecdotes is that they are told as innocent stories, but often serve a higher purpose, intentional or not. This one is no diffferent in that regard. An anecdote is usually written to convey a truth, a mindset or a "right way" to the reader. This is how religion gets many of its points across to the reader. It's also how a lot of racism works (I know this black guy/eskimo/Indian that never works, they're all like that) And the reader, unless he has an analytical mind which many don't, will perceive that truth or right to be exactly that.

No proof required.


I agree somewhat. An anecdote is a tool, and has been shown to have a more powerful effect on the minds of a population than solid evidence.

However, I think that anecdotes offer much more than just a way to avoid having to prove your point. They're not merely for gaining power over weak minds. They can be useful among intelligent, analytical folks as well. They can serve as a supplement to real data. They can illustrate a point of view more accurately. They can communicate a feeling or a sentiment, and can pack more meaning and generate more tangents of discussion than dry statements of fact. A startup begins with something like an anecdote, an idea that may be crazy, but stems indirectly from a myriad of past experiences.

Our brains are not binary storage units, and therefore anecdotes and parables have historically been used to help people remember things. Similarly, you cannot bring to the table a hard set of data for every life lesson that you've learned, and therefore you have many beneficial things to teach others that you cannot directly prove. If you're a good teacher, you'll tell an anecdote to help people remember (nonfictional preferred of course).


Our brains are not binary storage units, and therefore anecdotes and parables have historically been used to help people remember things.

Yes, an anecdote is a tool. It's great for remembering things, poor for proving things. It just so happens the only conceivable purpose of the original story was proving something. Now, if he had anecdote which helped you remember, say, the standard form of the quadratic equation or something else people just needed to remember, then it would be using the tool for its proper purpose.


It just so happens the only conceivable purpose of the original story was proving something.

Absolutely wrong. The purpose of the original story was to provide an illustration.

Now, if he had anecdote which helped you remember, say, the standard form of the quadratic equation...

There are ideas and lessons worth remembering that aren't mathematical facts.


And the "culture" of software organizations, the procedures, the bureaucracy, the personnel feedback, is based on accumulated anecdotes, and not on anything remotely scientific or any other rigor.


Finding the simplest solution to a problem is hard, but because it seems simple in hindsight, only those competent in the art can recognize a brilliant solution.

This is just another example of "bullshit baffles brains" and that it takes competence to recognize competence.


Like how it took your competence to recognize the competence of the example?


Everyone can come up with parables that make some point of view look good. However, two diametrically opposite extremes are presented, instead of a more realistic situation, making the value of the parable zero and none.

For instance, were the 'enterprise' team to be headed by a capable technical lead that forces his team to produce reasonably readable, reasonably documented, reasonably maintainable and futureproof code, then the situation would already be very different. If we add to that that the inexperienced hacker prodigy would produce working code much faster, but his code would turn out to be brittle when someone else has to take care of it, because he does not yet have experience in interacting with lesser gods via his code, then the match would be even more equal. We may still prefer the hacker, but we would be forced to think about the trade offs involved.


I think that enterprise teams typically follow strict syntactic coding standards and then check off the "maintainable" and "readable" requirement from that alone. Additionally, they generate mountains of bloated Word and PowerPoint documents and then consider that responsibility fulfilled. They end up with an incredibly expensive, over-engineered mega-application that exacerbates rather than solves the intended problem. Don't think that this doesn't happen.

There are only so many things that you can force upon a team of programmers, and overall quality and cohesiveness aren't among them.


It's fairly easy to degenerate "enterprise developers" when you're defining what "enterprise" means.


My definition of "enterprise developer" comes directly from working in a gigantic financial company as well as an even more gigantic government defense contractor. Would you like some more anecdotes?


No, because an "anecdote", by definition, is not statistically relevant.

"Enterprise teams" are not, inherently, profoundly stupid in their practice of software engineering, and not all "hackers" inherently produce worthwhile, quality code.

This completely fabricated fable of software engineering is a simple straw man argument, and I've flagged it accordingly.


Every life lesson that you learn from experience is just a statistically irrelevant anecdote and results in the refinement of a crude heuristic or generalization mechanism for your limited human brain. Never did this fabricated fable state or even hint that this was the way all enterprise teams and all hackers are like. That, my friend, is the straw man argument coming from you.


If this fable didn't hint at that, what was its point?

That convincing management regardless of your productive output is what matters at the end of the day? Perhaps at some organizations, but it's not a particularly accurate, nuanced world view.

I doubt this story would be conveyed in reverse -- the stereotypical "rockstar hacker" produces vast reams of code that will fail catastrophically, but comes out ahead by, upon 'completion', immediately pushing responsibility for the disastrously buggy code to the "stodgy" enterprise engineers who get called in to maintain the project. The "rockstar" moves on to the next project, where he'll repeat this performance, and the stodgy developers get poor performance reviews.


I actually thought the story hinted at the opposite: that individual programmers who from the outside may look like slackers can produce good, simple code and that process isn't everything.


I could supply some as well to support your claim.


I'm not sure what value this story adds. We're all (well, mostly) aware of the concept of hacker vs enterprise programmer, and this story doesn't add anything new to that idea.

On the other hand, it does seem to be a nice passive-aggressive way to complain about getting demoralised by a manager who couldn't understand the hacker mindset.


It doesn't offer anything new but it does offer an opportunity to reflect. This story has been around a long while (this dates from '99 but I suspect it's older) and I think comes from a time when hackers had a whole lot less options. Seems to me it's a pretty good time to be a hacker right now.

EDIT: Couldn't beat curiosity, it's from March 20, 1985 according to http://www.csd.uwo.ca/~magi/personal/humour/Computer_Audienc...


I know it's old, but this is one of my favorite programming stories ... (Along with Mel, and a few other goodies)


For those that haven't read The Story of Mel:

http://www.pbm.com/~lindahl/mel.html


It was a better story than the OP.


This just sounds like a wishful fairy-tale. Why is it the top item on hacker news?


Because a lot of people clicked the up arrow.


It's sunday, there's nothing else.


Wow! Lots of people here don't identify with Charles.

Let's change the story a little and see if the response is any different...

"Back at Consolidated, Charles spent some time thinking about the problem. His fellow employees noticed that Charles often sat with his feet on the desk, drinking coffee. He was occasionally seen at his computer terminal, but his office mate could tell from the lack of typing (and his always-interesting commentary at lunch) that he was likely reading Hacker News."


The story has sequel: The parable of the two programmers, continued http://portal.acm.org/citation.cfm?id=1012623


This article is guarded behind a user name and password.. any free version?


I don't get it what is the take away of this story? If I play video games at work I am likely to get fired? If I follow company procedures I will get ahead?

Seriously though work isn't track and field you don't win by being better than who ever came in second. You win by working to the best of your ability.


You clearly haven't worked at a large corporation. You get ahead by kissing up to the boss, holding large meetings, and creating fancy charts and graphs that explain why your project is 6 months behind.


And getting promoted or transferred before the project is killed.


See also "Seven Stages of a Project" http://corry.ws/CorryBook-69.htm


The point of the story is that it's not how well you do your job that counts, it's how well your manager thinks you do it.

It's all about perceptions. If you're a crap coder, but suck up to your boss, wear a smart suit (or whatever the conventional clothing is at your place of work), always arrive at work on time, etc, then you'll do better than if you're a brilliant coder, but wear unconventional clothes, come in on work late, etc.


Your comment deserves to be a direct reply to the orignal posting. The current comments are tipping the scales in favor of Alan either by directly supporting overweight processes/solutions, or by demeaning the total comparative contribution of Charles (which has the same effect).

For people who just cannot make the jump and understand what the author was saying, re-read the article, and instead of Charles playing Space Invaders, have him reading Hacker News instead. I think you'll see it takes on a whole new meaning for you.


It's like with essays: shorter essays take longer to write, because you have to spend more time editing and wording things in a clear and simple way.


The morals of this story: If you're that smart as Charles is, do this program in two weeks and move on. You'll get respect and raise, and get to solve more interesting problems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: