# clang-tidy

14 Hacker News commenters recommended clang-tidy and 4 criticized it, November 2025 to November 2026. It was recommended in 6 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Free C and C++ linter that catches common bugs and is widely recommended alongside sanitizers and compiler warnings. Critics say it struggles with lifetime checks and produces false positives.

## Why people recommend it

- Catches common C and C++ mistakes (3 comments): "C has plenty of high quality linters like ClangTidy that can teach junior and intermediate developers what not to do" ([source](https://news.ycombinator.com/item?id=45922151)) "cppcoreguidelines-init-variables + cppcoreguidelines-pro-type-member-init would have flagged it" ([source](https://news.ycombinator.com/item?id=49967325)) "It will catch that and a lot of iffy stuff." ([source](https://news.ycombinator.com/item?id=45842192))
- Core part of static analysis (3 comments): "use static analysis beyond compiler warnings (Clang Tidy, Clang Static Analyzer)" ([source](https://news.ycombinator.com/item?id=50032787)) "you'll also wanna use a static analysis tool like clang-tidy" ([source](https://news.ycombinator.com/item?id=46574801)) "Use clang tidy and other static analyzers" ([source](https://news.ycombinator.com/item?id=48551130))
- Free and more customisable than GCC (2 comments): "GCC only recently started with its safety analysers, it doesn't do C++, and isn't as customisable as clang tidy" ([source](https://news.ycombinator.com/item?id=49253912)) "we have modern versions freely available like clang tidy" ([source](https://news.ycombinator.com/item?id=46629081))
- Rules configurable for your team (2 comments): "figure out good clang-tidy and clang-format rules" ([source](https://news.ycombinator.com/item?id=48771971)) "Yes, configure clang-tidy as such." ([source](https://news.ycombinator.com/item?id=49045526))

## What people warn about

- Struggles with lifetime checks (1 comments): "how MSVC and clang-tidy have struggled to achieve the Core Guidelines ideas for lifetimes" ([source](https://news.ycombinator.com/item?id=50115084))

## Alternatives hackers recommend

- [zizmor](https://hackerapproved.com/p/zizmor.md): 19 recommend
- [Semgrep](https://hackerapproved.com/p/semgrep.md): 14 recommend
- [PHPStan](https://hackerapproved.com/p/phpstan.md): 11 recommend
- [SonarQube](https://hackerapproved.com/p/sonarqube.md): 10 recommend
- [CodeQL](https://hackerapproved.com/p/codeql.md): 9 recommend

## Cite as

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