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.
Highly agree. I’ve been writing code since I was in the single digits and while these days I write mostly Python, Haskell, and C++, I was blown away by the quality of C# and dotNET’s documentation (used it for a few Unity projects) to the point I actually miss it and am considering C# for a Godot project.
I’m not at all a fan of Windows, Office, Azure etc but Microsoft truly got C# right.
To summarize the explanations i’ve come across: It’s tailored to Google’s internal teams maintaining tons of legacy C++ code, doesn’t cover exception handling, and generally has outdated advice best suited for the code they developed in that time period. While their style guide is ideal for maintaining consistency with Google’s existing codebase, someone working on a modern C++ project should consider using the language’s more modern features and STL components
Something I’d want to note though, someone developing in C++ for an embedded platform or even working on hardware drivers would probably have very lean and mean code which doesn’t conform to a particular style guide, especially ones advising against use of “unsafe” operations.
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/
Highly agree. I’ve been writing code since I was in the single digits and while these days I write mostly Python, Haskell, and C++, I was blown away by the quality of C# and dotNET’s documentation (used it for a few Unity projects) to the point I actually miss it and am considering C# for a Godot project.
I’m not at all a fan of Windows, Office, Azure etc but Microsoft truly got C# right.
deleted by creator
Does JavaScript have one?
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++
What is wrong with Google’s C++ guide?
To summarize the explanations i’ve come across: It’s tailored to Google’s internal teams maintaining tons of legacy C++ code, doesn’t cover exception handling, and generally has outdated advice best suited for the code they developed in that time period. While their style guide is ideal for maintaining consistency with Google’s existing codebase, someone working on a modern C++ project should consider using the language’s more modern features and STL components
Something I’d want to note though, someone developing in C++ for an embedded platform or even working on hardware drivers would probably have very lean and mean code which doesn’t conform to a particular style guide, especially ones advising against use of “unsafe” operations.
Google’s, Mozilla’s and Apple’s style guides are pretty much as official as you’re gonna get here.
The ‘prettier’ formatter is also rather popular and as such its stylistic choices, although that is of course moreso a hammer than a guide.
Is JavaScript a serious language? /s
Joking aside: One of Brendan Eich’s books probably contains something resembling a style guide.
Eslint rules and prettier. I use the AirBnB ruleset as a base close to my personal preferences and then customize to my liking.
I don’t really have to do any manual formatting. I just save to apply the formatting.
edit: javascript
Java walks in, whose stdlib uses different styles in the same file.