• Winter_Oven@piefed.social
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    imagine if the entire function is a single if-else statement which they kept adding onto, but could never refactor lest everything crashes down and burn.

    • Daedskin@lemmy.zip
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      4 months ago

      I once worked on a project doing firmware that a lot of people have likely used (printer firmware for a big-name company). One of the more trafficked functions was something like 1500 lines of “if-elseif-elseif…” with something like 13 or 14 different cases.
      It did end up getting refactored to something polymorphic and based on a configuration file to cut out any unnecessary steps, but it was like that for a while before I got there, and was like that for most of the year that I was part of the project.