Тёмный

Why C++ sometimes sucks (17 reasons) 

WolfSound
Подписаться 10 тыс.
Просмотров 1,4 тыс.
50% 1

👉 GET THE AUDIO PLUGIN DEVELOPER CHECKLIST: thewolfsound.com/checklist/
📨 Full article: thewolfsound.com/why-cpp-suck...
🍊 Check out the sponsor JUCE C++ Framework: docs.juce.com/master/tutorial...
👀 Check out SerenityOS: github.com/SerenityOS/serenity
✅ Sign up for WolfSound's newsletter: thewolfsound.com/newsletter/
✅ Please subscribe to WolfSound to let the little Wolf 🐺 grow:
ru-vid.com...
🎧 Listen to my music: thewolfofficial.com/
Hi, my name is Jan Wilczek. I am an audio programmer and a researcher. Welcome to WolfSound!
WolfSound's mission is to provide high-quality, informative, and entertaining videos, articles, and courses on how to process sound by exploring mathematics, applying algorithms, and creating code in various programming languages. Topics include sound synthesis, digital signal processing, programming languages for audio (C, C++, Python, Rust), and audio effects. I am also sharing tips on how to learn fast and effectively. Make sure to visit www.thewolfsound.com/.
WolfSound enables everybody to learn about audio programming!
ABOUT THE VIDEO
In this video, I am discussing the downsides of C++ development. There are reasons why C++ is difficult to get started and why it is slower and less safe to develop than some other modern languages, notably Rust. However, there are some upsides to C++ as well and I am mentioning them toward the end.
What is your opinion? Let me know in the comments below!
ABOUT ME
My name is Jan Wilczek. I am an audio programmer, a researcher in the field of music technology, and a musician. Through articles and videos from WolfSound, you will easily understand the main concepts of sound processing using software. My full story: • How I Got Started With...
FOLLOW WOLFSOUND ONLINE
✅ Blog: www.thewolfsound.com/
✅ LinkedIn: / jan-wilczek-audio-prog...
✅ Twitter: / wilczek_jan
✅ Facebook: / janwilczekwolfsound
✅ Instagram: / janwolfwilczek
✅ Pinterest: / jawitrle
TIME CODES
00:00 Introduction
00:25 My C++ background
02:38 Pain 1
04:03 Pain 2
05:33 Pain 3
06:17 Pain 4
07:06 Pain 5
08:36 Pain 6
11:56 Pain 7
13:04 Pain 8
15:34 Pain 9
16:53 Pain 10
18:04 Pain 11
19:30 Pain 12
22:00 Pain 13
24:19 Pain 14
25:43 Pain 15 & 16
26:50 Pain 17
28:04 It's not all bad
28:24 Upside 1
29:34 Upside 2
30:03 Upside 3
31:04 Upside 4
31:44 Make your C++ dev life easier
33:43 Upside 5
34:42 Summary
#cpp #programming

Опубликовано:

 

