# clang-format

7 Hacker News commenters recommended clang-format and 1 criticized it, November 2025 to November 2026. It was recommended in 4 of 13 months.

**Verdict:** Recommended as a near-perfect code formatter, often run alongside clang-tidy for linting and style rules.

## Why people recommend it

- Seen as near-perfect formatter (2 comments): "clang-format would be the perfect tool for this also, even though it's not designed to work on D." ([source](https://news.ycombinator.com/item?id=46873877)) "clang-format was essentially perfect from my perspective" ([source](https://news.ycombinator.com/item?id=48023593))
- Pairs with clang-tidy and linters (2 comments): "There's clang-format, clang-tidy, cppcheck and so many others" ([source](https://news.ycombinator.com/item?id=48841696)) "figure out good clang-tidy and clang-format rules" ([source](https://news.ycombinator.com/item?id=48771971))
- Configurable alignment and style rules (2 comments): "AlignConsecutiveAssignments in clang-format might be the right fit." ([source](https://news.ycombinator.com/item?id=47099277)) "figure out good clang-tidy and clang-format rules" ([source](https://news.ycombinator.com/item?id=48771971))

## Alternatives hackers recommend

- [gofmt](https://hackerapproved.com/p/gofmt.md): 26 recommend
- [Black](https://hackerapproved.com/p/black.md): 18 recommend
- [FracturedJson](https://hackerapproved.com/p/fracturedjson.md): 18 recommend
- [Prettier](https://hackerapproved.com/p/prettier.md): 16 recommend
- [Oxfmt](https://hackerapproved.com/p/oxfmt.md): 14 recommend

## Cite as

Hacker Approved, "clang-format", https://hackerapproved.com/p/clang-format/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
