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

    For practical advice, I recommend starting a project with dotnet new editorconfig which covers many of the .NET coding conventions. If you want more strict standards you can use StyleCop, but you will need to configure it a bit to be consistent with the .NET conventions.

  • burliman@lemmy.today
    link
    fedilink
    arrow-up
    1
    ·
    9 months ago

    C# has the Microsoft coding standards that are most accepted. PHP has the PSR standards. JavaScript has pretty much nothing and is the Wild West.

    Those are the only ones I know about.

  • TehPers@beehaw.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    9 months ago

    Someone else already mentioned Rust, but to add to it, rustup installs rustfmt (opinionated formatter) and clippy (linter) by default, but you can choose not to run them or even install them. rustfmt has a few configuration options, but is for the most part strict in how it formats code.

    PEP8 is nice since it sets some common rules across Python projects, but I’m not a fan of some of the decisions they made. The biggest one for me was discouraging defining variables/attributes/etc that use the same name as built-ins. That means no variable named input, no attr on your data model named id, etc. Still, since the language doesn’t strictly enforce this, you can easily adjust these rules to meet your project’s needs.

    I believe go requires you to run the bundled formatter to even compile the code, but I could be misremembering.

  • Nachorella@lemmy.sdf.org
    link
    fedilink
    arrow-up
    1
    ·
    9 months ago

    Rust has a style guide and comes with a linter. But I don’t think you need to follow it if you don’t want.

    • brian@programming.dev
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      9 months ago

      I refuse to believe that people use a php style guide. I have yet to open a php file in the course of any job that doesn’t mix tabs and spaces arbitrarily on top of numerous other horrors.

      Luckily it’s not often that I have to, so sample size may play in a bit…