19 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@borges69
@borges69 14 дней назад
Thanks for your detailed analysis for C++ ( mostly bad side) . When I see the Juce sponsorship in the end of the video , it comes to my mind that maybe you can give detailed information about Juce's license management in another video.
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
JUCE's license agreement is under development at the moment. Only when things settle down does it make sense to present it. Thanks for the idea! 😉
@HairyPixels
@HairyPixels 15 дней назад
I've used pascal for years which has declaration/definition split in modules where you need to modify the declaration in 2 locations. It's annoying but I like it creates ledgers for the type at least. In other languages I've used like Swift/C# there are no modules or forward declarations and it's all just dumped into files and the compiler figures out how to link it together. The downsides to this are it's slower to compiler since the compiler needs to resolve types and it's kind of messy to have all the code and types mixed together, although practically this hasn't been a problem it's just not as orderly I would say. Hard to say which is best for me personally.
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
Thanks. I simply prefer to write things once and be done with it especially that source code changes very often.
@AK-vx4dy
@AK-vx4dy 15 дней назад
I know about nothing about C++ but here on RU-vid i saw at least few very good presentations(most from some C++ conferences) about co-routines, which even i understood (with code examples)
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
Could you link to them please? For me, there's very little on coroutines available; I could not find much personally 😐
@Mark-zk7uj
@Mark-zk7uj 15 дней назад
my beef with C++ is less with the language itself than the culture surrounding it. too many devs I've worked with treat C++ as ersatz Java, over-relying on virtual functions and dynamic polymorphism as the first and only solution to any given problem. next is the lack of a good dependency management and build system, as you say. I want the build system to be an afterthought, like it is in rust. it downloads, installs, and links all dependencies, no problem. I don't have to munge my way around header files to get templated code to compile, it just works, out of the box, on every platform it is supported on. on that point, I would like true pattern matching to be built in to C++. no, std::variant doesn't cut it, not nearly. it's a pale imitation of what pattern matching is in languages like prolog, ocaml, haskell, i.e. declarative and recursive syntactical destructuring of values. variant just matches on the outermost type, missing most of the expressive power of proper pattern matching.
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
Who knows maybe we'll get what you're asking for! 🤞
@Mark-zk7uj
@Mark-zk7uj 12 дней назад
@@WolfSoundAudio hope so! stroustrup presented a pattern matcher at cppcon several years ago but TMK it was patched together from C macros. I hoped it might at least become the basis for a new standards proposal but I haven't heard anything about it since.
@TheQxY
@TheQxY 15 дней назад
Slow compile time, difficult to set up modern environment, have to learn another language for cross-compilation (CMake), too many ways to do the same thing, etc.
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
Exactly 😉
@sledgex9
@sledgex9 15 дней назад
I really don't understand the anger with header/source split. I get it only when the objection revolves around using the preprocessor. But the split is beneficial in 2 areas that I find helpful in practice: 1. The header gives you a helpful summary/overview of the class. It helps with readability because you are onboarded quickly when you understand the shape of the class at once glance. It also helps with maintainability because it outlines the shape of the class and lets you better think about refactoring it when looking only at the outline. 2. Sometimes definitions can be lengthy. You might need to split the definition of methods into two source files to help with maintainability. Also this might be a code smell if you have many methods are too long. PS: Modules are heralded as the bane of headers but in actuality modules also support the split between declaration and definition. However, they get rid of the preprocessor which is the actual bad thing about headers.
@AK-vx4dy
@AK-vx4dy 15 дней назад
Split has sense only when it is used as binary blob later mostly for libraries (way to save compilation time/space in the past). Even TurboPascal had it in one file without problem, C++ should support old C ways but should have something better (modules?) decades ago.
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
Thanks for your feedback, I definitely agree with point 2 😉 I'm not sure if modules will fix things because there are still too few projects supporting them unfortunately...
@mattymattffs
@mattymattffs 15 дней назад
Because header files should just be auto generated. It's noise.
@philiphugoofficial
@philiphugoofficial 15 дней назад
I can see how it can be perceived as beneficial especially if you're used to it, but I'd rather have half as many files to keep track of.
@HairyPixels
@HairyPixels 15 дней назад
Having to update declarations in multiple places is annoying I think we can all agree. I've used pascal for ages now which has modules but you still have the duplicate function declarations. It's not a big problem in the scheme of the things but it's a point of friction for sure. What you gain though is a nice ledger of types and clear separation between code and types which is easy to browse.
@HairyPixels
@HairyPixels 15 дней назад
What really can a compiler to do offer defaults and the most fully-featured standard library possible? Even if they recommend defaults and provide a standard library that doesn't mean 3rd party options aren't better and should be used instead. In fact people often complain about the standard library in C++ and recommend other alternatives. Not saying your points aren't problems but I don't think C++ can help you here more than other language. Btw, I'm not a C++ programmer by any means and these problems you mention seem to exist with all compilers, just some more than others.
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
The problem with 3rd party is that it's 3rd party 😄
@sledgex9
@sledgex9 15 дней назад
Also, I don't understand why dependency management should be part of the language. Strictly speaking it is out of scope.
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
Thanks! I'm not saying it should be (npm is a nice example of this). But in C++ it's exceptionally difficult compared to other languages.
@foxwhite25
@foxwhite25 14 дней назад
Otherwise the community will create different solutions anyways and you end up with different dependency management software and the hell that is c++ and java dependency management
@foxwhite25
@foxwhite25 14 дней назад
That is like saying standard library should not be a part of a language it makes no sense, people are going to need it so you might as well create a central and stable one
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
@@foxwhite25 Agreed on the point that 3rd party package managers can either evolve too fast in their API (like Conan) or can stop being developed. With standard stuff it's less likely to happen.
@MECHANISMUS
@MECHANISMUS 15 дней назад
Linting problem is a compile languages problem. Can't be fixed. If Rust lives long enough it too is gonna have a pile of style guides from all the lovely ends of the universe. It seems your mic picks up some background or side crackling events. Which is very confusing at moments.
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
Thanks, that's interesting: are there alternative style guides for Rust besides the official one? Thanks for the mic remark, I’ll fix it the next time 😉
@MECHANISMUS
@MECHANISMUS 15 дней назад
@@WolfSoundAudio IDK about Rust standards. But I mean it's still a baby. When it's a mastodon like C++ some decades from now most probably it'll have a ton of different standards just the same.
@TheQxY
@TheQxY 15 дней назад
Lol Go solved this issue :p
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
@@MECHANISMUS Rust has a language convention built into the language. You get compiler warnings by default if you don't follow their style guide 😉
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
@@TheQxY Could you elaborate? I'm not very familiar with Go 😉
@marco21274
@marco21274 14 дней назад
Third party warning are easily surpressed if the includes are system includes. CMake has support for that.
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
When you use C++ frameworks you don't have full control over which source files are built with your custom target. JUCE is an example of this: you can run into compilation errors of JUCE's source files when you set the warnings too high for your JUCE app or plugin. That's what I meant with setting warnings just for your project's source files.
@marco21274
@marco21274 13 дней назад
@@WolfSoundAudio, have you changed the warning flags of third-party software? Why are you doing it? Or do you speak about the header files from the third-party software? Here, the system includes paths are helping because it suppresses the warnings that originate from this header. Or maybe you speak about your build system? Do you use CMake?
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
@@marco21274 I'm talking about creating a custom target using custom 3rd party CMake commands and then changing the warning flags of that target.
@marco21274
@marco21274 12 дней назад
@@WolfSoundAudio Okay, so you meant your build scripts. 😉
@heatblazer
@heatblazer 12 дней назад
C++ is tying to do all and exceeds in none. I agree and there is even more like 'never use new and delete in modern C++' , obfuscated templates that literally do nothing but mask your code, RVO and copy elision are not guaranteed by many, you can still mix C and C++ code in C++ projects. C has a standard and is easy to use without obfuscation. Also I'd not advice boost on modern C++, it's a mess, boost must go, there are Juce, Qt and Poco nowadays for big projects. I am not familiar with Rust or Carbon but C++ is becoming the new COBOL. I am professionally programming in C++ and it's just not good anymore.
@KeithKazamaFlick
@KeithKazamaFlick 16 дней назад
thanks
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
🙂
@ritanaia8663
@ritanaia8663 16 дней назад
@Scherbakov
@Scherbakov 15 дней назад
To me, the ugliest ugliness in the language is macros. It's an extraordinary mess. There's a reason why Stroustrup doesn't recommend it. While it's great flexibility, it can also be a big problem. It also becomes very difficult when you want to use libraries that were created with different build systems. The "Import Export" in modules is also very funny.
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
Agreed!
@mattymattffs
@mattymattffs 15 дней назад
Sometimes???? Cpp always sucks. We just put up with it because of the control over the code and speed of the final program. Compile time really kills it.
@mattymattffs
@mattymattffs 15 дней назад
@@chocolatezt build pipelines are pretty different to me building and testing
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
@@chocolatezt A lot of people are complaining about compile times in the Reddit thread: www.reddit.com/r/cpp/comments/1dvdhtu/opinion_which_parts_of_c_i_find_difficultannoying/ I have experienced it myself in that it can be really demotivating and defocusing 😉
@marco21274
@marco21274 14 дней назад
So you not very experienced in C++ and got lead developer? I think somebody put you in a bad position.
@WolfSoundAudio
@WolfSoundAudio 13 дней назад
How do you define very experienced? 😉 I think it's for my client to judge and they are very happy so far.
@kritosyt6225
@kritosyt6225 16 дней назад
this video about c++ sucks and rust do better 😂
@WolfSoundAudio
@WolfSoundAudio 15 дней назад
Haha, I hope not!😁
Далее
Top 5 Languages For Audio Programming
15:46
Просмотров 7 тыс.
Projects Every Programmer Should Try
16:58
Просмотров 402 тыс.
C++ Pointers Explained For Audio Programming
1:05:37
Просмотров 2,1 тыс.
Rust: When C Code Isn't Enough
8:26
Просмотров 155 тыс.
Weak Pointers in C++ (std::weak_ptr)
17:25
Просмотров 41 тыс.