5 ms·
Compared to plain C, C++ tends to become unmaintainable. Everybody knows a tiny subset of the huge language, yet must somehow work together on a team. People do
by tropo 10y ago
Compared to plain C, C++ tends to become unmaintainable. Everybody knows a tiny subset of the huge language, yet must somehow work together on a team. People do not stick to a common subset of the language that everybody is comfortable with, especially considering team members that will be hired in the future.
In theory, C++ can be as fast as C. (officially lacking the "restrict" keyword, but otherwise fine) In practice, C++ is much much slower. The theory is no help. C++ code runs slow. People layer on the abstractions.
Suggested next language:
Well, although Rust and Ada look nice, I'll tell you what I use at work. I use C99 and lots of assembly. I do assembly for x86 (16-bit, 32-bit, 64-bit), PowerPC, ARM (original, thumb, thumb2, aarch64), ColdFire, MIPS, and many stranger things. Oh, don't forget the build system tools: bash, sed, GNU make, awk
- vardump 10y ago> Compared to plain C, C++ tends to become unmaintainable... Yeah, true. Used to think otherwise, but experience shows over and over again this happens in most large teams. C++ somewhat encourages too many abstractions and complicated control flow (exceptions, [multiple] inheritance, templates, ninja operator overloads). Building and linkage (especially against third party blobs) is also a big issue even in 2016. Builds are slow and binary incompatible between compiler versions and vendors. > In theory, C++ can be as fast as C. Actually, it can go both ways, C++ can be faster as well. For example when C++ enables inlining - std::sort beats idiomatic C qsort quite handily. Depends how you use it more than anything else.
- mbrodersen 10y agoWhether code is maintainable or not depends on the developers, not the language. I have worked on million+ line C++ projects that were very maintainable. And also on much smaller Ruby projects that were a total cluster f* and impossible to maintain. Don't blame the tools. A good developer can write excellent clean maintainable code in ANY language.