3 ms·
I know C. I write software in C++. C++ is better than C in pretty much every way imaginable. Imagine, for a moment, that C++ is C but with even more tools. You
by inetknght 10y ago
I know C. I write software in C++.
C++ is better than C in pretty much every way imaginable. Imagine, for a moment, that C++ is C but with even more tools. You don't have to use those tools, but the tools are there. You could write pure C and use a C++ compiler and have very few troubles.
Structs? C++ has that.
Structs without any member functions or constructors or destructors or fancy automatic under-the-hood magic? C++ has that too.
Global functions? Don't worry.
Inline assembly? C++ has that.
The biggest trouble I've ever encountered is when ensuring portability of exported symbols. That's typically only needed when interfacing with other languages or libraries. And it's not impossible to handle (just annoying).
I could very well imagine a future where things are built with C++ instead of C. And that future will be good.
- thesuperbigfrog 10y agoThe problem is that C++ can also be worse than C in pretty much every way imaginable due to how large and complex the language is. If you believe otherwise then you have not worked with enough C++ codebases. C is much simpler than C++ and with C source code what you see is what you get.