6 points

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.

permalink
report
reply
5 points

If you’re using visual studio (2022 is current) the idiomatic styling will be mostly correct by default (Ctrl k,e will reformat).

permalink
report
reply
2 points
*

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

permalink
report
parent
reply
1 point

I’ve never looked into it very deeply, but it uses a styling spec called EditorConfig. Check it out, https://editorconfig.org/

permalink
report
parent
reply
4 points

There are a few coding conventions and style guides for C#:

permalink
report
reply
3 points

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

permalink
report
reply
3 points

There’s dotnet format which will format your code. You can configure it with editorconfig

permalink
report
reply

Programming

!programming@programming.dev

Create post

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



Community stats

  • 1

    Monthly active users

  • 555

    Posts

  • 2.8K

    Comments