• MonkderZweite@feddit.ch
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    Legacy code:

    • that’s a fallback from the 80ies…

    • this gets never executed…

    • yet another undefined variable…

    • ohh, that’s clever!

    • hellishharlot@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago
      • Jeffery wtf is this?
      • ok so why didn’t we remove this from the codebase!?
      • define the variable please I’m begging for just a smidge of readability!!! … Oh that’s actually remarkably clever
  • magic_lobster_party@kbin.social
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Often when I ask “why” too many times, it’s because the coder chose the most convoluted approach to the problem.

    Like when someone inherited an entire class just to access a single method, but it turned out he actually didn’t need that method, so he added an extra if statement in that method and a Boolean flag so it can do the thing he actually wanted.

    And this was someone who consider himself a senior programmer.

    • Platypus@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      I’ve been tasked with updating some code a senior programmer (15+ years experience, internally awarded, widely considered fantastic) who recently left the company wrote.

      It’s supposed to be a REST service. None of the API endpoints obey restful principles, the controller layer houses all of the business logic, and repositories are all labeled as services–and that’s before we even get into the code itself. Genuinely astounding what passes for senior-level programming expertise.

      • TheChurn@kbin.social
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        In many cases, getting something out quickly is more valuable than having it be clean.

        Part of being a senior is knowing when fast is more important than perfect. Not saying your senior did everything right, just that a single example of someone’s code isn’t enough to judge the value of a person to an organization.

    • andrew@lemmy.stuart.fun
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      So post something funny. Or just post something. Sitting in the back yelling “this sucks” isn’t going to help.