• InFerNo@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 months ago

    Make the input variables nullable, then add checks if the values are null, then assign default values if they are, otherwise continue with the passed values.

    • Acters@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 months ago

      Good idea but not feasible as that could introduce unknowns. Unfortunately making defaults when null is counterproductive as we are looking to increase LOC without introducing odd behavior and having no changes to how the overall function works. The only objective is to increase LOC.