the TRUTH about C++ (is it worth your time?)

preview_player
Показать описание
C++ gets a lot of hate on the internet, and there may be good reason for that. I think C++ is misunderstood, and there are a few simple reasons why. Despite being designed around 3 simple principles, the language has inflated to have a ton of features that are either too complicated to understand, or too powerful to implement without making your code base unmanageable.

But, should you learn C++? Yes. There are a few caveats though.

🛒 GREAT BOOKS FOR THE LOWEST LEVEL🛒

🔥🔥🔥 SOCIALS 🔥🔥🔥
Рекомендации по теме
Комментарии
Автор

C++ is Life. People love to jump on the bandwagon of hating a language. But I always quote Bjarne himself "There are only two kinds of languages: the ones people complain about and the ones nobody uses"

romangeneral
Автор

I like how people always talk about "which language should you learn" as if we're often given a choice. In my experience, unless you're writing stuff totally from the ground up (or just wading into a new language as a hobby), which language you use is almost always dictated by what software you're developing for, or what your job or school requires you to use.

zackakai
Автор

My first language is C++, i've been exposed to pretty harsh concepts before that make the brain fry. C++ did sure fry my brain the first 3 months; but now that I am starting to understand it more, I really appreciate it and other languages are really easy!

Squov
Автор

I am currently learning C++. I learned Python, Java and C for my CSE degree. I can say that I prefer C++ over Java because C++ feels more intuitive for me. Of course, I have yet to learn Rust.

theoceanman
Автор

I wrote C and then C++ for years as an embedded software developer. As the language grew more and more complex, I noticed developers very purposely wrote more and more complex code which took longer and longer to read, trace and understand.

Worse, there was a convoluted arrogance that came along with it. If you couldn't understand their extremely convoluted code, you were a lesser person. Few acknowledged that convoluted code was bad code.

And discussions about the language replaced abstract discussions about what the compiler and processor would have to do to accomplish something. It became essentially _wrongthink_ to even consider how a compiler would implement code.

While I was constantly striving to simplify the organization of data and the processing of it, my coworkers were constantly building empires of more and more complex code to their own glory. They _hated_ me when it got in my way and I simplified it.

KenJackson_US
Автор

0:20 Bjarne tweeted about c++ 4 years before the invention. the power of his programming

lacelume
Автор

Professional C++ programmer here:
The thing is that C++ has a steep learning curve and that most developers just don't want to invest the time to learn the language. Just as you've said: with great power comes great responsibility and rarely anybody wants to be responsible because it is hard. Also C++ is usually taught wrong and rarely do teachers or courses explain that, for example, raw ( C ) pointers are not evil, they just cannot be owning pointers.
I agree with your suggestion on how to learn C++, I would just add that after learning C, fammiliarize yourself with the abstractions that the language introduces, by reading books and watching convention lectures.
That way you get a bottom up ( learning C and the memory model) and top down (learning abstractions) view of the language.
You just need time to understand the language, something that most people do not have today.
C++ is not a perfect language, but it does not deserve the hate it gets.

aleksandarnikolic
Автор

This systems administrator here, used to safe languages like c#, wanted to learn c++ to get closer to the OS. And man, I can't recommend enough. I got a pretty bad beating from memory management, and the community being fairy aggressive, but this language is powerful. Go for it.

chicoern
Автор

The answer to number 2 "avoid sugar" should be "for (auto& num : v) {//code here}". Way simpler.

sledgex
Автор

I agree ... first C and then C++. Working with object required a extra efford like understanding Inherince, poli, object relationships, notation like UML diagram classes a more... great video by.the way 👏👏👏👏

alexandrohdez
Автор

I study mechanical engineering, so I'm not a typical programmer, but from my point of view C++ is one of the most important languages. It can be found in any application where speed matters, such as CAD modeling software, physics simulation, or real devices such as microcontrollers, control units, etc.

josef-c-
Автор

I wish I had learned C before C++ (I learned it as a module on my math undergrad), I've gone back to them a little since using OpenCL. Once I get a bit more of a wide overview of what they can do, because I still haven't built that much with them, and once I have looked into assembly and mixing all three, then I think I will finally let go and probably leave them for something like rust... but I want the context first.

johanngambolputty
Автор

Just the <vector> feature is worth learning C++ over (or in addition to) C, it's better and safer than C arrays, and there's a lot of other good features. Unfortunately, there's always "more" every three years, every new version is almost like a new language, as so many things get (literally and figuratively) overloaded. Even thought the latest tends to be an improvement (as in "for (auto thing : mythings)"), it still leaves a trail of a half dozen previous ways of doing something.

TranscendentBen
Автор

C++ is and will likely always remain my main language, and the unique features of C++ can be quite beautiful in some cases.

I have been working with the QEngine library for simulation and optimization of quantum physics, and it makes extensive use of templates and operator overloading to allow me to essentially create a Potential or Hamiltonian (a kind of functions which tells us how a Quantum system evolves) as a C++ object, by literally writing it as an equation.

But I absolutely agree, if you try to use "advanced" c++ features where normal C would do the jop it gets messy very quickly, and the error messages are not great, especially when templates are involved. I routinely get single error messages so long that they can not fit in my terminal.

atypicalprogrammer
Автор

C++ is my first language, best benefit of it is after that learning other languages is super intuitive. And about learning C before C++ isn't really needed if you have good resources to learn from. But if you want to learn C++ in a sloppy or playful way you will struggle(unless you are a genius). Most painful part of C++ is build systems, you have to learn the compiler and package management etc. well, as long as you don't use IDE that is, with IDE it's much simpler of course, though still harder than other languages.

Zex-
Автор

nice, perfect timing. was going to make a system project, and was really battling with this question.

nachosncheez
Автор

Valuable info as usual, thank you my friend, useful info from an experienced engineer is as good, if not better, than a proper engineering book. love your insights, I am currently learning C++, I just finished C. Also learning Python.

viktoreidrien
Автор

The first programming language I ever learned was IBM 360/370 Macro Assembler which is actually rather high-level as far as assembly languages go.
They thought we should learn this before moving on to COBOL and CICS. Also, AL was the "washout" class. If you can't handle that you don't belong here.
When a friend of mine was in the same program years later he asked me what he should learn after AL. I suggested C because it was the new hotness, the syntaxes of many other languages are similar and it's still low-level enough to let you do whatever you want.
It's a good baseline.
I've since learned that you can also do object-oriented programming in C using pointers to structures of pointers, but that makes my head hurt almost as much as the SmallTalk-style objects in Objective-C.
So much is already written and can be written in C++ that it makes sense to know it.
But while it's relatively easy to know C, if not always the best ways to use it, it's pretty impossible to know all of C++, much less how to use it well. C++ is a Very Complex language, though still low-level enough to be one of the fastest languages out there.
Rust is more trouble than it is worth. I prefer Swift. It feels much more natural to me.
But still, many device drivers are still written in C++ or even C so it's worthwhile to know them.

lorensims
Автор

As Bjarne once said, "there is more simple and smaller language in C++" and Herb Sutter recognised this language and called it Cpp2 (cppfront)

paulrei
Автор

in my opinion the most important thing with using cpp is having guidelines in your project, you can accomplice same thing many different ways in cpp so at the beginning of the project you need to decide how you will design everything. For example In my work we just don't use inheritance or most of stl. I also think that rust will have the same story (both are big languages and things like error handling should be clearly defined)

kamkamkil