• theunknownmuncher@lemmy.world
    link
    fedilink
    arrow-up
    97
    arrow-down
    1
    ·
    edit-2
    22 hours ago

    Whenever you sit back and smile proudly to yourself about how clever the block of code you just wrote is, your next move should be to delete and rewrite it.

    This is a clever block of code! Great job, now rewrite it to be sane 😂

    • balsoft@lemmy.ml
      link
      fedilink
      arrow-up
      27
      ·
      20 hours ago

      I think it depends; some smart code is good actually, think 0x5f3759df. As long as you properly document it and leave plenty of comments. This one is not smart though, at best it’s what I would call witty.

      • Cethin@lemmy.zip
        link
        fedilink
        English
        arrow-up
        4
        ·
        10 hours ago

        This isn’t smart. This is clever. It’s a way to solve a problem in a novel way. It isn’t the best, or even most obvious, way to solve the problem. It’s just interesting.