Automatic Code Formatters

Comments debate the benefits of auto-formatters like gofmt, Prettier, and Black for enforcing consistent code styles, reducing formatting disputes, and improving team collaboration via standards and CI integration.

➡️ Stable 0.6x Programming Languages
4,910
Comments
19
Years Active
5
Top Authors
#4257
Topic ID

Activity Over Time

2008
7
2009
25
2010
36
2011
42
2012
128
2013
170
2014
179
2015
259
2016
177
2017
337
2018
388
2019
408
2020
465
2021
369
2022
476
2023
440
2024
487
2025
497
2026
22

Keywords

e.g IMO OK CI LSP PSR github.com IDE readthedocs.io YAPF formatting code style prettier format auto team black standard commit

Sample Comments

joshuamorton Aug 27, 2020 View on HN

Arguably opinionated formatters like prettier and black are a response to gofmt.

JelteF Aug 23, 2017 View on HN

Gofmt, or rustfmt or whatever language fmt are really one of the best things that happened to modern development. Even if you don't agree with the style, which nobody does fully, it's much better than having discussions about style all the time and having to format the code manually. Formatting just happens when you save the file, so you can forget spaces and everything when writing and your code will look fine when you save it.

weberc2 Feb 9, 2020 View on HN

You misunderstand the point of formatters. They aren’t meant to automate your personal preference; they automate a standard format so your team doesn’t have to waste time deciding on and enforcing a coding standard and so you don’t have to manually implement the standard. Implicit in using a code formatter is the decision to stop navel gazing and put the team first.

boo_radley Jun 4, 2015 View on HN

god save us all from people's style guides. Use your IDE's reformatting tools and go in peace.

not_kurt_godel Apr 14, 2015 View on HN

You sound like one of those people who format code by hand instead of an in-IDE autoformatter.

aequitas Sep 8, 2025 View on HN

It’s very simple: format code to a standard. Preferably the language default formatting. But it must be a standard that can be auto formatted to with a tool. Now when someone doesn’t like that standard, they can auto format from that standard to one of their liking for local development and back again to the project standard for pushing to the project. This can even be done automatically with gitattributes during checkout and commit. But without strictly enforcing a autoformatable standard this

Cthulhu_ Aug 16, 2018 View on HN

I like to think it's OK because gofmt reduces formatting churn overall.

shit_game Sep 8, 2025 View on HN

Would you say that someones code formatting is a shibboleth? How do you feel about formatters and linters in regards to this?

whorleater Apr 13, 2019 View on HN

I honestly don't understand how people are still bickering over style guides in modern programming. Autoformatters exist in every major language. Git hooks exist. Company style guides exist. Pick one, and then it's never an issue what editor people are using, it's bizarre that this bikeshed still exists.

0xffff2 Jun 27, 2022 View on HN

Sorry, but formatting is on you. If you don't like the comments, don't commit inconsistent code. Set up a local auto-formatter with the right rules. If enough of the existing code you're working on doesn't conform, set the formatter to only run manually and get in the habit of running it before committing.