www.youtube.com

Why C++ sometimes sucks (17 reasons)

7/3/2024Updated 9/11/2025

Excerpt

{ts:332} know speaking of which uh it's basically still hard/ impossible to write C++ crossplatform modules nowadays uh modules were introduced in C++ 20 but still crossplatform support is yeah I I don't want to say it's it's {ts:351} limited because it's probably there so I've seen CPP talks uh that CPP con talks and another C++ conference talks exactly on this topic and still I fail uh to use them in in my own project so it seems like way too complicated for a you know average {ts:370} developer I hope this changes soon over time really less hope for the best okay the next big pain point is that if you want to prevent uh this header source file split what you can do of course you can uh Implement everything in headers {ts:390} so you have an header only implementation but the problem is that because headers are included transitively um your B if you change a header file that's used in a lot of places or is very crucial to your application then you basically need to {ts:407} recompile your horr application and uh if use the pimple indium that that helps but if you use templates you need to Define everything in the header files and so this is really slows down development unfortunately then another thing that's related to it {ts:427} if you get something wrong uh especially with templates the compiler messages are not very helpful so with the uh C++ 20 standard the concepts were introduced which uh check you know template uh class template and function plan Arguments for certain preconditions and … {ts:679} change Etc which is a kind of a hassle even if you're you know if you're just starting out in C++ and finally uh if you have a thirdparty library it's hard to predict on which platforms it will run so uh if you would {ts:695} like to support you know Mac OS Windows Linux Android and iOS you really need to do thorough checks to be sure that you know a third party library is supported on all of these platforms because these libraries rarely do such guarantees because of how Dynamic this whole ecosystem is another thing that's {ts:717} painful in relation to third party libraries in C++ is that it's hard to suppress the warnings from those libraries so let's say you want to be you know very accurate you set the highest warning level you set treat warnings as errors in the compiler but then bam you're using some third party {ts:734} library and they don't care about compiler errors or frankly it's may be sometimes difficult to uh stay up to date with the introduced warnings and errors and also the standard changes some some things get deprecated but it's uh often you need to build a huge work around to suppress the warnings on all {ts:755} those third- party libraries and I think the the most difficult setup is that because of some header file inclusions and some Library inclusions some uh file that you don't have control over is being built as part of your library and uh it's very hard to {ts:772} suppress the warnings in in those files what I found is the best way is to Simply set the warnings just for your source files which you're using but it's uh it's very difficult okay Switching gears a little bit another big problem with C++ it is that unchecked memory … {ts:829} a vector for example and you use a subscript operator then it's uh there are no checks performed at the run time so even if you do out of access uh you won't be notified of it and if you come from the Java side there you're accustomed to getting this uh array out {ts:848} of bounds exceptions well that's not the cas in C++ unless you use the specific at member which you should probably most always do and uh this may also be very confusing to people and uh especially it it introduces bugs that are super hard … {ts:997} they're so flexible and Powerful it's very tempting to try to use them but again for newcomers to this language it's something that uh quite difficult to understand and frankly macros are still being used in a lot of places another big pain of C++ that I {ts:1015} found is the poor linting often so lint is a program that analyzes your source files and tries to build this abstract syntax tree and tries to get all the which variable references which number Etc and in C++ because of all these header inclusions the source file get

Source URL

https://www.youtube.com/watch?v=y37NzWaqpbI

Related Pain Points

Slow incremental compile times after small code changes

8

Developers report that incremental rebuilds after making minor source code changes take significantly longer than expected. Workspace rebuilds trigger full dependent crate recompilation (not incremental across boundaries), and the linking phase always runs from scratch without caching, creating major productivity bottlenecks.

buildRustCargo

Unchecked memory access leads to silent bugs

8

Out-of-range access on containers like vectors is not checked at runtime by default, unlike Java. Without explicit `.at()` calls, array access bugs silently corrupt memory.

securityC++

C++ modules cross-platform support is broken

7

C++20 modules were introduced but cross-platform support remains extremely limited and too complicated for average developers. Existing implementations lack practical usability.

compatibilityC++20C++ modules

Third-party library platform support is unpredictable

6

It's difficult to determine if a third-party library will work across all target platforms (Windows, macOS, Linux, Android, iOS). Libraries rarely provide guarantees due to ecosystem volatility.

compatibilityC++

Difficult to suppress third-party library warnings

6

When using strict compiler warning settings, third-party libraries often generate warnings that are hard to suppress across all platforms. Transitive header inclusions make it nearly impossible to silence warnings in external code.

configC++

Poor compiler error messages for templates

6

C++ compiler messages are unhelpful when template code is incorrect, making debugging difficult. C++20 concepts help but require significant effort to understand.

dxC++templatesC++20 concepts

Macros are confusing and error-prone

5

Macros are powerful but extremely tempting to misuse, especially for newcomers. They remain widely used throughout codebases despite their difficulty and propensity to introduce hard-to-find bugs.

dxC++