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

The majority of good, and reusable code is in libraries - as it should be. If you write a library in C++, you're limiting potential users of said library to only using C++, because there's no ABI compatibility with other languages.

C on the other hand, has almost global compatibility with other general purpose languages. It should therefore be everyone's effort to write good C libraries and promote code reuse.

Of course, there's no harm in writing your library in C++ and exposing a C interface to it - but that's not necessarily as simple as it might sound. The better approach is to design your API in C and then figure out how to implement it in C++.

As for writing the actual applications (non-reusable part), there are obvious advantages to using C++ over C.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: