Since you specifically mentioned C# : https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions
I’d be surprised if there is a serious language that doesn’t come with at least some semi-official style guide. But usually they are not universally followed and everybody just does their own thing.
Just to add, I’d argue dotnet has one of the best sets of guidance on style. It goes beyond just naming and towards how to structure code for easier consumption and consistency. People love to dump on MSFT, but the dotnet platform is superb.
https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/
I’d be surprised if there is a serious language that doesn’t come with at least some semi-official style guide.
Does JavaScript have one?
Edit: Except google’s style guide
Edit: Except google’s style guide
This legit made me laugh lol, Google’s style guides for their longer standing languages are always dismissed, especially their one for C++
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.
Rust, like the majority of modern languages, has an official formatter which everyone should be using. Formatters are good enough nowadays that everyone should be using them.
I’m fond of Go, which comes with its own auto formatter. It eliminates all arguments over style and format.
Beat me to it. There’s plenty to rave about in Go, and that’s definitely one of my favorite things.
Also, it’s refreshing to actually use tab characters and not two spaces or four spaces or whatever.
If you’re using visual studio (2022 is current) the idiomatic styling will be mostly correct by default (Ctrl k,e will reformat).
I’ve found it to be less strict than I’d prefer. Things like whether parameters are aligned or indented, whether or not the first one is on its own line, what statements are indented in fluent calls that have blocks, etc.
A lot of other formatters (prettier, anything for python, etc) force something consistent in those cases, whereas it seems like the dotnet formatter prefers to leave things as they were.
I’d love for it to be more opinionated and heavy handed if anyone has suggestions
I’ve never looked into it very deeply, but it uses a styling spec called EditorConfig. Check it out, https://editorconfig.org/