• NuXCOM_90Percent@lemmy.zip
    link
    fedilink
    arrow-up
    6
    arrow-down
    3
    ·
    1 year 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
      1
      ·
      1 year 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
        2
        ·
        1 year 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.

        • Kogasa@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          1 year 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.

            • Kogasa@programming.dev
              link
              fedilink
              arrow-up
              1
              ·
              1 year ago

              Feel free to point out a disadvantage. As a .NET dev I appreciate the semblance of consistency. Different codebases differ enough already, it’s just easier on the eyes when everyone is using the same basic conventions.