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

A lot of people insist on avoiding the use of "using namepspace x" in .cpp files. This makes no sense to me, it makes things a lot easier to read. It never seems to cause a problem, and it's trivially fixed if a conflict shows up due to a header change later.


> It never seems to cause a problem

It does if you want to use unity builds at some point down the road. For my app it took the build time from 25 minutes to 2 - 3 minutes which is critical when doing CI on a lot of operating systems and with a big build matrix.


I am not familiar with unity, but why should it slow down builds?


From a quick google, unity builds are akin to #include-ing every file in the project (yes, the .cpp files too).




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: