How C++ took a turn for the worse

  Переглядів 239,874

Code Persist

Code Persist

Рік тому

C++ is a great language to know; however, as time goes on more features are added to the language. These extra features make it far weirder than it used to be. If you liked the video subscribe and hit that like button!
0:35 auto
1:32 STL
2:33 Package Manager
3:22 Error Messages
4:18 Backward Compatability
#programming #coding #software #computerscience

КОМЕНТАРІ: 925
@NithinJune
@NithinJune Рік тому
which code report video was being referenced in the video? edit: I found it ukposts.info/have/v-deo/r3d0i6KAa3dm22g.html
@189Blake
@189Blake Рік тому
Yeah, I went to look for it as well, as I remember quite well that comment 😅
@jongeduard
@jongeduard 3 місяці тому
I have watched that video too. But seriously, code report is really a special one. I mean, actually it is a very great channel that I like to watch, but please understand that he super opinionated an is quite strictly focused on totally functional programming code only and sometimes even on languages that are actually impossible to type with a normal keyboard. 😒 I think C++ is really just not a suitable language for that kind of thing. C++ is very imperative and object oriented. The more abstractions you add to the language, the bigger the safety problems become with memory and things. Rust can actually do it, because it's designed as a functional language from the ground up and because it has a really powerful borrow checker. I think the mission of C++ ends there. It's done. Actually I now believe that C is safer than C++ because it's so simple, so that serious bugs don't get deeply hidden with all the tons of abstractions. There is a reason why kernels like those of Unix and Linux are not written in C++ but C.
@NithinJune
@NithinJune 3 місяці тому
thanks for the pin
@NithinJune
@NithinJune 2 місяці тому
huh. i forgot i left this comment and i can’t down here for the same question 😂
@USGrant21st
@USGrant21st 18 днів тому
Don't name your functions "someRandomFunction" -- it's not a c++ problem, it's an illiterate programmer problem. There is no substitute to being a competent programmer, no matter which language you chose.
@creapermann6356
@creapermann6356 Рік тому
How did your initial statement "How C++ took a turn for the worse" end up in "Its still considerably better than the older versions"?
@codepersist
@codepersist Рік тому
You are completely right. Its more about the code practices behind the new features rather than the new features. While the features can be overwhelming I tried to focus the video on more about how they can be weird. It's my first video so I'll try to explain the end result better in the next one!
@henriquemuccilloschumacher542
@henriquemuccilloschumacher542 Рік тому
Well some new options are kind of harder to understand depending on how and where you use them, but in some places they could be better and make you write way less code, there's also some really usefull stuff from newer C++ versions like u8 literal strings and co-routines, templates are also useful if you don't want to write a version of the same thing for each type of variable, or make an macro that declares your entire function/class/struct with a different type in a #define statement (which would be the pure C alternative to templates) i mostly appreciate they are there, because you can always opt to not use them if they make your code too complex i'm more familiar with C than C++ so i mostly write "C with classes" stuff, but in some cases , templates and some C++ stuff really make my life easier and i mostly use them when they are needed But yeah sometimes C++ high level funcionalities scares me, i remember writing one line of code using some "New C++ funcionality" and my executable just got +4kb, while writing a ton of code would get me like +2kb, so a lot of stuff was being done but i didn't know exactly what
@Linuxdirk
@Linuxdirk Рік тому
You just fell for a clickbait title. 😁
@r.t.5767
@r.t.5767 Рік тому
He was afraid to offend some C++ programmers I guess
@hago3779
@hago3779 Рік тому
Yep, just a clickbait title. Moving on boys.
@greg77389
@greg77389 2 місяці тому
_Python coder attempts to understand C++ challenge_ (Impossible)
@zahash1045
@zahash1045 8 місяців тому
Wow a python developer complaining about the auto keyword.
@Phantom-lr6cs
@Phantom-lr6cs 27 днів тому
strange cuz in python everything is an auto by default : D a = "qweqe" b = 15 c = 1.3 def ak(): return "1111" def a3k() -> str: return "2222" print(ak()) print(a3k()) all are autos : D
@huypz
@huypz 15 днів тому
@@Phantom-lr6cs there isn't such an auto coz there isn't any type there.
@artoriapd
@artoriapd 7 днів тому
​@@huypz you can actually set type to variable, e.g. myAge: int = 10 Though I don't know if it's actually usable, I also can't verify it since I know it because a friend of mine tell me about it.
@skystr1ke
@skystr1ke 6 днів тому
@@artoriapd Python does let you add type annotations but the interpreter doesn't enforce them. The main use for them is better autocompletion (at least from my experience)
@tusharsrivastava3523
@tusharsrivastava3523 Рік тому
As someone who first learned C++ then python, I still prefer C++.
@owenlee5122
@owenlee5122 Рік тому
me too! more control easy to see what is what and where is where!
@gtd9536
@gtd9536 Рік тому
I did C then C++, then Python. If I rank the years using each with the highest first: C++, C, Python. But, I prefer python, then C, and lastly C++.
@tabletuser123
@tabletuser123 Рік тому
This is simply because you’d rather stick with what you learned first rather than venture into new territory that makes you uncomfortable
@gtd9536
@gtd9536 Рік тому
@@tabletuser123 I don't think you can come to that conclusion, alot of preference can also depend on what he does. If his experience is closer to the "metal", like embedded systems, linux drivers, etc, then that would strongly influence his preference for C/C++. I know I prefer C the lower on the stack that I go. Also, I use to write database internal engines, in particular, I use to work with parsers and compilers. And there, C++ is often preferred, but I like C. And if your experience is mostly in the areas where C/C++ and other compiled languages shine, then that can influence your opinions. But, given all that, and I've done alot of stuff in my career python is still my favorite language.... so far. (I'm going to check out python codon, looks pretty cool.) Anyways, sorry for the long reply. See you in the 'net.
@tusharsrivastava3523
@tusharsrivastava3523 Рік тому
@@tabletuser123 Nope, Python is not 10% as complex as C++.
@gustavobauer6543
@gustavobauer6543 Рік тому
The biggest problem about segfault is that it isnt a runtime error thrown by the language, it is an OS error, so you kind of can't have good error messages. In most programming languages code that could throw a segfault either throw a runtime error or doesnt even compile
@norude
@norude Рік тому
You could make a compiler flag that would include a runtime and source files in result file for the purpose of listening for a segfault, deducing where it came from, showing it and maybe providing some tips on the pattern surrounding it
@sourestcake
@sourestcake Рік тому
@@norude This already exists. It's called AddressSanitizer. You can enable it in GCC and Clang with -fsanitize=address. There's also UBSanitizer: -fsanitize=undefined.
@cristiandecu
@cristiandecu 5 місяців тому
@@norude That's what debuggers are used for and that's why you should never downplay their importance in software development. When you're dealing with a language that offers you direct access over the memory things can always go south.
@pierreollivier1
@pierreollivier1 4 місяці тому
@@cristiandecuDebuggers are great in theory, in practice they are often quite clunky especially gdb.
@skeleton_craftGaming
@skeleton_craftGaming 4 місяці тому
If you are using modern C++, a good 90% of what you do that would cause a segfault in theory throws a runtime error unless you have exceptions turned off
@tenthlegionstudios1343
@tenthlegionstudios1343 Рік тому
Big problem for me with the one liners in C++ is they aren't as clean as they are in other languages. If someone is a functional programmer and comes into C++ looking to use similar patterns, it easily gets out of control. And each version of C++ seems to have a new syntax or name. John Carmack, creator of doom and someone who has many years of C++ experience, thinks C++ is one of the hardest languages to understand when entering a new code base. This is because each code base can be vastly different. He says these problems don't exist for him in other languages, or at least not to the same extent. For me, there is just too much unnecessary complexity in most c++ code bases.
@brdrnda3805
@brdrnda3805 Рік тому
The funny thing is, that the comment above yours states it as an advantage that "It gives you ton of freedom on how you want to structure your code and allows you to use any coding paradigm you wish to use."
@tenthlegionstudios1343
@tenthlegionstudios1343 Рік тому
​@@brdrnda3805 Very interesting. I think both can be true. Languages like GO that are GC'd and fairly simple put guardrails on developers. This can do wonders in large companies for improving readability and consistency. C++ on the other hand has very few guardrails. So at large companies I could see this being a downside. But great devs love the power within C++. However, I still think a more consistent API for standard library FP like primitive functions would have helped for this one liner issue. It is hard to fault C++ though, being a language with few guardrails that has been popular for so long.
@monad_tcp
@monad_tcp Рік тому
@@brdrnda3805 "freedom to express whatever" is not good. If we have learned anything in computing is that everything is allowed, its code and by the end, the machine doesn't care. So we put restrictions on things, restrictions are useful to us human, to make sense of the complexity, to control it. But you can't sell that to C++ "people", they want freedom to do whatever, no matter what. The history of computing science is full of examples on restricting forms of computer code, because by the end of the day not all valid programs are useful and correct, so its a small price to pay when a compiler/language/method-restriction blocks some valid programs to be expressed. Examples such as : Assembly programming. Self modifying code. GOTO considered harmful. non Structured control flow (its either structured control flow, or data flow, you can't have "strange machines"). Global variables. State in of itself, specially mutable state.
@anon-fz2bo
@anon-fz2bo Рік тому
yeap
@modernkennnern
@modernkennnern Рік тому
Compare LINQ in C# - which is a somewhat similar language to C++ - to the iota/range view thing mentioned in this video. They're both "tacked on", but one is much easier to use that the other.. and it's not iota
@lombeelo8780
@lombeelo8780 Рік тому
3:33 there is an address sanitizer, which is specifically designed to do runtime checks and detailed error messages (still cryptic, but much better) for segfaults. 4:19 c++ is not fully compatible with c language, c++ is fully compatible with it's library only. 4:33 "new" is a wrapper for malloc() to make you able to use custom allocators, other than malloc() more easily; smart pointers are wrappers for "new", to make you think less about deallocations (calling delete/free() or writing destructors). Overall, the whole reason why c++ is awkward (that is what i think of it) is the ABI situation: the whole standard library MUST be backwards-compatible with it's previous versions on ABI level. Maybe it will change somewhere in 6-9 years.
@siniarskimar
@siniarskimar Рік тому
Like a year ago there was a push to break ABI, which unfortunately was voted against by the C++ standards committee. (And then the Carbon situation happened)
@lombeelo8780
@lombeelo8780 Рік тому
@@siniarskimar Heard about it. That's where my estimations came from.
@gamerk316
@gamerk316 Рік тому
@@siniarskimar Given how long-supported some codebases are, outright breaking the API is unlikely. What's more likely to happen is certain features/keywords get depreciated, and eventually generate a warning/error if used unless the compiler is explicitly told to support those features (ideally with an error telling you what to use instead).
@GGGBC
@GGGBC Рік тому
@@siniarskimar C++ standard does not have ABI compatibly (but C does as far as I know). Maybe you were referring to API break?
@GGGBC
@GGGBC Рік тому
I do not think new is a wrapper over malloc. I would recommend searching for free store vs heap memory on this subject. It's not mandatory for these memory zones to be overlapping.
@amitkriit
@amitkriit 8 місяців тому
Being a C++ dev I find Python so weird that I unlearned it. Python is beyond my tolerance level.
@MoolsDogTwoOfficial
@MoolsDogTwoOfficial 5 місяців тому
I started with Python, did it for a few years and then decided to bite the bullet and learn C++. Ever since, I have not looked back. Python is just too limited compared to what C++ can do.
@dabbinghitlersmemes1762
@dabbinghitlersmemes1762 5 місяців тому
@@MoolsDogTwoOfficial I started with BASIC and went back there from Python.
@danielhalachev4714
@danielhalachev4714 4 місяці тому
Absolutely. I despise Python. It can't even behave consistently between different OSs.
@username7763
@username7763 4 місяці тому
Python has something really nice going for it; it integrates with C++ well. I've done Node native modules, Java JNI and FFIs with other languages. Nothing is perfectly easy, but Python is the closest. If you want a dynamic typed interpreted language, you could do much worse than python. I don't generally want such a thing, but there are times it is handy.
@MadpolygonDEV
@MadpolygonDEV Рік тому
I think people who are really accustomed to python maybe have a hard time seeing beyond the abstraction python comes with. It seems difficult for some to grasp some things when python does alot of heavy lifting. Thats why I personally don’t recommend starting with python. I started with python in the past and it doesnt have any types and alot is very simple. This is definitely one of the strengths but also a weakness. As a new programmer or someone who never or barely used a c language, one may be quite overwhelmed how little hand holding and abstraction there is.
@codepersist
@codepersist Рік тому
I should have mentioned I've used C++ for quite a few years and use basically all the things I mentioned in the video, but I just think many of the features allow developers to make bad programming choices. Both languages have their purposes. Obviously I wouldn't make an OS or something of that sort in python but would rather use C
@MadpolygonDEV
@MadpolygonDEV Рік тому
@@codepersist I understand, I think C++ has its strength but also weaknesses. Like you mentioned debugging can be a nightmare
@RenderingUser
@RenderingUser Рік тому
Actually, I still believe python is the best beginner language It's definitely better to go into python first and then c++ than to just jump into c++ right away. That way, the difficulty curve for learning c++ is gonna be a lot less. You'd already be aware of the basic concepts of programing before you touch c++ and that lightens your load a bit. I mean, if you're learning c++ anyway, you'd still be learning things beyond abstractions regardless of whether you learn python first or not But these days I'd probably recommend rust instead of c++ tho :P
@Bliss467
@Bliss467 Рік тому
Honestly I think the best starter language is Lua. It’s incredibly bare bones but abstracts away confusing stuff like pointers and memory management.
@RenderingUser
@RenderingUser Рік тому
@@Bliss467 lua is pretty cool As far as I'm aware, it's faster than python But python still has the largest collection of libraries
@Webfra14
@Webfra14 Рік тому
Sometimes (when nobody is watching me) I open a text editor and start writing C++ code as if it was the '90s again. I was stupid, C++ was great and nobody around to tell me I'm doing it wrong...
@astrahcat1212
@astrahcat1212 6 місяців тому
I like simple languages like C and Lua, they never change just the same ol thing.
@durrcodurr
@durrcodurr 2 місяці тому
C has had several standards iterations over the decades. C does change, but it's fairly small changes most of the time (as opposed to C++).
@MadpolygonDEV
@MadpolygonDEV Рік тому
One more thing I want to say, while there is a std library and every company has its own convention, the beauty about C and C++ is, it doesnt force you to write code in a specific way. It gives you ton of freedom on how you want to structure your code and allows you to use any coding paradigm you wish to use. Do you want to structure part of the program procedurally and mix it with object oriented design? Go for it, the language allows you to be creative. You can use abstract nested code, but you dont. I think people have a misconception that c++ forces you to write code like in 1:56 but if you think its too unreadable, then you re free to write code however you like if you stay within the syntax of course :D
@what42pizza
@what42pizza Рік тому
Don't most languages let you program in any way you want? I know that languages like Java force you to use OOP, but I've heard that even C# lets you mix OOP, procedural, functional, etc. So does C++ have some sort of reason why it's more free? I don't really see any difference
@ky3ow
@ky3ow Рік тому
i don't think 1:56 is unreadable, iota is very strange name for range but if you know a bit about fp then this is very readable function just ignore [](){} lambda, its so ugly
@blablablablablup1
@blablablablablup1 Рік тому
Although I have to say: as a beginner in cpp it's really confusing that there's so many ways of programming the same thing. Especially with memory management. There's raw pointers with malloc, new/delete and smart pointer/RAII wrapper. It's like really hard to find out what the best code practice is, when there's just too many ways to do the same thing. And when it gets to template programming or even compile time polymorphy the syntax is beginnig to get really confusing. Never quite understood when I have to describe whether i'm talking about a type or not.
@ClaymorePT
@ClaymorePT Рік тому
@@blablablablablup1 That's because the language is old and has a ton of legacy code behind it. It's not a hype language created in the last ten years without legacy. It's just not possible to remove features from the language without causing havoc. If you want to follow best practices in modern C++, just check out some Modern C++ books and follow the practices for C++20.
@myname2462
@myname2462 Рік тому
​@@what42pizza Yes. You can also use in C# Pointer stuff if you want to for whatever reasons.
@spacelem
@spacelem Рік тому
Weirdly, I saw that same Code_Report video as a random suggestion, and it really sparked my interest in C++ again. The syntax is horrible, sure, but it's not spaghetti code (unlike the code in the video Connor was responding to), it's just FP, and I code like that in other languages all the time. Also C++20 gives you three different ways of allocating memory, but you're really only supposed to use the latest way, the older ones are just there so old code doesn't break.
@victotronics
@victotronics Рік тому
There are three ways of allocating memory, but thanks to RAII and stl containers you almost never need to. While C has "pointers" (really: addresses) all over, you really don't need pointers of any type much in C++. Parameter passing? pointer -> reference. Array allocation? pointer -> no-such-thing-the-data-is-internal. String allocation? Pointer -> again no such thing. Graphs? Ok, there you can use smart pointers.
@Rosen2221
@Rosen2221 10 місяців тому
Its wrong that you don't need raw pointers any more - take for example some model object to display data in a javascript gui. I want to create that object in c++ to connect it to backend, but I dont want that object to be owned by the c++ backend (not shared or unique_ptr) - I want it to be owned by js and garbage collected, when the gui is done with it (e.g. some data in a dialog). So raw and shared_ptr are not the same and you dont only need to use the latest. This is not npm
@victotronics
@victotronics 10 місяців тому
@@Rosen2221 Yes, well, if you need to interface between two languages. Besides I was not making a categorical statement. I was arguing that most of the C-like uses of raw pointers had gone away.
@VintageToiletsRock
@VintageToiletsRock Місяць тому
I'm taking malloc to the grave!
@SimGunther
@SimGunther Рік тому
Progsbase has a blog entry on the usefulness curve vs the understandability curve. It turns out that C is in that sweet spot for enough language features while still creating understandable code whereas java and c++ are.... quickly shifting into incomprehensible territory with the number of features they're adding.
@pluieuwu
@pluieuwu 4 місяці тому
C does give you an awfully big room to write spaghetti though... _stares angrily at literally anything that has to do with GTK, GObject or anything in GCC_ last time i had to hunt down a segfault in chromium, i had to wade through like 3-4 layers of implicit macro magic that concatenate random names to make them easier to write but nightmarishly hard to search for, until i arrived at the point where it's a crash within GTK3 with the wayland IM module enabled. had the code been any cleaner, i wouldn'tve needed to spend 3 hours debugging it 😂 C can be beautiful if written with considerable self-restraint, but that restraint is just missing in a lot of the biggest C codebases you'll walk into, because some people have completely forgotten the saying "just because you can, doesn't mean you should." just compare the impl of `isalnum` in glibc and musl, for example 😂
@skeleton_craftGaming
@skeleton_craftGaming 4 місяці тому
The issue with C++ is not that it is a complex language [it relatively isn't] it is that people use bad practices in their code
@durrcodurr
@durrcodurr 2 місяці тому
@@skeleton_craftGaming You're wrong -- C++ is the most complex programming language there is.
@skeleton_craftGaming
@skeleton_craftGaming 2 місяці тому
@@durrcodurr not relative to its power... C++ can do a lot more than most languages...
@lurgee1706
@lurgee1706 Рік тому
While I wholeheartedly agree on some of points (error messages have always been notoriously horribble in c++, and package managers are not as good and standardized as in some other languages), some other points seem a bit far fetched. I don't see how auto is different from var/let/etc. If someone writes obscure indesciptive code, it's their fault. Similarly, std is simply a tool, and it's perfectly fine to write "oldschool" code with explicit iteration etc. Std just gives you a way to not reinvent the wheel when it's not necessary. For instance, in your example they solve a very simple problem, and in that case I'd probably prefer the old snippet as well. Now let's imagine something more complex and with more steps. Suddenly a dozen lines of piped code become more readable than a dozen error prone functions you need to test. Long story short, some of the tools are simply misused or are a bit of an overkill for some tasks, but it doesn't make them inherently bad.
@usrnewxnew5227
@usrnewxnew5227 5 місяців тому
Honestly the error messages are always gonna be bad. Its an OS level error, at that level the os has no additional information available other than "is the program reading/writing anywhere else other than the areas I allowed it?"
@negai_
@negai_ Рік тому
oh, you said just in the beggining "As a python developer" and then I understood why you said that c++ is weird.
@kappaluka7532
@kappaluka7532 4 дні тому
True hahahahahhahah
@user-cy1rm5vb7i
@user-cy1rm5vb7i Рік тому
you might think that auto is somewhat overrated, but you miss the main point about auto -- metaprogramming. It allows the programmer to just slap the keyword and the compiller would do the rest. Plus you can constrain the type, by using a concept in c++20
@firstname4337
@firstname4337 Рік тому
LOL, no -- it still sucks
@MsKelvin99
@MsKelvin99 Рік тому
I wanted to say the same thing, think of auto as another way to declare template parameters and you will be fine - because under the hood that is exactly what auto is - a template param with nicer syntax
@halfbakedproductions7887
@halfbakedproductions7887 Рік тому
Auto saved my hair and my sanity more than once. Just couldn't figure out what the f--k the compiler wanted and couldn't make it shut up as it spewed errors like Mr. Creosote. Then just use auto and go back to your life. Particularly helpful with templates and other weird stuff. Most people aren't smarter than the compiler and the compilers are built by people much smarter than you could ever imagine. Trust the process.
@samgould8567
@samgould8567 Рік тому
@@halfbakedproductions7887Compiler people are just obsessive and focused, not necessarily smarter. I appreciate them, but no need to lug out the pedestal.
@1InVader1
@1InVader1 9 місяців тому
@@halfbakedproductions7887 or you could just use some helpful typedefs and that way your code becomes simultaneously readable, shorter and as long as the typedef has a good name, the code documents itself.
@blablabla7796
@blablabla7796 Рік тому
You’re right about how it gets hard to figure out the type of something if you use auto to define it. Unfortunately, the problem is already solved by every modern IDE and every syntax highlighter extension for things that aren’t IDEs. I use Vim and it tells me every deduced auto type as soon as I open the file. Sure, some languages do it better as you don’t even have to type auto. And the modern “variable_name: optional_type” syntax is more uniform, but unfortunately, C++ has the baggage of being somewhat conformant to C. But besides that, I don’t see any real problem with the auto system.
@skeleton_craftGaming
@skeleton_craftGaming 4 місяці тому
There's no way to allowed generic programming while still guaranteeing time safety..
@blablabla7796
@blablabla7796 4 місяці тому
@@skeleton_craftGaming explain?
@xGOKOPx
@xGOKOPx Рік тому
C++ template errors are horrible because at the point in the compilation process where they happen templates are fully expanded and some of them are very long; then the way the error is worded makes the fully expanded type name be said more than once; then since the template was included in n cpp files the error likely occurs during compilation of each one of them so it gets printed n times. Yup, not a nice experience
@anon_y_mousse
@anon_y_mousse Рік тому
Learn to program, then you won't have indecipherable template errors.
@coorbin
@coorbin Рік тому
My “favorite” pet peeve in C++ codebases is how each library/ecosystem/codebase has their own custom type system for numbers, pointers and strings. These are usually ancient typedefs that can never change because people rely on example code from 1996 to still work using these libraries/environments. A great / horrible example is the Windows API. Why does Windows have a custom string type all of its own? Why is it so special that it can’t just use a normal std::string or std::wstring? Why? Oh, because of legacy reasons, of course. And even more recent libraries that care less about backwards compat still have their own type system, like QT’s QString, because they can’t rely on the availability and consistent functionality of the std types. Sometimes just translating between the type systems of different libraries can be a task on its own!
@mightymalakai
@mightymalakai Рік тому
maintaining backwards compatibility is a very important piece of software. Especially for something like an operating system (Windows).
@maksymiliank5135
@maksymiliank5135 Рік тому
I thought that windows 32 api is just written to work both with c and c++ (though i might be wrong), so you can't really use the standard c++ features like namespaces and so on. An the string type is just an alias to a char pointer
@torphedo6286
@torphedo6286 Рік тому
Yeah, and I hate how they still use "DWORD" for 32-bit integers even when a double word is no longer 32-bit on modern CPUs. Why can't they just replace it with "uint32_t" or "u32"? It wouldn't actually change any code functionality because it just changes the type alias.
@oginer
@oginer Рік тому
Windows API is C, not C++, so of course it doesn't use C++ library. And about QtString: I really miss it when I'm not working with Qt. stl's string is so barebones. It doesn't even support unicode. Trying to work with unicode text using only standard c++ is a nightmare. QtString handles it all for you, and has many useful methods std::string doesn't.
@gamerk316
@gamerk316 Рік тому
Not wrong. My company supports a *lot* of long lived projects that span across multiple HW platforms. We recognized very early on the problem of C/C++ types not being a fixed size (this was in the days before stdint.h), so we developed a company wide company_globals.h that we included in basically *everything* that gave us these fixed length types (plus more). We have stdint.h now, and even though there is little to no risk transitioning over, no one wants to risk a problem developing, given how ancient the codebases we support are.
@minneelyyyy8923
@minneelyyyy8923 Рік тому
Correction: auto did exist in C, however it didn't do the same thing it does in C++. It was used to define a type with automatic storage duration, it did not automatically deduce the type of a variable.
@ittakir
@ittakir 4 місяці тому
For me as C++ programmer, Python has one big red no-no flag that I cannot overcome: The Indentations. I always use {} in C++ even in one-line blocks. This makes me much easier to see the boundaries of a code block. If I copy-paste a block of code in C++ with {}, it will not lose a boundaries because of shifted indentations.
@martinjakab
@martinjakab 3 місяці тому
Its the least of Pythons problems
@IAmNotASandwich453
@IAmNotASandwich453 Місяць тому
You know, at first that startled me too, but over the years I kinda started liking it, because if you care about clean Code, you should strive for clean indentations anyway. Making it a functional part of the language Force you to be clean.
@ittakir
@ittakir Місяць тому
@@IAmNotASandwich453 I don’t need to be forced to write clean code. I can do it without some weird rules that contradict most of programming languages.
@IAmNotASandwich453
@IAmNotASandwich453 Місяць тому
@@ittakir Well, maybe, but you have probably seen a lot of other peoples Code that just dont care about it. While, in an ideal world, a formatting tool should take care of this anyway, thats sadly not how it works everywhere
@korigamik
@korigamik Рік тому
What a cool video. I'd be very interested to know what you use to make these code animations 😊
@yrds96
@yrds96 Рік тому
There are some points that I disagree about complexity of STL: In languages like JS, you can increase the density of your code using map, reduce, filter, proxy, entries etc... It's basically the same with stl and . With smart pointers, I think which the addition of this feature there are LESS ways to worry about how to not leak a memory. About message errors I have to agree with you, some compilers(like gcc) has less cooler messages than llvm compiler, which sometimes give you no information about how to fix an error. But there are some tools like clang-tidy which improves the quality of your code. About the package managers you are absolute right: there are no simple solution, and the simplest I've used are not pointed in this video: Meson. With meson you can simple "meson wrap install [lib]" and then add two lines to your meson.build and you are already ready to use a newly installed library.
@khatdubell
@khatdubell Рік тому
bazel, from google, is just as easy to use 3rd party c++ libraries.
@sergeykolesnik1171
@sergeykolesnik1171 3 місяці тому
it is not STL. It is C++ Standard Library. STL is an ancient MACRO garbage from Microsoft
@exmachina767
@exmachina767 Рік тому
Your criticism on error messages is spot on. It’s a nightmare for beginners when a missing semicolon generates reams of error messages.
@apina2
@apina2 8 місяців тому
Conclusion: C++ took a turn for the better Nice title bro
@metroidsky
@metroidsky Рік тому
Great video! I'm subscribing.
@sharpesttoolintheshed492
@sharpesttoolintheshed492 6 місяців тому
Within C++, there is a much smaller and cleaner language struggling to get out.
@blackimp4987
@blackimp4987 21 день тому
yes it's called 98
@sharpesttoolintheshed492
@sharpesttoolintheshed492 18 днів тому
true except for the cleaner part
@marianaavalosarce5393
@marianaavalosarce5393 Рік тому
I find c++ very logical and makes you invest time in having the data types controlled, which makes you not lose the hang of your code that soon. In big real-world problems, code needs to be fast and portable, and c++ with cmake does it. It requires practice and abstraction, but at the end of the day software is here to solve people's problems in the fastest way possible.
@vende4408
@vende4408 Рік тому
in big real-world problems what matters isn't speed of code execution, but speed of writing this code
@vlad071096
@vlad071096 Рік тому
​@@vende4408 only in the world where all the programs that must be efficient have already been written
@kartonrad
@kartonrad Рік тому
tbh, you get the same in rust, except you don't die before you understand a new codebase though tbh i can adjust to c++, but its just so annoying to read it
@christianasch9176
@christianasch9176 Рік тому
@@vende4408 lmao no if you're making anything related to HPC
@grantrithor
@grantrithor Рік тому
There's a lot that I can excuse c++ for due to its age but when you get a template explosion in the compiler that can just ruin your day.
@cunty
@cunty Рік тому
"...but some of the syntax can just get weird" *vine boom*
@SuperMixedd
@SuperMixedd 6 місяців тому
> as a primarily python developer opinion invalidated
@LunaticEdit
@LunaticEdit 4 місяці тому
The linker error you showed makes perfect sense. One of your modules (.obj/o) is requiring the function test_fn from some other object file, but that object file wasn't included in the link phase. The entire point of a link phase is to LINK the obj files together. Also that segfault shows you _exactly_ what went wrong... I feel like you are expecting C++ to be a junior developer friendly language. It is not. And those standard library things that you find "confusing"? Yeah those can end up making your apps way less error prone, and way more optimized than whatever hand crafted shenanigans you crafted in the 5 minutes you thought about that logic.
@yjk_ch
@yjk_ch Рік тому
1:18 `auto` is not really an issue. Auto parameters are not that common(TypeScript has similar feature), but other modern languages are doing something like `auto x = y`: Go: x := y Rust: let x = y Kotlin: var x = y And not only hovering on the variable on modern editors/IDEs show its type, but in these days it is also shown via inlay hints, so that you don't even have to hover on the variable name. 3:01 This is only really problem limited to Windows. In Linux, you can just use system package manager.
@roarc0
@roarc0 4 місяці тому
yes but then you specifically need ubuntu 22.04 or a docker to build that particular library version, or cmake doesn't work for another distro etc.. with go or rust you have much nicer control over the version of library you use.
@RoyBrush
@RoyBrush Рік тому
First of all, I just want to say, this is a really well put together video. Just one tiny thing I wanted to mention here, is that in the example you chose there for STL in your second point, I kind of have to disagree with a little bit. I realize that it looks unfamiliar to you, but in the functional programming world, that looks very normal, in my opinion. Most people who have some time invested into a language like Haskell, or Elixir, or F#, or maybe even something like Clojure, would find that pretty readable and conventional. Words like "accumulate", "filter", "map", "reduce", and so on, are very much in the lexicon of functional programmers (iota is a little less common, but you can look that one function up, and then very quickly understand what is going on because the rest looks very familiar), and even though I personally don't like that C++ currently uses the same operator for piping and bitwise or, the concept itself of piping from one function into the next looks normal to people who use functional languages. :) It's not to say that you should use that type of syntax all the time, but, for example, if you were dropping into C++ for some reason with the intention to use it across an FFI into a functional language or something, then that type of syntax might actually be more readable to your maintainers than the alternative. Or even if your whole codebase was C++, but you had a group of people who decided on using more functional conventions, I think that the example you showed there would be really quite readable, I think it would probably be even quicker/easier to read than the alternative for such a group of developers. :) I'm not a hard-core defender of C++ or STL in particular, and we've all seen that there has been plenty of cruft in STL over the years, but in this particular case, I think the criticism isn't warranted in the way that you described it here. Contrast with the one-liner you showed in python, which I do think is complex enough that it is less readable than the alternative, and it isn't using common functional programming conventions like the C++ version is. Even the python code is not terrible or anything, but yes, I think it is harder to read than the original C++ version you showed. I think you do have a valid point in some cases with STL, but the example you chose here is, in my opinion, not the best illustration of it. Anyway, you made a very entertaining video here - I know you're primarily a python person, but it's cool that you've been branching out, and I hope you'll continue to explore other languages and paradigms and continue learning and growing throughout your whole career. I've subscribed, and I really look forward to seeing what you do next! :) And by the way, the production quality on this video is great - the fact that you only have 68 subscribers right now including me, and you're already putting out videos of this quality, is really something you should be proud of, so really, really great work. :)
@sophiacristina
@sophiacristina Рік тому
Very well said, just like the error message example, i know some error messages are confusing, but the example of "'map' is not a member of 'std'" and not deducing that it lacks a header is ludicrous...
@deeplazydev
@deeplazydev Рік тому
+1
@1InVader1
@1InVader1 9 місяців тому
I completed a functional programming class in the uni with Haskell, hated every part of it. I've sworn I'd stay away from functional programming languages, and now here we are with C++ getting very ugly lambdas. This is not what I signed up for ffs.
@climatechangedoesntbargain9140
@climatechangedoesntbargain9140 4 місяці тому
​@@1InVader1don't hate it, use the best parts to write more maintainable code
@jawad9757
@jawad9757 4 місяці тому
​@@1InVader1 mald
@KiranasOfRizon
@KiranasOfRizon Рік тому
0:53 Reeeeeeee, why are test_v and auto_vec being declared as raw pointers? They should ideally be declared on the stack, and if that's not possible, should be declared as unique_ptr.
@IAmNotASandwich453
@IAmNotASandwich453 Місяць тому
Why would you use a pointer to a vector anyway? The point of a vector is literally to handle the dynamic stuff for you. Youre just throwing all the advantages anyway if you decide to allocate one manually.
@williamkatcher2469
@williamkatcher2469 Рік тому
This is mainly a (valid) critique of how some developers write bad code. Putting complicated constructs into one liners with filters, lambdas, transforms, etc., renders unreadable code. It is usually a developer who is learning about these new gadgets and find opportunities to stick them in his code. I would just avoid that style. You can still use perfectly modern c++ without cramming all those constructs into one line and make your code just as efficient but vastly more understandable by everyone. The best thing about auto is it makes code a lot simpler by reducing a lot of the boilerplate type specifications. Just because a feature is available doesn't mean it should always be used. As a developer, it's your responsibility to pick and choose what's appropriate.
@skeleton_craftGaming
@skeleton_craftGaming 4 місяці тому
I mean using less code usually makes your code more readable, especially if you use well named functions, like the STL.
@banikaritra5328
@banikaritra5328 Рік тому
Great video quality. Can you make a video on Nim programming language.
@Oaisus
@Oaisus Місяць тому
After using it for a few years you learn what causes what incomprehensible error message. They make perfect sense in the context of the template spaghetti that is the STL it just takes a while to be able to correlate what broke in the templates with what you actually did in your code.
@ooichu_
@ooichu_ Рік тому
0:40 in C `auto` is storage class, not a type
@desmondbrown5508
@desmondbrown5508 Рік тому
Yeah, I see this problem even with C# in our codebase all of the time. Everything apparently needs to be condensed down. And sure it "feels good" when you can do that... and it MIGHT even be more efficient if the standard lib does it better than you would've. But then you come back a month or more later to fix a bug... and it can take upwards of 25 mins or more just to figure out what the hell is going on. And it gets worse when we're not sure WHY something was implemented but because we've taken all these shortcuts to reduce code, there's more reliance on that shorter code, which ultimately means more rewriting if something has to change and can't use that library function.
@sergeykolesnik1171
@sergeykolesnik1171 3 місяці тому
you: "it gives zero information where the program crashes" also you: *shows the full stack trace one line below* :SHM:
@guy-
@guy- Рік тому
Amazing how you can edit so well, did you have a channel earlier or were you an editor for someone?
@juanma_cello
@juanma_cello Рік тому
I never understood the hate behind C++, I just love it, high level abstraction capabilities, low level memory control just all in one. I know, it does not have a package manager, and it’s syntax starts to be a cumbersome, but when you get the point is awesome. I just find that some people is lazy to find performance issues or memory leaks 😂
@simongido565
@simongido565 Рік тому
Package manager is useless, C++ programmers write everything themselves. :D. ( partially joke, partially true )
@samgould8567
@samgould8567 Рік тому
@@simongido565Mostly true. It is such a pain to deal with 3rd-party deps in C++ that most shops avoid all but the most useful and popular libraries. It is a far cry from the opposite extreme of Node and NPM.
@khatdubell
@khatdubell Рік тому
I don't see what exactly a package manager would solve. The overwhelming majority of open source libraries are on github, so its not a matter of being able to search for them. If its integration, bazel has this solved pretty well. A couple lines of bazel (just telling it where to find the project), and you're building and linking the external library. I say let the best technology win instead of trying to build some sort of official C++ package manager that may or may not get acceptance. And considering most people who complain about there being no package manager are also people who complain about the standard library and modern features of C++, chances are they would complain about the package manager too.
@cristiandecu
@cristiandecu 5 місяців тому
@@khatdubell C++ is just a language and there's no such thing as a package manager in a language; python has a package manager because it is more like a framework rather than a language. What boggles my mind is the level of ignorance these people that are comparing apples with potatoes are showing. I mean just imagine have a package manager for C++ and another one for C. Your workstation would look like a gamer's PC bundled with a bunch of "launchers" from various companies.
@IAmNotASandwich453
@IAmNotASandwich453 Місяць тому
Honestly, the syntax is exactly why I fell in love with it. I love dealing with hieroglyphic stuff, passing lambdas as callabes to templates, doing stuff with typetraits and what not. If I see a template ending with 6 angular brackets, I just love this shit lol. Its so fun to dig deeper, trying to figure out which Part belongs where and assemble the pieces of complex definitions.
@Frigionman
@Frigionman Рік тому
With segfaults, while C++ doesn't tell you exactly what happened. You can and should look at the core dump. Usually it is enough to tell you what the hell happened, as it tells you useful things like: Stack state Register state Last function call Cause of sigsegv
@zackyezek3760
@zackyezek3760 Рік тому
They’ve recently added stack traces to the STL, and on the big 3 (Linux, Windows, Mac) there are compiler flags that will let you capture errors like segfault as exceptions. So this is a problem that’s actively being fixed.
@cristiandecu
@cristiandecu 5 місяців тому
Yes, but pythoneers that are trying to migrate to C++ don't really know what a core dump or even a debugger is; they just simply complain that the language lacks this and that which kind of makes you think how little these people know about C++.
@Janrupf
@Janrupf Рік тому
Very interesting and well made video, was kind of shocked when looking at the amount of subscribers and the fact that this is your first video. Generally I think what you are trying to say is absolutely valid, but I think it would be better if you more thoroughly researched aspects you are not totally sure about. Neither linker errors nor bad segfaults messages are a C++ problem - you can get those exact errors with Rust too, and I mean the exact same. The reason being that the linker used by Rust is the same - so same errors messages there, as well as that segmentation fault error messages are generated by the operating system itself. Most other runtimes don't generate segfaults (or only in case you uncover a bug in the languages runtime implementation). To make it short: neither linker error messages nor segfaults are a C++ specific problem. I think the other things you mentioned are totally valid points. All in all, great video, even if some things were slightly incorrect. I'd like to see more of those videos
@freyja5800
@freyja5800 Рік тому
I wouldn't agree with that entirely (at least the linker part): a) the linker error shown in the video is perfectly readable and tells us all the information we need to fix it (which symbol is missing, where it was referenced, etc). but c++ linker errors can indeed be awful due to name mangling, so if you have a linker error regarding some heavily templated class or something, the symbols can be rather hard to read to figure out what exactly is missing.
@rosa_bot7594
@rosa_bot7594 4 місяці тому
"auto concept_name variable_name" is such a great replacement for templates with verbose requirements and/or enable_if's. like, ex: "auto std::integral x" so simple, so readable.
@The_Codemaster144k
@The_Codemaster144k Рік тому
Does this man have less subscribers than even me? Bro get this man at least to 500k subs. How are you making such cool videos and the algorithm hasnt chosen you yet?
@random_guy_on_the_internet69
@random_guy_on_the_internet69 Рік тому
The biggest problem for me are the templates in combination with the stl. I was implementing a templated function that takes in a message, formats it (adds time, etc.), and prints it to the console and a log file. But I wanted some easy formatting and parsing too. And since I was already using std::format() in the function, I thought I could simply make the function take in a variadic template argument and pass that to std::format() using std::forward(). But whatever I tried, nothing seemed to work. It kept giving me errors that said there was something wrong with the stl, instead ofbthe way I was passing it to format.
@spell105
@spell105 Рік тому
You're just doing it wrong, you can absolutely and easily do that.
@skeleton_craftGaming
@skeleton_craftGaming 4 місяці тому
Yeah, that might be one of the only reasons to use the printf family of functions... (And C style veriadic functions)
@Maiuna-yc2uk
@Maiuna-yc2uk 2 місяці тому
To wrap a std::format inside your function you need to use std::format_string type as the format specifier to be used in the std::format.
@qqshutup7175
@qqshutup7175 2 дні тому
From cppreference: "Since P2216R3, the format string must be passed in as a compile-time constant, and std::format does a compile-time check on it (via the helper type std::format_string or std::wformat_string). If it is found to be invalid for the types of the arguments to be formatted, a compilation error will be emitted. If the format string cannot be a compile-time constant, or the compile-time check needs to be avoided, use std::vformat or std::runtime_format on fmt(since C++26) instead." 30 seconds of reading
@qqshutup7175
@qqshutup7175 2 дні тому
@@skeleton_craftGaming std::format/std::format_string resolves the formatting at compile time, determining the most efficient way to format the string and allowing the compiler to prevent compilation if the formatting is not valid, while std::vformat will throw at runtime if something is wrong, while sprintf will cause UB.
@HolographicKode
@HolographicKode 4 місяці тому
Cool presentation. What tool did you use to create the code animation ?
@not_herobrine3752
@not_herobrine3752 3 місяці тому
iirc, dragging and dropping code from vscode into powerpoint and doing some animation in powerpoint should work
@zxmon_
@zxmon_ Рік тому
What do you use to display and move the text?
@yavvivvay
@yavvivvay Рік тому
My only issue with c/c++ is that it tends to be very symbol-heavy and for some reason people insist on putting types into variable names in type-safe language (and using hundreds of preprocessor directives to redefine types into THEIR types and make pseudo-functions) which makes it a nighmare to read. Preprocessor is evil and makes reading code a nightmare.
@harleyspeedthrust4013
@harleyspeedthrust4013 10 місяців тому
Preprocessor is not evil, it has plenty of valid and sensible uses. People are just not sensible.
@yavvivvay
@yavvivvay 19 днів тому
Hence the preprocessor giving too much power and too little control is an issue. Much like free pointers.
@nick15684
@nick15684 Рік тому
auto is definitely one of the things about C++ that I'm not really a fan of and never use. It adds a lot of ambiguity to a language that otherwise wants everything to be done very explicitly. It's something that makes more sense to exist in an interpreted language than a compiled one. I get that it's convenient, but ultimately it just adds more chaos. It's a hackish/lazy way of doing things. Not really worth it in my opinion.
@simongido565
@simongido565 Рік тому
I use auto in places where it is obvious what type is behind auto.
@xGOKOPx
@xGOKOPx Рік тому
> It's something that makes more sense to exist in an interpreted language than a compiled one. C#'s var and Rust's let disagree
@spell105
@spell105 Рік тому
There is nothing ambiguous about it. The type is known at compile time so why write it out? Any half decent editor can show you what the actual type is.
@khatdubell
@khatdubell Рік тому
In my experience, the type of people who hate auto are also the type of people who don't initialize their variables. using has nothing to do with convenience. It was introduced out of necessity, first and foremost. Modern C++ could not exist without some way of specifying a fixed type that the compiler knows, but you don't. Good luck writing a lambda in a reusable way without auto. ``` auto odd_filter = [](const int x){ return x % 2 == 0; }; ``` Can't do it. Back to my previous point, and why you should use it, which is also a reason you see it in newer languages like rust is because uninitialized locals are a source of many bugs. Too many old school developers who grew up when the "modern" thing to do was declare all your variables at the top of the function. And naturally, they wouldn't initialize them to a default value because its a wasted cycle because you'll just be overwriting it later. forcing yourself to use auto for as many things as possible actually makes you think about your code. because it makes you ask yourself if you should turn this (code a co-worker wrote literally last week) ``` int x; if (something.is_true()) x = something.value(); else x = 0; ``` into ``` auto x = something.value(); ``` where x is now optional, and we can check if x has a value if and when we need it, and a sensible default can be determined by whoever wants the value.
@tiranito2834
@tiranito2834 5 місяців тому
@@xGOKOPx does that mean that they are correct tho? i still believe that ambiguity is not a good thing when you're in a systems programming language. If you want to use this like it's python or JS then knock yourself out, but the rest of the world would like it if we could actually use the language for a project larger than a few hundred lines of code. While the type is not ambiguous from the point of view of the compiler, from the point of view of a programmer stuck in a raw text editor in some embedded system it sure is a pain the ass.
@whoopsimsorry2546
@whoopsimsorry2546 Рік тому
Sum up: expert friendly, unique take.
@danielhalachev4714
@danielhalachev4714 4 місяці тому
I don't understand why would a person coming from a language with dynamic types like Python complain about the auto keyword, even in strange use cases such as a parameter type.
@KurtisRader
@KurtisRader Рік тому
I am a grey beard (I got my first programming job in 1979). I fell in love with C in the early 1980's and hand transpiled Donald Knuth's TeX typesetting program from Pascal to C. Nonetheless, I have never liked C++ and recent changes to the language have made me dislike it even more. C++ is now approaching Perl for its obtuseness and any given block of code to resemble RS-232 line noise.
@tomvitale3555
@tomvitale3555 Рік тому
I gave up on C++ years ago. It just became too bloated with features that make it difficult, if not impossible to understand. Short of better "brackets" type languages like C++ or Java, I'd rather write plain old C than C++.
@remiwi2399
@remiwi2399 Рік тому
I don't program in cpp very much, and when I do I don't use auto, but couldn't an LSP tell you the true type of any variable? The way I understand it, the types are still determined at compile time, so do they not just check the type and you can see on hover?
@jordan4220
@jordan4220 3 місяці тому
If you have an ide setup ya. I like auto when the RHS includes information on what is being instantiated as in std::make_shared(). Why not use it in a scenario like that
@clutchmadness
@clutchmadness Рік тому
This was great! Thanks :)
@torphedo6286
@torphedo6286 Рік тому
This is why I just write all my code in C...nice and simple, far less standard library features to spaghettify my code, and it's incredibly readable while being just as fast (or slightly faster) than the crazy standard library syntax you showed an example of.
@cd2320
@cd2320 Рік тому
Yeah and full of raw pointers too lol
@ME0WMERE
@ME0WMERE Рік тому
C++ may be a complicated language, but it's still more maintainable and readable than C unless you're joking
@Kycilak
@Kycilak Рік тому
One may also write C like code in C++ with the added benefit of using STL if one thinks it is better.
@pauldanaila1610
@pauldanaila1610 Рік тому
@@cd2320 We need raw pointers. How will you describe an address to a MAC controller? On an IBM PPC you could hardware remap entire spaces, same for PCI spaces. Do you think that C++ smart pointers will protect you from hardware remapping?
@ME0WMERE
@ME0WMERE Рік тому
@@pauldanaila1610 smart pointers just give you another way to use pointers - you aren't forced to use them if you don't want to (or can't)
@Gaelrenaultdu06
@Gaelrenaultdu06 Рік тому
While i agree with most parts you talked about, you also have to consider, especially when you bring up the keyword "auto", that be able to use functionalities does not mean you HAVE to use them all, and/or use them all the time. "auto" is very useful in specific situations, such as iterators and for loops, but i would not use them anywhere else... Same case when it comes to allocate memory on the heap. To be honnest, you never should use "malloc" and "free" in C++, but in some situations, using "new" and "delete" makes more sense than using smart pointers, and it is also true the other way around.
@skeleton_craftGaming
@skeleton_craftGaming 4 місяці тому
You should never ever use new and delete , std::unique_ptr is a zero cost abstraction over a raw pointer when the current function is its owner Note, I did not say that you should never use raw pointers, raw pointers are good for transferring a pointer without transferring its ownership.
@Gaelrenaultdu06
@Gaelrenaultdu06 4 місяці тому
​@@skeleton_craftGaming That's debatable, because it really depends what you do and want to achieve. How do you think C programmers handle dynamic memory allocation ? Do most C programs have memory leaks and pointer ownership issues ? No. As i pointed it out earlier, being able to use functionalities do not make their use mandatory. There is no issue using new and delete operators, as long as you know exactly what you are doing and if the situation fits their use. The use of smart pointers can sometimes be complex. Let's say you have a unique pointer in your program, and for a random reason, as some point, you need to modify its ownership. You would have to either write a function to modify its ownership, or trick the compiler by using move semantics. Situation suddenly got a lot more complex and risky. Smart pointers are tailored for managing dynamic memory allocation. However, their are not always the most suitable option. We could think about resources like file handles, sockets, etc... I would put it that way : Although smart pointers should be used 95% of the time, saying they should never be used is wrong.
@tourdesource
@tourdesource Рік тому
Better to initalize your smart pointers with auto, as in auto test_int = std::make_unique(20). IIRC using make_unique and make_shared allows for in-place construction.
@mattias3668
@mattias3668 4 місяці тому
3:00: Just install the library as normal to /usr/{lib,include} (or equivalent), preferably using your OS's package manager. What else do you need?
@gamerk316
@gamerk316 Рік тому
I've worked with a good dozen programming languages over the years, and I OO C++ code the absolute hardest to figure out what the heck it does. There are times I question *why* we have to write several thousand lines of infrastructure to do what should be basic tasks. I just completed an OO C++ to C99 conversion project to support a new platform that didn't support C++. 100k lines were cut down to about the 5k that actually "did something", and when I was done with it the formerly 90MB executable was down to just 32k, and ran significantly faster despite running on less resources. There's something to be said about functional programming.
@marcotroster8247
@marcotroster8247 Рік тому
Proper C coding is best. The only thing I miss is partial function application 😂 Why are those guys even using big libraries and frameworks in low-level codes? In hardware affine programming you wanna feel that you actually control the machine. C is just close enough to figure out which assembler code the compiler will generate 😂 I've recently programmed a neural net training to approximate sin(x) with 500 lines of C and it's twice as fast as TensorFlow already, just because I don't allocate like an idiot. And I didn't even optimize my matrix ops 😂
@username7763
@username7763 4 місяці тому
I highly doubt what you encountered is due to C++. This is a pattern I've seen through my career. Your first-stab at something can end up being more complicated than it has to be. You are exploring the problem space, running into things you didn't think about before. The problem is that a lot of programmers just stop there when it mostly-kinda works. However, if you keep working on it, you will see patterns, you will see things that can be removed or made much simpler. I've done that with projects I've worked on. I've taken my first stab at things and cut it down way smaller and simpler than it originally was. I've seen logic patterns that could be moved into a table or handled better in a single spot. This was all without changing programming languages.
@MadpolygonDEV
@MadpolygonDEV Рік тому
A bit confused that you say you cant determine the return type of a auto variable. I think auto is for something where you dont care about the return type. I use auto for quick loops or dont have to operate on it. However, I am confused that you think its weird but you also use python? Python doesnt need you to define what type a variable is afaik, wouldnt it be okay with you then?
@codepersist
@codepersist Рік тому
I use python but many times I'll use the type annotations so it's easier to debug later. It's moreso a coding style choice rather than something based on the language. I also said in the video that auto is great for small things like loops. It's my first video so I could definitely work on my explanations better 😀
@K9Megahertz
@K9Megahertz Рік тому
I despise auto. I personally don't use it. I find it cumbersome to have to spend unnecessary time digging through header files to figure out what type a variable is. If it were specified instead of auto, would save a bit of hassle. Just my experience from reading/understanding code I didn't write.
@fullfungo4476
@fullfungo4476 Рік тому
@@K9Megahertzget a better IDE/extensions. All modern ones can deduce the “auto” type and show you what it is (except for templates, but that’s by design)
@K9Megahertz
@K9Megahertz Рік тому
@@fullfungo4476 Or I can just not use auto and not have to worry about what IDE I'm on. I really don't use most of the features of an IDE anyway. Best not to create a problem I will later need to find a solution for.
@remiwi2399
@remiwi2399 Рік тому
What do you use to make the visuals of your video?
@jhgvvetyjj6589
@jhgvvetyjj6589 Рік тому
What non-gnu non-llvm non-visualc++ compilers are even available for C++11 and up?
@totally_not_a_troll
@totally_not_a_troll Рік тому
Me, a java dev: > Oh c'mon, stop being a pleb, get an IDE that insn't flaming garbage and you'll see what auto that function returns OP shows auto as an input param. > BURN IT WITH FIRE!
@Henry14arsenal2007
@Henry14arsenal2007 6 місяців тому
I agree with the notion that more abstract languages like Python are absolutely harder to read than C++. Weak typing was a mistake.
@AntonyMBenedict
@AntonyMBenedict 4 місяці тому
Segfault is an os error and usually there will be core dump. You can use that file to figure out what caused it.
@DBGabriele
@DBGabriele 2 місяці тому
Moreover, Segfault in rust is rare but... very hard to debug too...
@koswag1204
@koswag1204 4 місяці тому
2:15 the usage of lambda melted my brain
@valizeth4073
@valizeth4073 Рік тому
First of all, STL doesn't exist, or at least not in the sense that people mean. It's the standard library, the stdlib, STL is microsofts implementation of the C++ standard library. The STL people refer to wasn't ever standardized (even though the standard library took parts from it), and it was mainly written by one single person. As for the line you have with the iota + filter + accumulate, I can agree that iota isn't necessarily descriptive in what it does, and naming it something like range, or similar would be more descriptive, but I digress. Filter is essentially as clear as it can be, and so is accumulate, not being able to read that line and figure out what it does shows that a developer has a rather lacking experience with not only C++ but with programming as a whole. As for package managers and build systems, yeah it's pretty depressing, having something like cargo would be a dream come true, as long as it's not anywhere near the god awful pip.
@willful759
@willful759 Рік тому
I wouldn't necesarily say lacking experience in programming as a whole, but rather in functional programming specifically yeah they are pretty simple functions at the end of the day, but I do feel people who are not used to FP will find it "odd" and even unreadable to have a weird function that takes a function and an iterable instead of just using for and if, the same with iota (for which range would be a better name so that doesn't help) why use a weird function that gives me a stream of numbers that increase by one each time instead of just using a for loop? Or to make a meme out of it: " Functional programmer: _did they ever taught you about higher order functions?_ Programming Student: _no_ Functional Programmer: _I thought not. It's not a story the OOP teachers would tell you_ "
@mintchocolamint
@mintchocolamint Рік тому
Hm... With a scalding title like "How C++ took a turn for the worse", I had expected stronger arguments. 1. "auto" isn't exactly a C++-specific problem. C# and Java both have the "var" keyword, which does the exact same thing (automatic type deduction). And in general, people have come to understand that there are places where you probably shouldn't use automatic type deduction - places where explicitly stating the type is a form of self-documenting code and reduces ambiguity. Even in Python, you can decide where you'd want to annotate a variable's type to help with readability. 2. STL is pretty verbose, I can agree with that. It uses terminologies that you don't really see often in other languages (like the iota function over there). However, it feels like your criticism of STL is a bit more focused on functional programming instead (one-liners that become unreadable a few weeks after you wrote them). Not saying STL is great, though. It has a lot of other usability issues compared to other languages' generic containers (e.g., C#'s System.Collections.Generic), though most of them can be attributed to C++ templates being hard to work with in general. 3. No "standard" package manager is kind of a problem, I can agree with you on that. But then again, in JavaScript-land, there isn't a standard package manager (it's npm vs yarn vs pnpm right now), and they're fine with it. Maybe it's not that bad of an issue, after all. 4. C++ *runtime* errors (e.g., segfaults) don't have pretty error messages because C++ is designed for performance - your program doesn't ship with a system that monitors runtime memory access for you, which would sacrifice performance. If you want runtime error messages, you should be attaching a debugger when you compile your program. Of course, one could argue that Rust is still better here because it enforces more compile-time rules to protect you from compiling a program where you can segfault, and they'd be right, but do keep in mind that if a Rust program manages to access an illegal memory address, it would also simply segfault (assuming no debugger). 5. C++ having multiple ways of doing the same thing is very much an issue, but I think memory allocation isn't exactly the best example here. The three ways you listed here all have very different purposes. - "malloc" doesn't exist purely to let you create an int on the heap, it's also a precise way to request memory from the operating system, and can be used to acquire a large, *continuous* memory pool for you to use (afaik more sophisticated game engines use a similar approach). - "new" (and "delete") implements RAII (constructor on new, destructor on delete). It exists because C++ *classes* can specify code to be run on initialization (constructor) and on deallocation (destructor). A similar (but not the same) pattern can be found in C#'s IDisposable interface, which lets classes implement a "Dispose" method that can be executed automatically once they exit a "using" block, often used for file handles. "new" can also be overridden to allocate memory from a custom memory allocator (as opposed to just using malloc), such as from a memory pool managed by your own program. (Game engines are again a good use case here) - Smart pointers exist as a **wrapper** to automatically call "delete" for you even when working with heap-allocated memory, according to a set of rules. They exist so that you can work with objects with dynamic lifetime *without* having to run a garbage collector to deal with memory leak. Garbage collectors can interrupt your program's execution every now and then to track down unused memory for you, which can be undesirable in performance-critical applications. You'll find the same flavors of smart pointers in Rust as well (but with different names). This is the kind of stuff you're expected to learn in a low-level programming language. For the record, Rust did away with new-delete and only kept the smart pointers and malloc (std::alloc, std::dealloc), basically requiring all heap-allocated objects to be protected by smart pointers to make it harder to accidentally cause a memory leak. But even then, I'm pretty sure you'd be making a lot of enemies in the competitive programming scene if you were to take the raw "new" and "delete" keywords out of C++, and force them to use smart pointers. I can understand that these aren't really familiar concepts to someone who is primarily a Python programmer. C++ is also indeed a weird language compared to other modern programming languages, with a lot of concepts that aren't seen often elsewhere. But if we are to contribute to the discussion of making C++ a better language, I think we should try to discern which parts of C++ are C++'s own problems, and which parts of it are issues in larger fields (low-level programming, functional programming, etc.)
@codepersist
@codepersist Рік тому
I probably should have added more info in the video. I have been coding with c++ for a couple of years now and use most of the features that I mentioned. I think using auto incorrectly can create really messy code so the problem is not so much with auto, but the poor coding practices related to it. The STL while verbose is still extremely powerful, and I am glad they keep adding new features. Your explanation on segfaults makes sense. Personally, I haven't found any way to debug them even with programs like Valgrind, so that's why I guess I am more biased in saying they have poor error messages. You brought up some great other points! How long have you been working with low-level development as you seem to know a lot?
@mintchocolamint
@mintchocolamint Рік тому
​@@codepersist Regarding C++ debugging: Common debuggers like the gdb and Visual Studio's debugger can show stacktraces from a segfault (and of course the exact line where it happened). As for my personal experience, I'm just a senior CS major, who's used C++ on applications such as a Qt-based GUI, OpenGL-based graphics programming, and lately Unreal Engine, among other things. I do more game dev stuff usually (C#), but I still keep an eye on low-level development because it helps with understanding performance a lot.
@chris52000
@chris52000 Рік тому
@@codepersist If you compile with gcc, use “-fsanitize=address”. This checks memory accesses to ensure they are in allocated memory, which deals with most segmentation faults. There might be options for other compiler too, I just mostly use gcc. You can also try “-fsanitize=undefined” too
@dscmtr686
@dscmtr686 Рік тому
wow, very informative answer!
@az-kalaak6215
@az-kalaak6215 Рік тому
@@codepersist Hi, to debug segfaults you have 3 linux- programs: gdb (use the bt command to have a stacktrace after a segfault) valgrind (every single valgrind error can and will on some systems lead to a segfault) and a gnu program called (if I remember correctly) catchsegv, which prints a stacktrace in case of a segfault. remember that valgrind is not a tool, but a tool collection, you have memcheck (default memory checker) helgrind (basic thread checker) drd (advanced thread checker) massif (heap and stack profiler) callgrind / cachegrind (call profilers) standard library is the hardest part of cpp to learn, as is is extremely wide, and have specialized stuff used only in a few parts.
@manankataria
@manankataria Рік тому
Man awesome content 🍺😄. Also loved the comment section .
@gladwinmohlamonyane4033
@gladwinmohlamonyane4033 Рік тому
When I think about my naming conventions... I thank the lawd that I write verbose code and comment the hell out of everything
@SvetlinTotev
@SvetlinTotev Рік тому
"auto" is not an issue if you are using a normal editor. Just mouse over the variable and it tells you the type. The editor will also give you clearer compile-time errors before you even try to compile the code. And a debugger gives you everything you need for runtime errors.
@heyhoe168
@heyhoe168 Рік тому
Yes, but sometimes in lambda declarations editors code model fails to analize code this deep.
@sprytnychomik
@sprytnychomik 11 місяців тому
What's a mouse?
@Megalcristo2
@Megalcristo2 10 місяців тому
Or don't use auto when you shouldn't;
@zdspider6778
@zdspider6778 Рік тому
1:00 Well, yeah. You use 'auto' when you don't care about the return type. It's intentional. And sometimes even necessary when you dive into templates. 4:33 Smart pointers are not "a 3rd way" to allocate memory. Let's casually glance over the 'new' keyword on that 3rd line, shall we? _What 'new' keyword?_ EXACTLY! There is, however, a function called "std::make_unique" that calls 'new', but it's still using 'new'. Smart pointers were added in C++11, btw. Not a "new feature" by a long shot. They have their uses, but nobody's forcing you to use them (or any other feature).
@codepersist
@codepersist Рік тому
I agree smart pointers may have been a little bit of a stretch 😅. Like I said with auto it has its places and I use it as well, but I think using it incorrectly could make the code harder to debug later.
@creapermann6356
@creapermann6356 Рік тому
@@codepersist and you are saying this as a python developer? I'd argue that the existence of IDEs make this much easier, as does a static type system (which you don't have in other languages as e.g. python). There are many things to criticise about c++, but the ones you mentioned are relatively irrelevant (except the point about package managers).
@codepersist
@codepersist Рік тому
I should have mentioned that I have been coding in C++ for a couple of years, I just have used python for longer. Even with python after python 3 you can put type annotation in the code for documentation purposes and I have been doing that, so I am just more used to the practice of static typing. I still stand by my point that the excessive use of auto can make code messier, but again that's more of a personal preference than an exact C++ problem.
@johanngambolputty5351
@johanngambolputty5351 Рік тому
Surely you just download your c++ libs from your os package manager? I have to say, compared to when I learned it at uni, where they must have taught c++98 or something, it seems a lot more succinct now, "for(auto item : items)" a bit like in python feels huge for me. 4:34 Classes that wrap around pointers (like unique_ptr) are meant to make it easier to increase memory safety and decrease leaks?
@heyhoe168
@heyhoe168 Рік тому
I always use auto for iterators declaration: auto it = data.begin(); It is concise and transparent. Little bit less transparent but just as neet is auto in range-for loop declaration: for(const auto& x: data){ func(x);}
@catalinancutei5390
@catalinancutei5390 11 місяців тому
I think what makes C++ so hard to learn and understand is the number of ways you can do something. I used to code in C++ 14 a few years ago, and now trying to learn the newest language and standard library features feels like learning a whole new different language. The idiomatic way to use C++ like memory management using smart pointers for memory safety, using the template system, constant references instead of pointers, etc. are the core features of Rust if you really think about it. I believe this is the reason why so many people fell in love with Rust, because being a relatively new language, is implemented from the beginning trying to avoid the problems that have been present in the other languages over the years.
@Rosen2221
@Rosen2221 10 місяців тому
Idk, you can still write unsafe or broken code in rust. Rust cant fix stupid
@D0Samp
@D0Samp 6 місяців тому
On the other side, there's relatively little documentation around that would encourage people to write outdated and dangerous Rust.
@climatechangedoesntbargain9140
@climatechangedoesntbargain9140 4 місяці тому
​@@Rosen2221you don't have to be stupid to get fucked by C++. C++ makes it so easy, and Rust quite hard to produce fuck ups
@managMent_
@managMent_ Рік тому
The issue that I see from this video is that you don't "know" C++, or at least the arguments you make are from the perspective of a person that doesn't. I don't want to gatekeep C++ but unfortunately, it is a language you have to learn. Most of their design choices have a good reason, but they leave room for misuse. The auto keyword should NEVER be used like that. And while you can condense code heavily doesn't mean you should. Linker error messages are quite cryptic, but can be a little more readable using clang instead of g++, I agree with that issue, but if you understand how the linker works, it makes sense why these messages look bad sometimes. There are a lot of deep sitting details you need to keep in mind when coding in C++, which is why its known as a difficult language. Oh and nitpicky, smart pointers are not just a third way to do pointers. All the three ways to allocate memory on the heap have their own purpose and downfalls.
@codepersist
@codepersist Рік тому
I agree C++ does need to be learned for some time as you can't just pick it up super quick. I should have worded a lot of stuff better in the video. I've been coding with C++ for a couple years and most of the issues I mentioned don't bother me as much as I just consider them weird. For example auto is a nice feature but can be made bad with poor coding choices and design. I think C++ is a language that everyone should learn and is super useful. Most of the features I mentioned are useful and nice features but like you said they leave room for misuse! :)
@managMent_
@managMent_ Рік тому
@@codepersist Yeah, btw I didn't mean you were bad at C++, even if the wording was a little poor on my end. More like, a lot of C++'s weirdness has a reason that needs to be looked up. Hell, I think there is a ton I don't know about STL, even though I've been coding with C++ for many years, even professionally. I think it'll be a perpetual learning process. But this is what I love about C++, it allows you to do everything you want, even if it opens ways to really harm yourself. I'd much rather be wary while coding and have all the tools available than be restricted from "dangerous tools" by other programming languages like Java. And coding with C/C++ gives you a much better understanding of what's happening under the hood I think.
@georged8644
@georged8644 Рік тому
The last good version of C++ was C With Classes, which existed until 1983. Everything since then has been more and more dreadful. I haven't even bothered to look at C++ 23 because I know that it will be worse than than the previous version which was worse than it's predecessor... The language fell to pieces when they introduced templates in 1991.
@multiHappyHacker
@multiHappyHacker 3 місяці тому
C++ also has the killer app of free functions that aren't attached to a class.
@turolretar
@turolretar Рік тому
C++ gets a lot of unnecessary hate
@tordjarv3802
@tordjarv3802 Рік тому
Funny how a Python programmer complains about the auto keyword. All the problems with auto you listed are 100 times worse in Python where every variable is "auto" and type hinting is not mandatory, at least in C++ the type of an auto variable is know at compile time, in Python you would have to wait until something goes wrong during runtime which could happen years down the line. The other parts I agree with, especially the weird naming of some STL functions, I guess that it is because many of the functions are inspired from array programming languages such as APL, which explains why iota is named iota and not range or sequence which would be more clear.
@nurso56
@nurso56 Рік тому
As a C++ professional I can understand some arguments from the perspective of Python (but keep in mind that Python is a script language while C++ is a strongly static typed and compiled language - hence difference language properties and requirements). But your first point is exactly the same as in Python except that the auto keyword is omitted. The naming of variables has nothing to do with a concrete language property, it is the 100% choice of the programmer. Use good names in C++ and there is no issue, use bad names in Python and there is an issue.
@cristiandecu
@cristiandecu 5 місяців тому
My point exactly; it's like trying to pilot a plane after having 20 years of experience driving cars and then you start complaining that planes don't have wheels and that they are travelling at very high altitudes. C++ is simply not comparable with python and before migrating to C++ you also need to migrate your programming mindset. I am not really sure why a Python engineer would want to migrate to C++ (maybe a better job or something) but I doubt it's because they want to have better control over memory and lower level stuff otherwise they would simply not complain about "SEGFAULTS errors" not being explicit enough and they would start using a debugger right away.
@hypesystem
@hypesystem Рік тому
Do you have a link to that code report vid where he refactors the code? I saw it but can't find it anymore
@codepersist
@codepersist Рік тому
Check the pinned comment!
@Diegovnia
@Diegovnia Рік тому
This! exactly this! It's not only C++ that is now facing this issue... there is this stupid notion of going functional with every language. I mostly work with C# which is abstract enough and yet there are people who push for even more and more 'one liners' making it super difficult to read and deduce because of what? There is no benefit in it... yes you write 70 lines instead of 200 but try returning to it after a month when something breaks...
@lolcat69
@lolcat69 Рік тому
This is why I code with C, maybe i have to write strings by myself and a lot of stuff myself too, but i prefer that...
@altheasantos3507
@altheasantos3507 Рік тому
you blew up fast, hoping it's not a one hit, keep it coming, do some C# maybe 👍
@user-uj4gr9ql4m
@user-uj4gr9ql4m 4 місяці тому
2:35 python, rust and npm (node js) have only 1 actual reference implementation + pypy but cpp is g++ (mingw?), clang, msvc, intel c++, so it's a standard, not a reference implementation also creating new "one and only reference implementation" with package manager will only create "[soon] situation: there are 15 competing standards" moment
@diadetediotedio6918
@diadetediotedio6918 Рік тому
I don't even like C++, but I think a point worth noting is, auto is not necessarily bad because the implic typing doesn't really makes code "hard" to predict, we have IDE's nowadays that are perfectly capable of showing the types when we use artifacts like that. This is a concept existing in many languages out there like C#, Kotlin, Rust, TypeScript, F# and even modern Java,. and it doesn't in any ways make code less readable if you just use the type hinting.
@phillipsusi1791
@phillipsusi1791 Рік тому
I was thinking "who doesn't have an IDE where you can ctrl-click or something to jump to the definition of the function if you aren't sure what it returns and immediately see what it returns, and thus, what the type of the auto variable is?
@andrejbartulin
@andrejbartulin Рік тому
Well, if don't want to use particular feature, don't use it, C++ gives you a freedom to do it
@SkyyySi
@SkyyySi Рік тому
Do you code in Vi? Because if you're using *propper* tooling, most of these things aren't that big issues (besides the package management - that part really is just plain bad).
@Jmcgee1125
@Jmcgee1125 10 місяців тому
That initial rant about `auto` is why I hate using languages like Python where people don't typehint their code. "But it runs fine!" Yes, but I can't tell what it *does*.
@Inuyasha463
@Inuyasha463 Рік тому
I haven't programmed in C++ since the mid 2000's, so I've never written any C++ code that uses lambdas or functional programming, but I found the functional code you showed as an example much more readable than the original nested code. Once you've used a language that supports functional programming, things like map, filter, reduce, fold, accumulate, etc. should all start to feel natural, and it's pretty easy to move between languages. I use Java and Kotlin at my job, so I see these all the time, and in many cases it makes things more readable, though I agree in some select cases it can make things less readable if you aren't careful. I suggest everyone spend some time familiarizing themselves with this stuff because it will help professionally when having to learn new languages that support it, and a lot of languages seem to be adding functional programming these days.
@ythanzhang
@ythanzhang Рік тому
I think the confusion is two parted, one is being unfamiliar with functional style. The other is the way C++ uses overloaded operators to chain functions, resulting in a syntax heavy style that is quite convoluted at first glance. That video also showcased the Rust equivalent, it was much cleaner.
@theondono
@theondono 11 місяців тому
@@ythanzhang one of the biggest problems for me is how bad the naming schemes are. Even if you aren’t familiar with a particular language, with good naming schemes you can make educated guesses and get an idea of what’s happening. Such comforts are non existent in C++, were a “view” and a “range” are for some reason close analogs, or one finds “iotas” in the wild, just to name ones that appear on code reports video.
@morksan9973
@morksan9973 Рік тому
About Templates, you forgot to mention how on C++ the idea of templates turned into incomprehensible code mash known as SFINAE. It is a shame that there is no other way for metaprogramming in C++, but using messy, but effective SFINAE
@elliott8175
@elliott8175 Рік тому
With the use of constexpr functions and lambdas as well as concepts (you can use requires in a constexpr if) there really is a lot of metaprogramming you can do now without the old-fashioned SFINAE as of C++20. Concepts really are a killer feature ... But I'll miss the old SFINAE way. =)
@4friends1channel
@4friends1channel Рік тому
Clion with g++ debugging shows where memory faults occur by the way! (The line of code amd memory address where x error occurred, at least.) I don't know if this is actually relevant but thought I'd throw it out! If I misunderstood the concept mentioned please tell me haha.
@peacemaker0240
@peacemaker0240 Рік тому
Me not clicking the video bc I thought I was a Fireship upload
31 nooby C++ habits you need to ditch
16:18
mCoding
Переглядів 703 тис.
i changed my mind about zig
9:34
Low Level Learning
Переглядів 133 тис.
😱СНЯЛ СУПЕР КОТА НА КАМЕРУ⁉
00:37
OMG DEN
Переглядів 1,5 млн
RayLib 5 Released - The Easiest C/C++ Game Library Just Got Even Better
10:42
Ditch your Favorite Programming Paradigm
6:08
Code Persist
Переглядів 144 тис.
You don't need libraries to write a game engine in C++ | OpenGL | Devlog
2:50
The Simplest Game
Переглядів 62 тис.
Should you learn C++?? | Prime Reacts
20:29
ThePrimeTime
Переглядів 296 тис.
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Переглядів 143 тис.
The Downsides Of C++ | Prime Reacts
21:23
ThePrimeTime
Переглядів 122 тис.
Delivering Safe C++ - Bjarne Stroustrup - CppCon 2023
1:29:16
CppCon
Переглядів 126 тис.
Comparing 10 programming languages. I built the same app in all of them.
21:33
why do header files even exist?
10:53
Low Level Learning
Переглядів 330 тис.
Will Ada Replace C/C++?
44:57
Tsoding
Переглядів 64 тис.
поворотний механізм для антени
0:17
Lazeruk
Переглядів 13 тис.
Анімація зарядки на iPhone 📱 #icoola #apple #iphone #tradein #купитиайфон #відновлений #айкула
0:37
ICOOLA: Фабрика відновлених телефонів
Переглядів 95 тис.
Vortex Cannon vs Drone
20:44
Mark Rober
Переглядів 13 млн