Comment by physicles

Comment by physicles 13 hours ago

5 replies

Reminded me of this gem from Brian Kernighan:

"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?"

nine_k 10 hours ago

My rule is simple, grug style: "smart good, clever bad".

Terminally clever is when you look at code that does something impressive and say: "Oh snap, I still can't exactly get it. I've read five explanations, and still cannot understand why they are doing this here. Screwed magic. How do people even come up with such ideas?"

Genius is when you look at code that does something impressive and say: "Holy guacamole, it's so simple! Now that I see it, it looks almost obvious. Pure magic. How do people even come up with such ideas?"

Despite the superficial similarity, clever and smart can be told apart. Clever should be seen as late stage optimization, smart, as foundation.

  • userbinator 10 hours ago

    Genius is when you look at code that does something impressive and say: "Holy guacamole, it's so simple! Now that I see it, it looks almost obvious. Pure magic. How do people even come up with such ideas?"

    IMHO "genius" is code that appears completely unintelligible at first glance, but then you examine it carefully and then feel immensely enlightened once you understand.

    These are the two examples of such code that immediately come to mind:

    https://news.ycombinator.com/item?id=22353532

    https://news.ycombinator.com/item?id=28491562

    The original UNIX source code may come in as a distant third, a very distant third; code that is truly "genius" is indeed extremely rare.

    • nine_k 9 hours ago

      My point is that genius is exactly not that. Code like in these examples is, to my mind, a tour de force, only interesting as a curiosity, or an example of a terrible but clever hack.

      (Like you, I of course immediately thought about the famous Artur Whitney's page of impenetrable C.)

      The genius of J (and APL) is exactly in the simplicity of the language, where a single character denotes a whole well-defined operation on arrays which might take a page of Fortran code, and these operations are orthogonal, and useful for practical purposes.

      • agumonkey 6 hours ago

        But to some people apl/j are horrible, they will prefer their spaghetti of routines massaging random dicts where everything is "obvious"