this post was submitted on 27 Dec 2023
77 points (97.5% liked)

Programming

17028 readers
225 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] NuXCOM_90Percent@lemmy.zip 3 points 8 months ago (1 children)

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 1 points 8 months ago (1 children)

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 2 points 8 months ago (1 children)

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 1 points 8 months ago (1 children)

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.

[–] NuXCOM_90Percent@lemmy.zip 1 points 8 months ago (1 children)

Standardizing within a project or even a company is important.

Standardizing across an industry or language is not

[–] kogasa@programming.dev 1 points 8 months 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.