• Gonzako@lemmy.world
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    edit-2
    1 day ago

    I personally go by the monocre that if it’s something important, it’d be all on one file as not to lose the train of thought when debugging it.

    As jumping around between files

    tends to break up thought lines

    also, the compiler likes it better when there’s less layers

    • Johanno@feddit.org
      link
      fedilink
      arrow-up
      3
      arrow-down
      5
      ·
      1 day ago

      Are those your arguments?

      Train of thought is subjective

      And the compiler doesn’t care

      • Gonzako@lemmy.world
        link
        fedilink
        arrow-up
        4
        arrow-down
        2
        ·
        1 day ago

        Yeah? If something is important being able to have it all on one file is the best way to ensure you get the behaviour you want.

        Having to file-hop is generally a strain on mental resources and it breaks the linearity of the project, ofuscating initial reads.

        And yes, the compiler does care, there are no 0-cost abstractions.

        • Johanno@feddit.org
          link
          fedilink
          arrow-up
          2
          ·
          23 hours ago

          Yesnt.

          If the alternative to changing into a new file is to search through a 40k lines file that has no structure, then I rather go to a new file. As my train of thoughts is interrupted by the size of the file.

          And a good compiler is capable of a lot these days. However if you are working on low end hardware that has to perform good and fast then you should of course think about the compiler.

          In 99% of software that isn’t the case though