Kernighan's Lever

(linusakesson.net)

25 points | by xk3 2 days ago

5 comments

  • yodon 1 hour ago
    This feels like a lot of rationalization for the purpose of excusing writing exactly the sort of code that Kernighan advised against.

    Advising against writing complex code is not advising against learning.

    The person who solves a hard problem correctly using simple code has generally spent more time learning than the person who solves it using complex code.

    • GMoromisato 1 hour ago
      Yes, I agree this is true in some (many?) cases. But it is also true that sometimes the more complex solution is better, either for performance reasons or because it makes things simpler for users/API callers.
  • GMoromisato 1 hour ago
    I like this insight, even though I think they are pushing Kernighan's quip a little too far.

    I take away two ideas:

    1. Always be learning. I think everyone believes this, but we often come up with plausible reasons to stick to what we know. This is a good reminder that we should fight that impulse and put in the effort to learn.

    2. Always be fearless. This, I think, is the key insight. Fear is easy. We fear the unknown, whether they be APIs or someone else's code. We fear errors, particularly when they have real-world consequences. And we fear complexity, because we think we might not be able to deal with it. But the opposite of fear isn't recklessness, it's confidence. We should be confident that we will figure it out. And even if we don't figure it out, we should be confident that we can revert the code. Face your fears and grow.

  • userbinator 1 hour ago
    (2012)

    This article can be summarised in one word: learning. I've noticed over the years that there seems to be a growing divide amongst programmers, between those who believe in learning, and those who don't (and actively try to avoid it); unfortunately the latter has become a majority position, but I still try to show others this article when they don't understand code that I've written and would rather I stoop to their level.

    A look around the site at what else he has accomplished, should be enough evidence that he isn't just a charlatan, unlike some others who have made a consulting career out of spouting pompous hot air about methodology.

  • zahlman 2 hours ago
    (2012)

    > You effortlessly wield clever programming techniques today that would've baffled your younger self. (If not, then I'm afraid you stopped evolving as a programmer long ago.)

    ... Perhaps if we allow that "clever techniques" can yield simpler results than my former self did.

  • lupire 2 hours ago
    This article says nothing of substance.