Hacker News new | past | comments | ask | show | jobs | submit login

> the old Kernighan quote “Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?”

This quote can be interpreted in an intelligence-positive way, to encourage you to learn by writing the cleverest possible code. Then, when you get to debug it, you will be forced to improve your skills. This interpretation is called Kernighan's lever [1] and it is very beautiful. The alternative is a life of boredom where you don't learn anything new.

[1] https://www.linusakesson.net/programming/kernighans-lever/in...




”Prod is on fire and nobody can figure out your burrito pasta”

”Isn’t this a wonderful learning opportunity for all of us”

Debugging time is never a good time to start honing new skills.


“Burrito pasta” is a great term! Is that something that you just came up with?

It sounds like spaghetti code but even worse because it’s covered with a messy layer of beans and guacamole and wrapped in layers of tortilla.


Just came up with it. The complexity of monads and other post-grad level CS stuff mixed with good old spaghetti code.

Next up: some doofus who learned high-order Haskell in middle school, and takes offense of me calling it complicated.

PS: https://blog.plover.com/prog/burritos.html


Of course, Kernighan's lever is most useful on individual projects. In an industrial context there are often other constraints. Nobody is saying that you have to always write the most clever code you can. But if you never do it, you will improve your skills very slowly, if at all.


Writing simple code is difficult, more difficult than writing clever code, and is a better skill to grow.


I would hope at least most of the debugging happened before the code made it to production.


I was just pondering this very issue. I think one of the reasons some teams end up with spaghetti code is because the developers are smart enough that they always muddle through it in the end. So when it comes to talking about technical debt, there's never a "it's too complicated," there's just "you're not trying hard enough." In that sense, it would help if the developers had a lower pain tolerance, because it would drive us to actually work hard to improve the ergonomics of our architectures.


> The alternative is a life of boredom where you don't learn anything new.

Now that's an impressive logical leap.


False dichotomy, anyone? I learn more from trying new ideas than debugging complex code.


I mean

When I try something new, usually what I learn is not that my assumptions were correct, but the more interesting part is where my assumptions were wrong. This usually only becomes apparent either when writing the code, or in some of the more interesting cases, when debugging.


This quote can be interpreted in an intelligence-positive way, to encourage you to learn by writing the cleverest possible code.

I would claim that any clever final result can be accomplished without any need for intermediate cleverness. Things that look clever to other people but are intuitive to you might be OK. Things that look clever to you should be avoided when possible.


That is absolutely horrific. I don't want to spend my energy learning the special skills needed to deal with things I should have been smart enough to prevent from ever existing.




Registration is open for Startup School 2019. Classes start July 22nd.

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

Search: