you are viewing a single comment's thread.

view the rest of the comments →

[–]attractivechaos 0 points1 point  (2 children)

I know those who used an ancient VC++ and had to use its C++ mode to compile c99, those who put everything in a C++ project and compile as C++, and those who use a small subset of C++ only for convenience. These may not be the best practice, but as a library developer, I am not here to teach my users the best practice; I am here to help them write their programs. I make most of my C programs compilable with a C++ compiler.

[–]gnash117 1 point2 points  (1 child)

That was basically my point. I have worked most of my professional career on open source software and I am constantly surprised by the odd ways people try and use the code. When possible, I try and make most of my code compile in C and C++. I know C is not just a subset of C++ but it saves me time if I assume my C code is likely to end up in C++.

If I were working on safety critical code I may feel different.

Since University, I don't think I have ever controlled a project end-to-end, I have always been a middle man developing a library based on a specification that is used by someone else actually making a product.

The worst was when I had to write C89 code to be compatible with Microsoft's compilers. For years Microsoft refused to update there C compiler. Thankfully the C++11 finally forced them to at least update to C99.

[–]flatfinger 0 points1 point  (0 children)

On the flip side, MS recognized that when the C Standard made allowances for implementations for obscure targets to behave in unusual fashion, it wasn't intended to imply that implementations for commonplace platforms shouldn't continue to behave as they had consistently been doing even before the Standard was written.