• NuXCOM_90Percent@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    9 months ago

    Most languages with “official” formatting guidelines are due to limitations of the compiler/interpreter. Mixing whitespace in Python (or older Fortran) is a great way to error out massively.

    For the more modern compiled languages, there is no need. But there still tend to be popular formats from companies like Google

    • Kogasa@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      9 months ago

      You say this, but C# does have official code style conventions. It’s not about the compiler at all but about ensuring a relatively homogeneous coding style across the ecosystem, so a .NET dev can work on different projects without needing to refamiliarize.

      • NuXCOM_90Percent@lemmy.zip
        link
        fedilink
        arrow-up
        0
        ·
        9 months ago

        If indentation and newline policies prevent developers from migrating from one project to another then either your developer suck or your language does.

        That said, C# is somewhat special in that it is both a language and a corporate flag by Microsoft. Similar to how Google pushes to have their style guides made public so that other projects will adopt them. Which has less to do about making it so that one developer can bounce between projects (because they should be able to anyway) but to instead push Google as the goal everyone aspires to and emulates.

        • stevecrox@kbin.social
          link
          fedilink
          arrow-up
          0
          ·
          9 months ago

          This is about thew new starter cost.

          When a developer joins a team, they will not be as productive as they have to learn the code, frameworks, libraries, the project purpose, the tooling, etc… Often this impacts other members of the team lowering the entire teams productivity.

          When you use productivity tracking (e.g. things like capacity planning) you will see the teams performance drop and it will take time for it to exceed the previous measured performance. This is the cost of adding a new starter.

          So if it takes 6 weeks for a new starter to increase overall team producitivty then planning someone on a project for 4 weeks is pointless since the team will have a higher delivery rate without the extra person. This is typically why an organsation loses its ability to migrate staff between projects.

          Code formating affects the layout of the code and our brains do all sorts of tricks around pattern recognition, so if your code formatting rules are too different a someone migrating between projects has to spend time looking for code and retraining their brain.

          Its an additional barrier and a one within an organisations skills to remove (by forcing a common code standard).

        • Kogasa@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          9 months ago

          There’s a lot more than indentation and newline policies. The default editorconfig is a few hundred lines. But there’s also no reason not to standardize indentation and newline policies.