Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: "Cleverness" from HOP

by gwadej (Chaplain)
on Jun 11, 2009 at 14:39 UTC ( [id://770661]=note: print w/replies, xml ) Need Help??


in reply to "Cleverness" from HOP

My favorite quote in this vein is from Brian Kernighan:

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
G. Wade

Replies are listed 'Best First'.
Re^2: "Cleverness" from HOP
by demerphq (Chancellor) on Jun 14, 2009 at 10:20 UTC

    Hmm, I always thought that one was Dijkstra. But I guess not... Thanks.

    ---
    $world=~s/war/peace/g

Re^2: "Cleverness" from HOP
by Anonymous Monk on Jun 11, 2009 at 14:46 UTC
    Fallacy. Twice as hard doesn't mean twice as much smartness required. It can mean twice as long.

      I think of the quote as more of a cautionary tale than a logical argument.

      From my personal experience, I have learned that those truly clever and amazing pieces of code that I and others have written always seem to take an extraordinary amount of brain-power to understand and debug later.

      I've also found the quote as useful for making entry-level programmers reconsider their latest masterpiece. Thinking about what it will take to debug a complex system can be a useful antidote to an overly complex design.

      G. Wade

        I'm not sure I buy the premise that being clever is hard. To be clever is to avoid thinking of the consequences of writing the clever code. Thinking things through is hard.

        I accept both of the following

        • Writing clever code will result in making your code harder to debug.
        • The harder the code is to write, the harder it will be to debug.

        But I don't see how they are related except in effect. I definitely don't see the causal relationship you posted.

      But as you remark, it can. And twice as long can also mean you cannot debug it because you'll be fired by the time you're half-way done for being worth half of what you're paid.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://770661]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-19 08:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found