TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25059 20
C++ Modules: clangd, go or no go debating on pulling the modules plug on a project

Every now and then, someone asks how C++ modules are going. I am a lead dev (mentioned not for bragging but to emphasize the crushing weight of responsibility) for a robotics project, as we are making a CV codebase from scratch, I have the opportunity to choose the architecture and conventions of the code (even more crushing responsibility).

I have gotten some C++23 codebases with modules set up; however, whenever adding a new module, I have to recompile to get clangd to not spam extra errors. I have been starting to get second thoughts with pushing modules all the way. To avoid the gcc-clangd stuff, I ended up specifying the compiler as clang (although I could use clangd compiler flag remove/add).

The codebase is at a point where I can relatively, easily pull the plug on modules.

Requirements:

1. No vscode or intellisense - I'm tired of vendor lock
2. Clangd, so we have neovim-coc-clangd + vscodium support
3. Sits well with cmake
4. Not really has to sit too well with clangd, as long as it sits well with compile_commands.json since that is a bit more of a decentralized standard for code completion etc.
5. As much as I would be willing to learn to code without code completion, I would prefer to have enough leeway to radicalize newbies to a nvim plugin with vscodium or neovim-coc-clangd + telescope itself \^_\^

Ideals:

1. Codebase can work with as many compilers as possible (as long as they support #pragma once because the time spent on botched header guards + incoming newbies concerns me enough to diverge a lil' bit from standard C++. Also, our CV codebase is one of those projects that isn't meant to be portable. All of our portable code does use header guards to please the great bjorne stroustroup
2. Ease with other code completion tools

Why (for the curious):

1. Vendor lock sucks
2. Proprietary vendor lock sucks even more
3. I have a bone to pick with microslop
4. Because as an embedded project, vscode's oddities disrupts portions of our toolchain from time to time
5. Even though the CV codebase is not embedded, the fact that vscode support for modules was much harder to get than neovim/clangd just left a bad taste in my mouth. Call me unskilled, but it convinced the newer devs to learn modern C++ on pure command line rather than a shiny GUI-based IDE setup :P

For the curiouser: no, we don't use github anymore :P

https://redd.it/1svded9
@r_cpp
Reddit From the cpp community on Reddit Explore this post and more from the cpp community
More from @r_cpp
  1. Oct 4, 2026Comparing exception behavior of magic statics, std::call_once, and std::async https://devb…
  2. Oct 4, 2026The complement of true is true, except when it's false https://dryperspective.github.io/po…
  3. Oct 4, 2026Grooves in Software - Andreas Wagner - [https://youtu.be/8XtZi4HTrcA](https://youtu.be/8Xt…
  4. Oct 4, 2026New C++ Conference Videos Released This Month - September 2026 (Updated To Include Videos…
  5. Oct 4, 2026Żmij 1.2 "the proof is in the printf" released with full to_chars implementation, formal v…
  6. Oct 4, 2026Why we should standardise on CPS To enable any collaboration in the industry, some "social…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →