3 ms·
You can go down the route to say C++ is largely a superset of C. You can always write C++ in the C way, so you don't see simplicity is an advantage of C.
by acmj 5y ago
You can go down the route to say C++ is largely a superset of C. You can always write C++ in the C way, so you don't see simplicity is an advantage of C.
- bruce343434 5y ago> You can always write C++ in the C way Nope. They have grown too far apart. My C11 codebase simply does not compile when `mv *.c *.cpp && g++ main.cpp`.
- kaba0 5y agoThat’s why grandparent wrote “largely”
- bruce343434 5y agoTheir second statement is still simply wrong. C has some ways of doing things which are simply unacceptable in C++. In C, you don't cast mallocs. You can initialize structs like `={0}` or `={prop=val}`. There's more, but the point is: if you are writing C++, you can't write it in a "C way". It won't compile at some point.
- kaba0 5y agoI interpreted the “C way” as in avoiding RAI, classes, references, etc. Just writing functions with structs and pointers. Not as “syntactic C”
- gnubison 5y agoWell, part of that might be because ‘mv *.c *.cpp’ doesn’t do what you think it does.