Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Which defaults? The programming languages I’ve worked with don’t have defaults for everything related to formatting. Editor defaults don’t work, since not everybody uses the same editor. So you have to make a choice somewhere.


A lot of (relatively) recent languages do have defaults. Go and rust both come with an auto formatter out of the box, and defaults that are sane enough to just run with


Ah yeah, in those cases it is possible to just use the defaults. Come to think of it, I have worked with Deno, which comes with a formatter (and linter and testing library) and I’m a fan. Saves a couple of dependencies, some config files and a bit of mental overhead when creating a new project.


I guess the GP means "use an opinionated formatter", I agree with both of you.


Please inform me what the defaults are for Java, C#, C++, C, Bash and Python?


As far as C# goes there's `dotnet format`. You can use it as is or provide an `.editorconfig` file to customize it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: