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

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 1.6K

  • @LowLevelTV
    @LowLevelTV  2 ปีที่แล้ว +497

    What do you think? Is C++ any good?

    • @MichaelMantion
      @MichaelMantion 2 ปีที่แล้ว +52

      You made this video just to get drama. No you should not learn C++. Lots of people know it, few companies use it, most are moving away from it, there are better languages if are starting a project. Anyone leaning C++ will only annoy experienced users. Like you said. The first language anyone should learn is python, then Rust or C, then TS or JS. Maybe Bun. Everyone can use Python because there is always some quick little task that you can get done with python in a few minutes that will make any computer users life better.

    • @adfs774
      @adfs774 2 ปีที่แล้ว +78

      It depends on what your coding
      (I like c++)

    • @gregandark8571
      @gregandark8571 2 ปีที่แล้ว

      C++ MUST DIE.

    • @vectoralphaSec
      @vectoralphaSec 2 ปีที่แล้ว +200

      @@MichaelMantion That's wrong. C++ is still being used in industry and will never go away completely.

    • @huntabadday2663
      @huntabadday2663 2 ปีที่แล้ว +43

      When I use C++, I program it like C, it is objectivly better.

  • @romangeneral23
    @romangeneral23 2 ปีที่แล้ว +4225

    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"

    • @PanosPitsi
      @PanosPitsi ปีที่แล้ว +148

      Except for Java , both nobody uses it except for Indian tutorial makers and somehow everybody still hates it.

    • @xesbeats8180
      @xesbeats8180 ปีที่แล้ว

      @@PanosPitsi nah errybody use Java

    • @ryantony5586
      @ryantony5586 ปีที่แล้ว

      @@PanosPitsi java deserves its hate.

    • @fr3dlopez
      @fr3dlopez ปีที่แล้ว +338

      @@PanosPitsi nobody uses it.... lol what field are you working in?

    • @PanosPitsi
      @PanosPitsi ปีที่แล้ว +56

      @@fr3dlopez it used to be good for cross platform and for android but it got murdered by kotlin and electron. Maybe it can still be used in a server but go and rust are flat out better. Companies that use Java still only do so because it’s too expensive to migrate, Java’s market share is falling each year however

  • @bencemali9528
    @bencemali9528 2 ปีที่แล้ว +2138

    C++ is a superset of C not a subset

    • @LowLevelTV
      @LowLevelTV  2 ปีที่แล้ว +789

      words are hard. you right

    • @theawesomefire
      @theawesomefire 2 ปีที่แล้ว +130

      Though C++ is not a strict superset of C, as it is not 100 % compatible with C. Depending on the standard of course, as the latest C and C++ standards try to move to a closer common ground again.

    • @retsu-h6460
      @retsu-h6460 2 ปีที่แล้ว +10

      As is mentioned in the video, C++ is C with object, so doesn't that mean C++ is a subset of C?

    • @shimadabr
      @shimadabr 2 ปีที่แล้ว +60

      @@retsu-h6460 If C++ was a subset of C, C++ code would be valid C code, which is not the case, it's the opposite. But as mentioned, it's not a 100% superset anymore since C99.

    • @KenJackson_US
      @KenJackson_US 2 ปีที่แล้ว +19

      ​@@theawesomefire: _"Though C++ is ... not 100 % compatible with C."_
      I wish I could remember the issue, but years ago I went round and round with another developer because I gave him a few lines of simple C code that I compiled and tested with my C++ compiler. It worked flawlessly for me but he argued that it didn't work for him. When I finally tested it with a C compiler I found he was correct.

  • @zackakai5173
    @zackakai5173 ปีที่แล้ว +983

    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.

    • @sososo3906
      @sososo3906 ปีที่แล้ว +62

      I wish I would have known that before spending years on low level programming before realizing most relevant jobs will require proficiency in another field

    • @HaiderAli-em6ku
      @HaiderAli-em6ku ปีที่แล้ว +45

      Exactly. and this is why I hate people who push others looking in from outside the industry to only learn a single language like python to start their journey. You gotta learn a lot of things first to narrow down what you wanna go into and then you dive deeply into its requirements.

    • @andrewdunbar828
      @andrewdunbar828 ปีที่แล้ว +5

      It's mainly about which language to choose to learn for people that haven't started yet or haven't progressed very far. They'll be training themselves in both programming and the language they choose and that choice partly depends on what work might be available, what they want to do, and what is good at a learner level.

    • @sososo3906
      @sososo3906 ปีที่แล้ว +17

      @@andrewdunbar828 shouldn't they choose a subject instead of a language?

    • @andrewdunbar828
      @andrewdunbar828 ปีที่แล้ว +3

      @@sososo3906 They will choose many subjects. That's what everyone I knew did, though there were fewer languages to choose from then.

  • @theoceanman8687
    @theoceanman8687 2 ปีที่แล้ว +1657

    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.

    • @sotam8938
      @sotam8938 2 ปีที่แล้ว +127

      Should've just skipped to Rust.

    • @olafbaeyens8955
      @olafbaeyens8955 2 ปีที่แล้ว +71

      The first 2 months learning Rust will be very painful, but it is probably going to become your favorite language.

    • @punchcake4832
      @punchcake4832 2 ปีที่แล้ว +234

      @@sotam8938 Well rust isn't really good for jobs, C++ still and will forever have codebases to maintain. C++ isn't horrible the programmers abusing its concepts are thus resulting in its reputation for memory leaks, Try to use smart pointers and keep raw pointers as a last measure.

    • @theoceanman8687
      @theoceanman8687 2 ปีที่แล้ว +84

      @@punchcake4832 At the end of the day, programming languages are tools, each with their pros and cons.

    • @intifadayuri
      @intifadayuri 2 ปีที่แล้ว +70

      C++ is the building foundation of a lot of stuff in our world nowadays...

  • @Squov
    @Squov 2 ปีที่แล้ว +751

    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!

    • @intifadayuri
      @intifadayuri 2 ปีที่แล้ว +148

      If you can learn c++ you can learn any other language lol

    • @Squov
      @Squov 2 ปีที่แล้ว +13

      @@intifadayuri truth brother

    • @Henry-sv3wv
      @Henry-sv3wv 2 ปีที่แล้ว +30

      okay, now do X86 assembly, must be easy now :P

    • @jjjj-x9g
      @jjjj-x9g 2 ปีที่แล้ว +115

      @@Henry-sv3wv Assembly, especially x86 might unironically be simpler than C++ or even C atleast in terms of syntax. it's just more tedious, time consuming and requires a solid understanding of how the CPU registers and memory stack work.

    • @isuckatthisgame
      @isuckatthisgame 2 ปีที่แล้ว +8

      @@jjjj-x9g Bro, can you recommend any beginner-friendly literature (if such thing exists lol) on asm and cpu architecture?

  • @KenJackson_US
    @KenJackson_US 2 ปีที่แล้ว +1267

    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.

    • @xyber2
      @xyber2 2 ปีที่แล้ว +88

      I've had similar experience in my job. Unravelling my co-workers fancy and redundant code was a gruelling task.

    • @XenolVlatriX
      @XenolVlatriX 2 ปีที่แล้ว +7

      what do you do as a embedded developer? sounds interesting

    • @KenJackson_US
      @KenJackson_US 2 ปีที่แล้ว +113

      ​@@XenolVlatriX: _"what do you do as a embedded developer?"_
      Embedded computers are those with no user interface or a limited interface. The microcontroller in a microwave is the most familiar example. I worked with telephone switchgear, solar controllers and bus communication systems.

    • @Honken
      @Honken 2 ปีที่แล้ว +33

      Thank you.
      I work a few million lines of crap above you (web), fighting the complexity demon wherever it decides to come to nest.
      It's come to be point now where I find myself having discussions with senior engineers over the extreme danger of writing for loops in bounds-checking, memory managed languages, as 'you could get them wrong' and 'they are hard to read'.
      I would give someone elses arm to write Go on the frontend, anything but JavaScript.

    • @semicharmedkindofguy3088
      @semicharmedkindofguy3088 2 ปีที่แล้ว +50

      This is my problem as well. As someone often tasked with debugging and tracking down bugs, C++ is hard to work with. C lacks features but that means it's often easily readable with even just grep, and what you read closely matches the actual execution of the program. C++ syntax is made to make people feel smart while writing it but it ends up making the codebase hard to read and maintain.

  • @aleksandarnikolic2441
    @aleksandarnikolic2441 2 ปีที่แล้ว +450

    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.

    • @Dulge
      @Dulge ปีที่แล้ว +14

      agreed, im not a proffesional neither intermediate of the language but when you dedicate time to the language and actually understand the ins and outs its pretty awesome, the power we have also its a must for anyone wanting to get into malware analysis or Reverse engineering

    • @christophernoneya4635
      @christophernoneya4635 ปีที่แล้ว +10

      I tried getting into c++ for a while (currently i use rust) but I'd say c++ more than any language requires you to just "know" things, or at least thats how it feels. Like solid code sometimes just wont work because theres some quirk of the language or compiler or something that just screws with specific implementations that seem like they should work. It feels like to bugfix you need to have a textbook just containing these irregularities of the language itself
      Also header files confuse me because im kinda dumb but thats just a c thing

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p ปีที่แล้ว +3

      I realize this is a month old, but could you by any chance expand a little bit on the idea of "raw pointers are ok so long as they're not owning pointers"?

    • @aleksandarnikolic2441
      @aleksandarnikolic2441 ปีที่แล้ว +23

      @@user-sl6gn1ss8p Well, the thing is owning pointers are pointers which manage the lifetime of the object they are pointing to. That means that smart pointers in C++ are owning pointers because they have to destroy the thing they point to at the end of its lifetime. If A owns B, that means that A has to destroy B when the time comes.
      That means that Non-owning pointers do not manage the lifetime of the object they point to, they just "look" at the object. They don't have any obligation to the thing they point to. That is why raw pointers are "ok" to use in a non-owning scenario. They are great if your function requires a view to the object. Nothing is hindering you to use pointers as you wish, but abrstractions like these are really handy when you have to reason with code that you are unfamilliar with. The purpose of abstractions is to carry intent.
      I hope that I made it a bit clearer. :)

    • @user-sl6gn1ss8p
      @user-sl6gn1ss8p ปีที่แล้ว +2

      @@aleksandarnikolic2441 thanks, it does seem to make a lot of sense : )

  • @lacelume9158
    @lacelume9158 2 ปีที่แล้ว +169

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

    • @tanujcherian3911
      @tanujcherian3911 2 ปีที่แล้ว +2

      my dude🤣🤣

    • @victotronics
      @victotronics 8 หลายเดือนก่อน +1

      "tweeted" ?

    • @vibaj16
      @vibaj16 7 หลายเดือนก่อน +6

      @@victotronics yes

    • @srys25
      @srys25 7 หลายเดือนก่อน +11

      @@victotronics are you born now or what?

    • @exnihilonihilfit6316
      @exnihilonihilfit6316 3 หลายเดือนก่อน +1

      5 years and 1 month before Twitter went online

  • @josef-c-6126
    @josef-c-6126 2 ปีที่แล้ว +295

    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.

    • @Stumashedpotatoes
      @Stumashedpotatoes 2 ปีที่แล้ว +15

      There are modern alternatives now tho, so no, it cannot be found in ALL projects where those things matter…

    • @sharoyveduchi
      @sharoyveduchi 2 ปีที่แล้ว +78

      @@Stumashedpotatoes "uhm ackshually"
      yeah yeah shut up. It probably STILL can be found in all those projects but indirectly. Rust for example uses LLVM to be compiled and LLVM is programmed in C++.

    • @Stumashedpotatoes
      @Stumashedpotatoes 2 ปีที่แล้ว +53

      @@sharoyveduchi my point was that you do not need to write CPP yourself to get the performance of C, by using rust or zig.
      Buddy you just did the biggest “um actually” I’ve ever seen. You brought up the fact that the compiler is written in cpp. “Umm akshually the compiler is written in cpp so youre still using it even when you’re not”. You gonna tell me Linux is written in C too?
      Cringe bro, cringe

    • @koodikoodi1040
      @koodikoodi1040 2 ปีที่แล้ว +9

      @@sharoyveduchi Fair point but unnecessarily vitriolic, Stuarts remark was completely fair and nothing about it was offensive.

    • @r2com641
      @r2com641 2 ปีที่แล้ว

      @@Stumashedpotatoes idiot. Every big electrical and mechanical CAD which used to build stuff we use in our life is coded in c++

  • @sledgex9
    @sledgex9 2 ปีที่แล้ว +89

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

    • @danielsan901998
      @danielsan901998 2 ปีที่แล้ว +9

      range-for loop is just syntactic sugar equivalent to an iterator loop.

    • @1337dingus
      @1337dingus 2 ปีที่แล้ว +1

      Yeah.
      I guess std::for_each(v.begin(), v.end(), []() {}); exists too, but I never understood why you would do that instead of ranged for.

    • @sledgex9
      @sledgex9 2 ปีที่แล้ว +16

      @@danielsan901998 range-for loop also works on arrays. Furthermore, it doesn't matter that it is syntactic sugar over something. It matters that is a better syntax. Iterators suck because they are verbose and ugly.

    • @danielsan901998
      @danielsan901998 2 ปีที่แล้ว

      @@sledgex9 it does matter that it is syntactic sugar because the point was "avoid sugar", and for-range loops is an example in favor of using syntactic sugar.

    • @sledgex9
      @sledgex9 2 ปีที่แล้ว +12

      @@danielsan901998 IMO, I took it to mean "don't structure your code in a way just to make use of all c++ features". Notice the absence of std::vector in the second example.
      If I was wrong in my interpretation of his point, then I consider that point a wrong one. Using syntactic sugar that makes things easier to write/read and less bug prone (off-by-one error in for-loop), is a MUST. Otherwise we should avoid lambdas too because they too are syntactic sugar over special structs.

  • @frenchmarty7446
    @frenchmarty7446 2 ปีที่แล้ว +38

    As someone who started with Java, C++ is very rewarding. I get the same OOP and functional features I'm used to plus equally great libraries without the overhead of the JVM.
    C++ is definitely *not* a "better" C. C is much easier to tinker with and iterate (without worrying about brittle design choices). C++ features and documentation almost always assumes you already know exactly what you want to build before you've written a single line of code. It is the complete opposite of say Python where you are guided towards the correct way of doing things.

  • @MrMShady
    @MrMShady ปีที่แล้ว +85

    My first language was C++ and I couldn't believe that other languages ain't got the features it has. I remember I was like: so how they do this and that?! Now I know they just don't ;)
    C++ is the power but only after few brain-aches. I think most of the haters just failed with the language and others are repeating the haters.

  • @TheRussianhippie
    @TheRussianhippie 2 ปีที่แล้ว +134

    honestly, I've used a ton of languages and I still find C++ to be my favorite language. I do use python for a lot of one-off type things that I intend to work on for less than a few hours, but I genuinely find C++ more fun because I can always find a trick to make my code be better.

    • @sososo3906
      @sososo3906 ปีที่แล้ว +1

      If you're not using it for your job try rust and never look back

    • @KopieOG
      @KopieOG ปีที่แล้ว +60

      @@sososo3906 rust fanboys again ruining everybody days

    • @sososo3906
      @sososo3906 ปีที่แล้ว +4

      @@KopieOG your right, finding out that the multi million dollar code base your company developed for 30 years will cost about as much to rewrite to be understood by anyone besides the original writers won't ruin your day, it will ruin your life

    • @hodayfa000h
      @hodayfa000h ปีที่แล้ว +3

      i use python for automation
      and c++ for making programs

    • @sososo3906
      @sososo3906 ปีที่แล้ว

      @@hodayfa000h if the code is written from scratch you should write it with rust, also it easy to make a python library and only implement in rust the bottlenecks of python

  • @TranscendentBen
    @TranscendentBen ปีที่แล้ว +16

    Just the 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.

    • @irrelevantpiadina
      @irrelevantpiadina 4 หลายเดือนก่อน +2

      implementing vectors in C isn't hard, and if you don't want to do that, there's already libraries for it

    • @beleggo4532
      @beleggo4532 หลายเดือนก่อน

      It is not only about vectors. It is just nice to have a good baseline that allows you as a programmer to comfortably make something. C++ has this nice balance of abstraction, performance and type safety. Well, and then it adds one hundred other features no one uses except that one friend of yours. However, after you get the hang of what you actually need, and treat std::vector with caution and respect, C++ is mega comfy.

    • @greypsyche5255
      @greypsyche5255 หลายเดือนก่อน

      This has been one of the most difficult parts of the language while learning. Beginners just get lost with all these standards and once they start learning a new standard comes and basically invents faster and better ways to do things which you'd have to relearn. It changes faster than a lot of people can learn, and these changes can be transformative. It's not just simple things. And tutorials/courses need to be updated too, which is another big problem.

    • @beleggo4532
      @beleggo4532 หลายเดือนก่อน

      ​@@greypsyche5255 I would say that you do not need to use all standards, but you can definitely get overwhelmed, by people with their "best practices". Does C++ change fast? Compared to Python and Javascript it is changing really slowly.

  • @kamkamkil1
    @kamkamkil1 2 ปีที่แล้ว +89

    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)

    • @kamkamkil1
      @kamkamkil1 2 ปีที่แล้ว +11

      also what i forgot to mention is that build system can be VERY complex in cpp. I don't have a lot of proffetional experience working with other languages but I don't think that in java or c# properly setting up build system can be so hard (even with cmake)

    • @olafbaeyens8955
      @olafbaeyens8955 2 ปีที่แล้ว +4

      Good developers makes everything work fluently in any language 🙂
      I understand what you mean with guidelines, but you also need some freedom to break the guidelines to find better ways.
      I see a lot of projects becoming hard to handle because of enforced guidelines.
      I think within the same project the code should be consistent. But between different projects the consistency can be different depending on the projects need.

    • @Tibor0991
      @Tibor0991 2 ปีที่แล้ว +11

      Not using STL in 2022 is shooting yourself in the foot from the start; why avoid type and memory safe structures with zero memory and performance overhead?

    • @kamkamkil1
      @kamkamkil1 2 ปีที่แล้ว +1

      @@olafbaeyens8955 of course i mean in single project single guildlines, as for flexibility in smaller project it should be fine, personally i work on 5g with hundreds other people so rules are enforce at ci level

    • @kamkamkil1
      @kamkamkil1 2 ปีที่แล้ว +2

      @@Tibor0991 we just use boost ore have our own libery

  • @chicoern
    @chicoern 2 ปีที่แล้ว +144

    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.

    • @lx2222x
      @lx2222x 2 ปีที่แล้ว +28

      I recommend using smart pointers as much as you can. With those you can be in 99% of the cases sure that there won't be memory leaks

    • @vikingthedude
      @vikingthedude 2 ปีที่แล้ว +4

      I’m somewhat of a masochist myself

    • @chicoern
      @chicoern 2 ปีที่แล้ว +3

      @@lx2222x I do whenever I can, but sometimes raw pointers are better, when calling native OS functions

    • @Tibor0991
      @Tibor0991 2 ปีที่แล้ว +7

      @@chicoern heads up: look for std::out_ptr, it's been invented to deal with OS calls that expect in-out raw pointers.

    • @chicoern
      @chicoern 2 ปีที่แล้ว +2

      @@Tibor0991 oooooooh didn't knew that! Thanks buddy!

  • @4cps777
    @4cps777 2 ปีที่แล้ว +115

    I think that C++ does solve some of C's problems as a general purpose programming language (although it's questionable whether C should be used as one in the first place when there are languages like Rust) but it creates even more of them. As such, my "personal style" of C++ is basically C with some extra things about C++ that I like (most notably the standard library).

    • @MrZapper1960
      @MrZapper1960 2 ปีที่แล้ว +14

      For me, understanding RAII as a mechanism for letting the compiler safely manage your resource lifetimes was eye opening. It moved me away from this “code in C” style

    • @juniorjunior8494
      @juniorjunior8494 2 ปีที่แล้ว +17

      I learned higher level languages first and C++ before recently learning C. I can tell you, for embedded systems, C is still much preferrable compared to Rust, especially when doing bare metal. C is almost married to embedded systems in a way other languages aren't. And personally, having now learned C, i think for complex systems, it can be a death trap, but it's simplicity also taught me how be efficient as a developer, especially with memory

    • @4cps777
      @4cps777 2 ปีที่แล้ว

      @@juniorjunior8494 I do agree but that's why I specified that I'm talking about general use cases and not special ones like embedded.

    • @stera182
      @stera182 ปีที่แล้ว +5

      @@4cps777 Even if this common belief of "C is better for embedded system" is completely false, they are tons of project in C++ and rust for embedded system. Arduino uses C++, ARM dev program libraries are in C++.
      C is used as a lingua franca so devices drivers are written in C so it can be used for every single languages, that’s all. Once you said that, nothing force you to use C as most languages can use C ABI.

    • @stera182
      @stera182 ปีที่แล้ว

      But even drivers can use a C abi and under the hood be written in C++ or even rust.

  • @salamanetwork
    @salamanetwork 2 ปีที่แล้ว +7

    C++ keeps amazing me everytime I have to code with it, New Syntax, New Features.
    I feel I don't know anything about programming at all everytime when I spending tim with it.
    Its fry my brain, but I love it.

  • @alexandrohdez3982
    @alexandrohdez3982 ปีที่แล้ว +13

    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 👏👏👏👏

  • @shimadabr
    @shimadabr 2 ปีที่แล้ว +10

    About C++ security, I think most of the common problems that Rust solved, C++ already did too. The "problem" is that while in Rust they're there by default (and you can't escape it), in C++ they're opt-in (but highly encouraged by the community) features or patterns like smart pointers, RAII, etc. Smart pointers are, in practice, C++ ownership system.
    C++ has a legacy of 30+ years, so a lot of legacy code and "legacy programmers" still use the old verbose, unsafe patterns, it's also the style teached at most universities (remember folks, professors usually don't stay up to date with the industry or language features). But I see a lot of effort by the community to enforce these new patterns and document them. For beginners it's a challenge to soak up and distinguish so much legacy knowledge together with the new knowledge. But I'm having a lot of fun in my journey.

    • @dynfoxx
      @dynfoxx 2 ปีที่แล้ว +3

      I think C++ is going in the correct direction with safety. Though they will never get as far as Rust. The main things that still bug me when working on C++ is threads safety and lifetimes.
      Companies I have worked with have flat out ban threading because it just causes so many bugs in what needs to be a safe system.
      Lifetimes are just never explicit in C++ you just have to hope things are documented well.
      C++ is not bad but it has years of issues that cannot be fixed.

    • @someonespotatohmm9513
      @someonespotatohmm9513 2 ปีที่แล้ว

      @@dynfoxx I think the threading issue is due to the not explicit (bad) lifetimes in c++. The first time I managed to get UB in an actual project was because some undocumented behavior in a library causing a pointer to that was required to become invalid. It took me days to figure it out because I checked if it was valid the line before I passed it.
      Multi threading itself is not that difficult, but using it efficiently usually means there are a lot of side-effects that become hard to keep track of. But if you have some expensive algorithm iterating over a lot of "uncoupled" data, it is not that hard.

    • @dynfoxx
      @dynfoxx 2 ปีที่แล้ว +3

      @@someonespotatohmm9513 it's not that hard in theory. But when C++ gives you no help and it's up to documentation that may or may not be followed it gets to be a problem.
      The fact that programs don't know atomic, volatile and shared pointer safety just gets annoying.
      Half of the issue is that you can do it right but it's just hard to keep right. If I am not careful some other person will come mess it up.
      They need owning mutates like rust has. It makes it more clear to start with. Though it will never be fixed it more so comes down to your code base and fellow engineers.

    • @radivojevasiljevic3145
      @radivojevasiljevic3145 8 หลายเดือนก่อน

      Short overview of Modula 3 and Ada gives an idea that Rust solved the problem which was solved long time ago, just not in world of C-family languages. Yes, it needed few decades to catch up, but better ever than never.

  • @milanmihailovic2113
    @milanmihailovic2113 11 หลายเดือนก่อน +29

    There is only one real programming language C++, the rest are wrappers written in C++.

    • @JacksonNick-j6i
      @JacksonNick-j6i 3 หลายเดือนก่อน +11

      C++ itself is written in C bro

    • @milanmihailovic2113
      @milanmihailovic2113 3 หลายเดือนก่อน

      @@JacksonNick-j6i Yes, initially the compiler for C++ was written in the C language, but when the compiler reached a certain level of development, it was used to further compile new compilers for C++ and for further development of the C++ language by writing new language functions in C++ itself.That process of writing a compiler in a compiler of the same language is called bootstrapping.

    • @milanmihailovic2113
      @milanmihailovic2113 3 หลายเดือนก่อน

      @@JacksonNick-j6i Yes, initially the compiler for C++ was written in the C language, but when the compiler reached a certain level of development, it was used to further compile new compilers for C++ and for further development of the C++ language by writing new language functions in C++ itself. That process of writing a compiler in a compiler of the same language is called bootstrapping

    • @frydac
      @frydac 2 หลายเดือนก่อน

      @@JacksonNick-j6i I think all major compilers are mostly C++ for some time now. But yeah, there is sooo much C out there that is essential to so many things. And Bjarne's first C++ compiler implementation CFront compiled C++ to C, though itself written in C++ apparently (just reading wikipedia now :) )

    • @JacksonNick-j6i
      @JacksonNick-j6i 2 หลายเดือนก่อน

      @@frydac Major compilers need major features

  • @johanngambolputty5351
    @johanngambolputty5351 2 ปีที่แล้ว +23

    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.

    • @ginxxxxx
      @ginxxxxx ปีที่แล้ว

      don't waste your wishes, because like a plant, you should water the best and cull the rest.

  • @fab9207
    @fab9207 ปีที่แล้ว +28

    look at it this way, the ones complaining about c++ are the ones writing articles and not code

    • @subhanasadli8617
      @subhanasadli8617 2 หลายเดือนก่อน +6

      I think Linus Torvalds has written a little bit more than jaust an article )

  • @metal571
    @metal571 2 ปีที่แล้ว +10

    Learning C first will tend to lead a developer towards a C-like C++ style. This tends to defeat the purpose of C++; See Kate Gregory's talk "Stop Teaching C".
    Avoiding sugar is also not the best approach, and in fact the range for loop over a std::vector generates less assembly instructions than using a traditional loop variable. You can prove this in Compiler Explorer with -O3 and is mentioned in Bjarne's book A Tour of C++ 3rd Edition. This makes some sugar in C++ what Jason Turner calls a "negative cost abstraction".
    Also "near zero cost" is not quite right. The language design involves what they call the Zero Overhead Principle, which is often misunderstood. This means not that there is actually zero overhead in using an abstraction, but that if you implemented it manually by hand using only C or assembly, you wouldn't be able to do better. At least, that's the goal...I won't go into how exceptions allocating and Run Time Type Identification are clearly in violation of this.

  • @aallfik11
    @aallfik11 ปีที่แล้ว +10

    I think the amount of control c++ gives is double edged sword, but I like it. On one hand, you sometimes have to write a lot of lines of code to do something that other languages would allow with just a few, or sometimes even out of the box. On the other hand, though, I feel I'm in control and it's ultimately up to me to decide what a piece of code will do down to the really fine details. With some other languages it felt like someone took the steering wheel from me and just said "don't worry, I'll handle it" while blindfolding me.

    • @honaleri
      @honaleri ปีที่แล้ว +1

      I totally agree. I have the same feeling. I'd prefer be in control then to just have "trust me, bro" experience when I'm trying to worth with technology.

    • @markaven5249
      @markaven5249 5 หลายเดือนก่อน

      And don't forget the program you build will be FAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAST

  • @PhysiKarlz
    @PhysiKarlz ปีที่แล้ว +2

    C++ is a _superset_ of C, not a subset thereof. But that is forgetting the small amount of changes made to C which are not compatible C++.

  • @M4D_SCI3N7IS7
    @M4D_SCI3N7IS7 ปีที่แล้ว +13

    Currently learning C++ (I come form a C# background). Love the language and I think it doesn't deserve the hate it receives. It's powerful, efficient & flexible.

    • @hecker230
      @hecker230 ปีที่แล้ว

      Can you recommend the resources for c++ ;)

    • @joaopedrovoga5497
      @joaopedrovoga5497 ปีที่แล้ว +1

      ​@@hecker230 A good place to start would be a channel called "The Cherno", he offers a wide variety of C++ videos, but you will have to move on to other stuff later since he doesn't cover everything. I also recommend watching some C++ weekly videos from Jason Turner once you get more advanced. (I also recommend you learn C first) *Good luck!*

    • @erik9817
      @erik9817 10 หลายเดือนก่อน

      Cool, I started with Java in uni and then became interested in C# but I’ve always had books about and interest for C++ for it’s efficiency and industry impact. I also like learning about backend development with .NET and C#. I’m having a really hard time deciding which one of these, C++ or C# to learn! I’m interested in topics like graphics, backend web dev, but even then, I have a hard time deciding!

    • @BoardGameMaker4108
      @BoardGameMaker4108 9 หลายเดือนก่อน

      ​​​@@erik9817 C++ is so important for your journey as a programmer. Even if you later learn a language unrelated to systems development, C++ gives you great insight into how to make more performant code. Other languages are also much easier after learning C++. Without learning pointers, for example, it can be harder to learn how all the objects connect together in C#. (C# has pointers called references, but they hide them). If you decide to go for a higher level language, try to not depend on a framework (like Unity) to learn the language. Otherwise you will be dependent on the framework and you won't learn how to structure the code on your own. C# is a really good language, but all programmers should learn C or C++ at some point imo to get a better understanding.

  • @paulrei00
    @paulrei00 2 ปีที่แล้ว +9

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

  • @vintagewander
    @vintagewander 2 ปีที่แล้ว +7

    I think the scope creep is what makes C++ too broad in features and becoming quite a mess

    • @dynfoxx
      @dynfoxx 2 ปีที่แล้ว +1

      For me it's that none of the features seem to mesh well together. They all seem separated and still in a first revision state. It just feels unfinished for some reason.

  • @JG_1998
    @JG_1998 2 ปีที่แล้ว +4

    If you are an engineer and plan to do anything related to software within engineering learning c++ is a must. Of course C is also important, but so much engineering work is done in C++. C is good for doing operating system related stuff and embedded systems.

  • @peppebck
    @peppebck ปีที่แล้ว +3

    this video is old but I'm a professional c++ programmer. I basically use C++ as a C plus the basic features I need. Once you can manage memory it's amazing what you can do. I try to not use too many different features so that my code remains very easy to read. that is crucial for me. I also program in c# and I love it but just where I don't have to push performance and memory management.

  • @lorensims4846
    @lorensims4846 ปีที่แล้ว +6

    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.

  • @atypicalprogrammer5777
    @atypicalprogrammer5777 2 ปีที่แล้ว +15

    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.

  • @electricwizard1949
    @electricwizard1949 2 ปีที่แล้ว +16

    Learning both C and C++ for embedded systems in school. The question of which one was better came up and my teacher told us: "Mix and match. If you prefer something in C use it, if you prefer something in C++ use that instead. If it works, it's already a great stepping stone to see which one you'll prefer".

    • @ginxxxxx
      @ginxxxxx ปีที่แล้ว

      the correct answer is neither

  • @jamesking2439
    @jamesking2439 ปีที่แล้ว +4

    I've been learning C++ for low level modding. It's been mostly fun, but god I hate having to maintain header files. That's worse than any confusing features.

  • @АлександрБолбат-ы1у
    @АлександрБолбат-ы1у 2 ปีที่แล้ว +2

    I don't get it when people hate C++ for syntactic sugar or some libraries they don't like. They can just not use them. Syntactic sugar is too complicated? Code in C style. Think you can do better and more efficient classes than standard library? Go for it.

  • @octavio2895
    @octavio2895 2 ปีที่แล้ว +3

    2:10 I think you meant that C++ is a superset not a subset of C

  • @justaway_of_the_samurai
    @justaway_of_the_samurai 11 หลายเดือนก่อน +2

    I have used a lot of C++ for developing a video game engine. I can confidently say that C++ templates are Witchcraft.
    Remember: they are NOT the same as generics, which you would see in higher level languages, even though they look similar on the surface.A templated function is NOT a single function that takes a variety of arguments; it is a meta-function which generates multiple, isolated functions during compilation, with different memory locations.

    • @niamhleeson3522
      @niamhleeson3522 2 หลายเดือนก่อน

      Templates are practically a new language in itself. Horrifying stuff.

  • @coolbrotherf127
    @coolbrotherf127 2 ปีที่แล้ว +73

    I've been studying it in college as most CS majors do and personally I found it to be a good language for learning low level programming as there are endless amounts of learning materials for it. The issue I have with it is the security risk that memory issues in the language has for actual production code. Rust and Carbon will probably finally cause C++ to become a legacy language like Colbol or Fortran. C++ is worth learning for now until Rust becomes the defacto low level systems language due to it being memory safe. Right more there are still a ton of C++ projects that need developers for them so if students learn it now, they can transition later.

    • @weirdo911aw
      @weirdo911aw 2 ปีที่แล้ว +10

      Rust will probably become the "de facto" in 15 years. Python took 40 to be this popular

    • @shimadabr
      @shimadabr 2 ปีที่แล้ว +28

      About C++ security, I think most of the common problems that Rust solved, C++ already did too. The problem is that while in Rust they're there by default (and you can't escape it), in C++ they're opt-in (but highly encouraged by the community) features or patterns, like smart pointers, RAII, ETC. Smart pointers are, in practice, C++ ownership system.
      C++ has a legacy of 30+ years, so a lot of legacy code and "legacy programmers" still use the old verbose, unsafe patterns.

    • @firstdingus
      @firstdingus 2 ปีที่แล้ว +20

      I don't really think c++ will go away any time soon, since, at least on embedded devices, space is low and while a hello world in c++ or c takes up 20 kb or so, rust's hello world requires over 500 kb.

    • @v01d_r34l1ty
      @v01d_r34l1ty 2 ปีที่แล้ว +10

      @@shimadabr finally somebody said it! Really when it boils down to it, Rust is better for new developers whereas C++ is more oriented toward experienced developers and toward more complex software. The industry only keeps programmers for about 4 years max (especially web) so it’s no wonder Rust is a major push right now. Rust is just safe C.

    • @v01d_r34l1ty
      @v01d_r34l1ty 2 ปีที่แล้ว +3

      Carbon isn’t actually meant to replace C++, it’s meant to be an intermediary language. It’s weird.

  • @mr_noodler
    @mr_noodler ปีที่แล้ว +1

    Should one learn C++? Only if one is interested in becoming a serious programmer… and no language is perfect ;) people will like/dislike what they will. This video has excellent advice! Thanks for making it

  • @diadetediotedio6918
    @diadetediotedio6918 2 ปีที่แล้ว +127

    I think the "As a coding language, C++ appeals to the ego, not the intellect" is an almost perfect statement

    •  2 ปีที่แล้ว +14

      Factually incorrect. Well used C++ is superior to C, or else mayor systems and most games would be written in C. No modern game is written in C, for a reason.

    • @rammyaly
      @rammyaly ปีที่แล้ว

      @ couldnt have said it better myself. i dont understand why C users love to shit on C++ so much 💀 Its like Tribemen hating on supersonic jets because it isnt made with sticks and tree sap

    • @MScienceCat2851
      @MScienceCat2851 7 หลายเดือนก่อน +5

      You do not have to hate just because it is hard for you

    • @diadetediotedio6918
      @diadetediotedio6918 7 หลายเดือนก่อน +1

      ​@@MScienceCat2851
      Except that I don't hate the language, I just despise the followers cult it have.

    • @MScienceCat2851
      @MScienceCat2851 7 หลายเดือนก่อน

      @@diadetediotedio6918 Maybe you have point in that as I have seen people that have high ego using C++, but it is a real language when you go in world of programming where everything js not just print("hello")

  • @Michal-vz7ms
    @Michal-vz7ms ปีที่แล้ว +14

    I have seen C++ being abused in embedded, especially using OOP patterns for every problem. Instead of making systems easier to understand, codebase grows ridiculously.
    Off course there is a sense to choose C++ for some solutions, but in firmware development I follow my philosophy of 'staying with C if I can'.

    • @ginxxxxx
      @ginxxxxx ปีที่แล้ว +1

      goto spaghetti is anathema to programming, drop down coupling is pure miscegenation of coding. DRY? if repeating is the root of all evil (silly uncle bob) then i am WET because virtual is infinite.

    • @melphiss
      @melphiss ปีที่แล้ว +1

      There’s no better language than C to understand how hardware works, that’s why I’ll also stick with C for embedded

  • @lonelytraveler8
    @lonelytraveler8 2 ปีที่แล้ว +6

    A lot of the code shown here is very dated, such as using begin() and end() to construct for-loops instead of range based, as one example. Compiling errors have come somewhat further, too. If you're stuck coding in a C++11 application, then fine, but it's over a decade old in a language that sees major adjustments every 3 years.
    Sadly, the main point almost applies MORE to modern C++, imo, so I guess it's a moot point...

  • @dcodernz
    @dcodernz 2 ปีที่แล้ว +28

    I think C++ is very underrated. IMHO it's the best programming language that I know and I know more than 10 reasonably well. Its STL is a game changer for algorithmic programming. It's the best for competitive programming and makes you understand so many things much better. Maybe not everything should be written in C++ though. I use typescript and java on a daily basis but learning C++ fully made me understand so much more.

    • @climatechangedoesntbargain9140
      @climatechangedoesntbargain9140 ปีที่แล้ว +1

      Do you know Rust?

    • @brandyballoon
      @brandyballoon 6 หลายเดือนก่อน

      I agree it's underrated. If I had to pick one language to be the most versatile, C++ is it. But it's terrible for some applications - web apps and data science for example.

  • @eightsprites
    @eightsprites 2 ปีที่แล้ว +13

    I think error messages from a C++ compiler is just to complicated. And dont say ”just learn it”, this is what I think: the error messages are to complicated.
    I got a lot of C++ books, I read them, I still don’t use C++. I happily use C or Java, even C# or Javascript.
    If a library has a C++ or a C API, I use the C API every single time.

    • @0xTas
      @0xTas 2 ปีที่แล้ว +2

      Have you tried Rust? The error messages from that compiler are consistently the most helpful I've ever seen.

    • @eightsprites
      @eightsprites 2 ปีที่แล้ว +2

      @@0xTas I actually havent. I tried Go but not Rust. Thanks for the suggestion.

  • @recarsion
    @recarsion 2 ปีที่แล้ว +13

    I worked in C for about 2 years in total and about 1 year in C++, and while both languages can be pains in the ass in their own ways, C++ was way more convoluted, unintuitive and tedious to work with in my experience. High-level, near-zero cost abstractions sound good but unless you can somehow solve memory safety without GC, you're building on sand. C++ couldn't quite achieve that, though many of its features and libraries are undeniably an improvement over C. Rust managed to do decades later what C++ couldn't back then.
    In conclusion, I wouldn't use C++ for any new project anymore unless I had no choice, like an Unreal game or a Qt application, though I wouldn't be surprised if both already have viable bindings in other languages.

    • @manasidixit9693
      @manasidixit9693 11 หลายเดือนก่อน +1

      How much salary ? And does it make permanent

    • @beleggo4532
      @beleggo4532 หลายเดือนก่อน

      Is a viable opinion. I definitely would never say that Rust managed what C++ could not though. Also, building on sand is literally what you are doing in C, since your constructs are build with premium quality TNT raw pointers waiting to collapse

  • @oglothenerd
    @oglothenerd ปีที่แล้ว +1

    Just use Rust. I know you cannot really compare the two, because they are completely different, but Rust can do the same things, whilst still having (more) elegant syntax, being speedy with zero cost abstractions, and no way to shoot yourself at all.

  • @123TeeMee
    @123TeeMee 2 ปีที่แล้ว +4

    Why does choosing programming languages have to be so hard. My analysis paralysis brain does not help the situation

  • @GameShorts484
    @GameShorts484 ปีที่แล้ว +2

    c++ is not easily readable i think. c# is best for me. you understand almost everything when you start to read any c# file

  • @rod6722
    @rod6722 2 ปีที่แล้ว +6

    What would you recommend before learning Rust? Is learning C before Rust a good idea? Asking because I'm interested in learning Rust, seems like you can build some really cool stuff with it, and I'm familiar with C but only the very basics (basically what's covered in CS50). Otherwise I'm pretty comfortable coding in any high-level scripting language (JS, Python, Ruby, PHP, etc).

    • @jonatanalmen3647
      @jonatanalmen3647 2 ปีที่แล้ว +5

      You are set to go! Having done some coding in C and high level language is enough to get started!

    • @danielchettiar5670
      @danielchettiar5670 2 ปีที่แล้ว +6

      IMO if you've properly messed around with memory and know how you can really mess up without being careful with memory, then you can try learning Rust, you'll then appreciate what it tries to solve.
      So you're good. Try learning it

    • @0xTas
      @0xTas 2 ปีที่แล้ว +4

      You can definitely jump in as you are right now, I was only marginally familiar with Python and Javascript when I started learning Rust (like ~5 months ago) and it's already my most comfortable and also favorite language to work in! Start reading through the book and don't give up when things get confusing! Rust has some concepts like lifetime annotations which won't be familiar to almost anyone at first but if you can push past those and the other low-level concepts that are new to you then you'll have access to one of the most pleasant languages to use imo, considering what it can offer.

    • @someonespotatohmm9513
      @someonespotatohmm9513 2 ปีที่แล้ว +1

      If you start out programming I would say rust because of the shooting yourself in the foot thing. If you are going to use it, whichever one best fits your purpose. The biggest difference between the 3 are the language features and syntax anyway.

    • @etopowertwon
      @etopowertwon 2 ปีที่แล้ว

      Learning C will only hamper learning Rust. You can easily write in C++ as if it was C. If you try the same in Rust(and you will if you learn C first), borrow checker will crush you.

  • @AlirezaBagheri-j6g
    @AlirezaBagheri-j6g 21 วันที่ผ่านมา +2

    a software engineer should really learn cpp.

  • @albertovelasquez9027
    @albertovelasquez9027 2 ปีที่แล้ว +3

    From my learning experience with C++, I would really like a C++ like language but whitout so many unnecesary features and obscure things.

    • @brandyballoon
      @brandyballoon 6 หลายเดือนก่อน +1

      You don't have to use the unnecessary features and obscure things, but I guess the problem is when you have to work with code somebody else wrote.

  • @vitgardon4896
    @vitgardon4896 ปีที่แล้ว +2

    C++ was my first language and I am so happy that it was that way. It forces you to learn about the fundamentals so that you understand what is happening with code under the hood. Also, it has the best syntax. No scope by indentation and it is precompiled.

    • @unknownguywholovespizza
      @unknownguywholovespizza ปีที่แล้ว

      No needed for C++ here. You could just get around with C which is much simpler and easier.

    • @anon1963
      @anon1963 ปีที่แล้ว

      @@unknownguywholovespizza hmm nah, unless you want to do embedded stuff

    • @unknownguywholovespizza
      @unknownguywholovespizza ปีที่แล้ว

      @@anon1963 I meant in terms of learning the fundamentals of memory management and programming not in terms of getting a job or building a software.

  • @JJSmalls
    @JJSmalls ปีที่แล้ว +3

    I'm reading Bjarne's book - "C++ Programming and Principles" and he recommends against learning C just to learn C++ afterwards.

    • @dimitris1988kom
      @dimitris1988kom 7 หลายเดือนก่อน

      Is it a good book to learn C++ from?

  • @alanzom1503
    @alanzom1503 ปีที่แล้ว +3

    The only real benefit of C++ over C is having many more libraries. Its hard to find modern libraries for C.

    • @homelessrobot
      @homelessrobot ปีที่แล้ว

      'modern' maybe, by whatever metric you used to measure modernity, but the first statement is quantitatively false.

  • @64bittz93
    @64bittz93 ปีที่แล้ว +4

    This is why I basically just write C, but use C++ classes and objects because they are super useful

    • @Briedys101
      @Briedys101 11 หลายเดือนก่อน +4

      It is not just about classes and objects. Todays C++ standard library provides many useful features such as algorithms, threading, file system and much, much more. You don't have to reinvent a wheel and it is really fast. Even memory allocations if done right, you dont need to worry about releasing memory. Though you need to know how templates work :)

  • @RetroAndChill
    @RetroAndChill ปีที่แล้ว +2

    C++ has some unique features that I like. Templates are one of them. I was caught really off-guard when I was writing some C# and learned that generics had only a fraction of the flexibility

  • @subhodeepmondal7937
    @subhodeepmondal7937 ปีที่แล้ว +3

    When you start learning c/c++ you would start to learn how computers works, you would get an intuition. But with other languages they treat computers as black boxes, like don't even dare to look into it.

  • @harryvpn1462
    @harryvpn1462 7 หลายเดือนก่อน +1

    The new "::" and "

  • @sabinbaral4132
    @sabinbaral4132 2 ปีที่แล้ว +5

    I don't know is c++ hard or pronouncing its creator's name

  • @dylanthony1
    @dylanthony1 4 หลายเดือนก่อน

    It’s nice getting a video concise and straight to the point. A lot of TH-camrs would find a way to make this topic 10+ minutes

  • @plebisMaximus
    @plebisMaximus ปีที่แล้ว +4

    I heard it was efficient, so when I finally decided to learn a programming language, I picked that one. Bad, bad idea, but it's working out ok so far, I got the basic syntax after just about 20 hours of online courses and it feels intuitive enough to use. Can recommend.

    • @User948Z7Z-w7n
      @User948Z7Z-w7n 4 หลายเดือนก่อน

      Wonder how far along the cpp journey you are now

    • @plebisMaximus
      @plebisMaximus 4 หลายเดือนก่อน

      @@User948Z7Z-w7n Nowhere near as far as I should've in a year, sadly, but I'm still having fun with it. Not aiming for a career, so it's not a sprint to me, more of a leisurely stroll lol.

    • @Doki_Natsuki
      @Doki_Natsuki หลายเดือนก่อน

      So, your thoughts?

    • @plebisMaximus
      @plebisMaximus หลายเดือนก่อน

      @@User948Z7Z-w7n Still terrible, unfortunately lol. But I'm having fun with it.

    • @plebisMaximus
      @plebisMaximus หลายเดือนก่อน

      @@Doki_Natsuki About whether it's worth your time? idk, I'm not in the industry, I just play around with it and it's hard and very verbose, so only worth it if you think that's fun.

  • @MCLooyverse
    @MCLooyverse ปีที่แล้ว

    *Do* use sugar, when it's what you mean. Use `for (const auto& e : stuff)` when you want to do something for each thing in turn.

  • @huntabadday2663
    @huntabadday2663 2 ปีที่แล้ว +11

    Before I learned how to program, I started out learning and designing CPU architectures 4 years ago when I was 13 years old. I find that understanding how CPUs works to the logic level really helps with programing (And understanding pointers).

  • @wrmusic8736
    @wrmusic8736 10 หลายเดือนก่อน +1

    I love C++. std::vector, std::unordered_map, std::thread, smart pointers - great things. Save so much time, while offering a lot.

  • @Amatikay-t1i
    @Amatikay-t1i 11 หลายเดือนก่อน +11

    I'm a math and CS student. I've studied various languages such as Python, R, Bash, VBA, etc. When I first encountered C++, it intimidated me. Pointers were difficult to grasp, but at times, I found myself enjoying C++. When I contemplate computers or programs, my thoughts are expressed in C++.. Their power and elegance make me inclined towards C++. I'm young and still have a lot to learn, but I aspire to become a professional in C++. I don't exactly know why. Perhaps it's because C++ is elegant. Perhaps because my mind operates in C++.

    • @erik9817
      @erik9817 10 หลายเดือนก่อน +1

      Nice comment! I feel that I have a hard time deciding between focusing on C++ and C#. I've spent some time learning C# but C++ has always been in the background, I was also intimidated at first, but I bought books about it several years ago.

    • @brandyballoon
      @brandyballoon 6 หลายเดือนก่อน +2

      I can relate to this. My mind needs to have a deep understanding of how things work. When computers were simpler, I understood them at hardware level. You also need a hardware level understanding to effectively program microcontrollers. C and C++ are "close to the machine" and just suit the way my brain works. It's hard to explain exactly what that means to someone who doesn't think that way, but I completely understand what you're saying.

    • @polvoazul
      @polvoazul 6 หลายเดือนก่อน +2

      Man, C++ is not elegant. This just shows you haven't learned enough C++.
      It is useful, and it is interesting, but there are just SO MANY CAVEATS.

  • @an0nsaiko890
    @an0nsaiko890 2 ปีที่แล้ว +3

    Isn't nobody going to point out that the tweet at 0:20 dates back to 2001 when twitter didn't even exist?

  • @keenoogodlike
    @keenoogodlike ปีที่แล้ว +4

    If your boss tell you to use C++ or get fired, use C++. If it's your own project and you comfortable with (your choice), use whatever you like. They are tools to get job done. That's it.

  • @guyarbel2387
    @guyarbel2387 2 ปีที่แล้ว +1

    Its not enough to just talk about cpp, you have cpp 20, cpp 11 and my favorite cpp 98 (without all the feature creep).
    Having lambda expressions and memory management is like having ketchup and chocolate, both are great but not together.
    oh, and rust is better only as long as you dont write complex data like fibonacci heap.

  • @noeldev
    @noeldev 2 ปีที่แล้ว +51

    C++ is C but 1 higher

    • @BederikStorm
      @BederikStorm 7 หลายเดือนก่อน +6

      I still use C whenever I can even when I code in C++. Yes, cin and cout are nice, but printf and scanf allow more easier

    • @noeldev
      @noeldev 7 หลายเดือนก่อน

      @@BederikStorm Bro this is a joke, cuz if you do ++ it means + 1, i ain't arguing what's better lol

    • @robertszacki1628
      @robertszacki1628 5 หลายเดือนก่อน

      I think that C++ is because of the operator overloading. C got into the next level. 🙂

    • @erlingsigurdson3064
      @erlingsigurdson3064 5 หลายเดือนก่อน +1

      In fact, c++ will return c, not c+1. Incrementation takes place as a side affect.

    • @MavikBow
      @MavikBow 2 หลายเดือนก่อน

      ​@@robertszacki1628 more often than not, you don't need to overload an operator. Arguably it's only justified with mathematical stuff, but for most of those, C++ provides you with a library anyway.
      Sadly, overloading operators usually leads to code that's hard to read, because you're not sure which operators work the intended way and which are overloaded. And it they are overloaded, do they work how you think/guess they work, or does the new logic only makes sense to the code's creator.

  • @NeiroYT
    @NeiroYT ปีที่แล้ว +5

    I love C++ for it's aesthetics, python looks oversimplified in this way. You feel exactly what your program will do, it's pretty useful.
    It may be hard to understand memory, pointers, addresses, but it's worth it.

    • @bmno.4565
      @bmno.4565 ปีที่แล้ว +2

      C++? Aesthetics? Come on bruh

    • @skittlesthehusky1225
      @skittlesthehusky1225 ปีที่แล้ว +4

      @@bmno.4565 u gotta admit c++ looks pretty cool ngl

  • @TylerHerwek
    @TylerHerwek ปีที่แล้ว +5

    If you learn c++, you can learn 80% of the other languages in a week.

    • @pro_gemer
      @pro_gemer 2 หลายเดือนก่อน

      60 but yes

  • @Ni7ram
    @Ni7ram ปีที่แล้ว +1

    im a Swift developer, ex Obj-C / PHP / ActionScript etc... and to me C++ is awesome. i did some games in the past with it.. its crazy fast. ridiculous how many particles i could simulate with it without dropping framerate (just software rendering)

  • @UsernameUsername0000
    @UsernameUsername0000 10 หลายเดือนก่อน +4

    I find it really funny how some Rust and some C people hate C++ for exactly the opposite reasons. One side likes safeguards and the other wants the manual memory management. It’s how I know the C++ hate is overblown; if different people contradict each other on why it’s bad, then you know it’s mostly just a hate bandwagon. Feature creep & not being the most safe language ever aren’t crimes in my book. C++’s only crime is not being radical enough - it’s way too loose and lenient for some people but simultaneously too restrictive and abstract for others. It’s a very misunderstood language that I will never not love.

  • @zdspider6778
    @zdspider6778 ปีที่แล้ว +1

    Lambdas and structured bindings ftw (C++11 and C++17).
    No namespaces in C.
    No default parameters in C.
    No function overloading in C. Bruh. 😐

  • @shiraneko246
    @shiraneko246 2 ปีที่แล้ว +4

    imho, if you wanna learn how computer works or how to break your own program, learning C is enough. Try to play around with pointers, like moving it around in an array, a struct (without packing), triple pointers or whatever. Learn to create dynamic size array, APIs provided by the OS and so on.
    If you are serious and wanna create production-grade applications, just learn Rust and make rust compiler your friend.

    • @henriquemuccilloschumacher542
      @henriquemuccilloschumacher542 2 ปีที่แล้ว

      @Clemens Horn well, not as high level as most languages, because you have acess to pointers ,you can cast variables to any type, use function pointers, you need to do your own memory management, etc
      still if you really want to know how a CPU works you're right, C still makes abstractions and learning assembly should teach you even more, but assembly is harder so i suppose it's better to start off with C and then proceed to assembly (if you want to learn how CPU works)
      in my work i'm using a lot of stuff that comes from OS APIs (in my case Windows) and i can say that there's a lot of libraries that just uses OS APIs and has one implementation for each OS, so you can learn how a lot of things work by learning OS APIs, or even directly use some funcionality which your wrapper library doesn't expose to you. If you're using windows i can even recommend a software called "API Monitor" which monitors and lists you all OS API calls a program does(you will be most likely impressed when you see it generating logs with hundreds of megabytes in a small amount of time, and all those calls are formatted in a human readable way with constant names and stuff, it's a really awesome program), in that way you can also learn how "stuff in OS works" which is also useful and those APIs can be called in any language so you're not really limited to C/C++
      Still i think you should also try rust, i didn't learn it myself yet but i know most people say good things about the language or just love it, i think learning how your CPU,OS and programming language works is the way to be a good developer

    • @henriquemuccilloschumacher542
      @henriquemuccilloschumacher542 2 ปีที่แล้ว

      @Clemens Horn I also want to learn assembly at some point, looks hard but really worth it (because you really learn how CPUs work and is really a must for reverse engineering)
      I get you, i was also really impressed that API Monitor generates gigabytes of logs in minutes from all API calls a program does internally, i remember searching and finding out that some syscalls in assembly change from OS version so that's why people normally are advised to use the OS APIs instead of directly using syscalls
      Still i also really liked working with SDL renderer and i want to try making game overlays by hooking direct X myself

  • @paulchamberlain7942
    @paulchamberlain7942 10 หลายเดือนก่อน +1

    My advice would be to only use C++ features if you need them, otherwise stay as C like as possible. I avoid the parts of C++ I cannot fully understand as I don't want parts of my programs to rely on faith to work. This is why I avoid templates whenever possible.

  • @fazin85
    @fazin85 7 หลายเดือนก่อน +9

    I find that c++ is more intuitive than languages like java, c#, etc. But damn c++ error messages are a pain in the ass.

  • @sorek__
    @sorek__ 2 ปีที่แล้ว +13

    C++ is awesome, its std:: library that is bloated and bad.
    Zero cost abstractions, OOP, overloading of operators, auto, quality of life stuff (default function overloads).
    I use it all the time on my embedded stuff, it's just great if used properly (basically as C with good stuff).

    • @LowLevelTV
      @LowLevelTV  2 ปีที่แล้ว +4

      Totally agree. It's a good language that is VERY easy to use incorrectly.

    • @michaelmueller9635
      @michaelmueller9635 2 ปีที่แล้ว +4

      It's like C++ wants to do it all and integrate all new languages into C++style, at the time the new languages were hyped.

    • @sledgex9
      @sledgex9 2 ปีที่แล้ว +6

      What? STL is its strong suit. It is very powerful and useful. Just take a look at the module. And you pay for what you use from it.

    • @michaelmueller9635
      @michaelmueller9635 2 ปีที่แล้ว +2

      PS.: The funny thing is, that all C++Conference talks got a strong Rust-flavor in 2022 xDDD

    • @sorek__
      @sorek__ 2 ปีที่แล้ว

      @@sledgex9 you are right but for embedded most stuff is bloated and MISRA discourage usage of std library

  • @MehdiSnoussi
    @MehdiSnoussi 2 ปีที่แล้ว +8

    I just started learning C++ as a first language. Most people say that you should learn python as first language. I tried to learn but stopped. And I was looking for a language to learn and decided to go with C++. People say it's hard language, but I don't know. I'm interested in it.

    • @hottoniapalustris1541
      @hottoniapalustris1541 2 ปีที่แล้ว +2

      Good for you. I think it's great that you learn C++ rather than Python. IMO Python is bad as a first language because it gives you a bad intuition about data types, contrary to any statically-typed language, like C++. And if you ever feel overwhelmed by C++, you can always switch to C. Though, my recommendation would be the same as in this video: to first learn C (as it's just as sophisticated, but much simpler), and then move on to C++. But if C++ excites you more, go for it.

    • @joelpww
      @joelpww 2 ปีที่แล้ว +1

      @@hottoniapalustris1541 same. I think personally that a language like Java or C++ is a great first language because you get to learn alot and be more involved in the code. Thus making your migration to other languages way more seamless. But thats me personally loving the trial by fire style of learning

    • @johanngambolputty5351
      @johanngambolputty5351 2 ปีที่แล้ว +2

      If its working for you, it doesn't really matter. Whatever language you use, it just needs to be good enough to make the projects that will allow you to learn what you need, without being so frustrating so that you might lose motivation.
      I think python is a good stepping stone and I like it for quick proof of concept type things. Potentially, python lets you skip the syntax and focus on learning how to give computers instructions first... control flow and all that, but its also allowed me to adopt some bad habits, like overusing list comprehension to quickly define arrays in a sometimes unreadable fashion, though I'm sure there different sorts of bad habits you can pick up from different languages. There's also some cryptic errors in python, usually around how things are copied or passed around, which make a lot more sense when you know about pointers and references, after all python itself will be written in c.

    • @cgme9535
      @cgme9535 2 ปีที่แล้ว +1

      It’s better to learn a language than get stuck deciding which one to learn first.

    • @someonespotatohmm9513
      @someonespotatohmm9513 2 ปีที่แล้ว

      @@hottoniapalustris1541 Imo c++ is worse then python, you have some weird unintuitive stuff in python but when using common libraries like numpy most things will be effectively statically typed. With C or c++, gl debugging if the first problem you run into is UB, which it likely will be. And UB in your own code is not even that bad as presumably you have reasoned about and tested stuff. But then you use a library and it does something else then you expect, well good luck if it something like a collision checking algorithm.

  • @markaven5249
    @markaven5249 5 หลายเดือนก่อน +1

    I wish I could have been a 90s game programmer. When I was a kid I tried learning C++ a few times, it was this mystically fascinating thing that was used to make every game that I loved at the time, needing to know chip architecture, incredibly complex syntax, that rewarding feeling when you get it to work, no AI assistants to help you just manuals....just wish I could have been part of that. What I would give to be a programmer on a game like Rise of Nations or Battlefield 1942 or console games at the time, or better yet a mainstream 90s adventure game or a Lucas Arts game, or even just Windows 9x software, or a Saturn or Playstation game...Now what do we have? Overabstracted javascript, python, ruby, annoying slow scripting languages, everything needs to be mobile and everything needs to be cross platform all at the same time. We have these annoying leetcode tests at these companies, yet it used to be that you actually had to be smart with working directly with the chips.

  • @MrZapper1960
    @MrZapper1960 2 ปีที่แล้ว +8

    The C++ standards committee is highly focused on making the language simpler and safer.. having an understanding of core facilities makes it mostly a pleasure to use in my experience. I cackle at those who say they just write c++ like c.. that indicates no effort to use it as intended.

  • @jaanu2222
    @jaanu2222 ปีที่แล้ว +1

    I started my programming journey by learning C and C++ and because of that i find it no problem learning basics of any languages out there

  • @whamer100
    @whamer100 2 ปีที่แล้ว +5

    i basically taught myself C++ and when starting college i took a class on it to further increase my skill, and its by far one of my favorite languages right now
    I basically use it as if it was C with bonus features (as how I personally feel it should be)
    I frequently mix the syntax where I see fit, using malloc for simple things like making a block of data to copy from a file into, and making a class or struct when I need something more complicated (specifically talking about C++ structs here)
    Its definitely not the best practice, but im just working on my own personal projects here, so its not like anyone other than me is going to be seeing it lmao

    • @xGOKOPx
      @xGOKOPx ปีที่แล้ว +1

      There's no reason to use malloc in C++ instead of new. Sometimes you may want to dynamically allocate a class that has a constructor, in which case new is the only way to do it properly. And using two different constructs to allocate memory throughout your program just adds mental overhead, instead of reducing it

    • @whamer100
      @whamer100 ปีที่แล้ว

      @@xGOKOPx I should've been more specific, I do use new most of the time

    • @myself50094
      @myself50094 ปีที่แล้ว

      @@whamer100 This is why rust is the leading programming language.

    • @whamer100
      @whamer100 ปีที่แล้ว +1

      @@myself50094 i should really learn rust tbh, the syntax annoyed me last time i tried it, but that was a couple years ago

    • @myself50094
      @myself50094 ปีที่แล้ว

      @@whamer100 i'm a troll

  • @mikeyangyang8816
    @mikeyangyang8816 2 ปีที่แล้ว +10

    From doing a personal projects (around 100,000 lines+ of code) using C++, C, Java, TypeScript/Javascript, and ObjectiveC, I truly think c++, Java, or ObjectiveC are the best languages simply because they all offer near zero cost for abstractions. For example, when I was writing TS in ReactNative I wrote a lot of classes and abstractions, but the performance gets worse and worse to the point a cold start takes more than 10 seconds, which I just recently found out TS doesn’t “compile” to js but simply translates to js. I was expecting TS can “unroll” the classes to js. This causes the project to get extremely bloated since you have to write as much logic into the same file as possible to preserve performance. I am not very experienced with javascript, but this property alone makes me dread writing any js.
    In C++, you can write pure C style, zero class projects; or, you can write completely object oriented project. Both styles will give you the same performance (some times the oop style will give you a better performance due to the -O2 level optimization the compiler can re-reference the class structures to decrease binary size, but C style code doesn’t have that information). I personally think oop offers clearer abstractions while writing code, and in the long run make the project scale a lot easier. That’s why I personally prefer it.
    However, I think anyone who can proficiently write C style code should NOT switch to C++. If you can write scalable C code, C++ definitely offers little value for you. Even so, I recommend anyone who is starting programming to start with C++ or Java, because these languages helps you to learn about structuring a project that can be scaled from the start. And you can switch to C style languages at a later date without any trouble.

    • @tuluppampam
      @tuluppampam ปีที่แล้ว

      I've found Java weird to learn as a first language as I couldn't understand why I had to use classes and objects even for simple operations (I started with codecademy so it might be a problem with the site)
      Then having methods instead of functions felt even weirder (it took me a long time to figure out how to use them)
      I feel like Java is somewhat less intuitive then a more functional language, but that maybe depends on experience

    • @mikeyangyang8816
      @mikeyangyang8816 ปีที่แล้ว

      @@tuluppampam Yes, it is very unintuitive. However, when you eventually work on a large project empirical functions just make everything harder to organize.
      Also, a small problem with your reply, "functional" or functional programming in computer science has nothing to do with writing a program with only functions. Functional programming is a programming paradigm that let the computer handle how to execute a command by composing functions with a set of rules instead of defining operations and primitives; it is used in languages like Haskell and prolog, also javascript in a limited degree.

    • @mikeyangyang8816
      @mikeyangyang8816 ปีที่แล้ว

      @@tuluppampam So, when you talk about "functional languages" you are really meaning to say languages like C. However, pure functional languages are very very very different from C. Just take a look at some Haskell code.

    • @fredericbrown8871
      @fredericbrown8871 ปีที่แล้ว

      @@mikeyangyang8816 I think they indeed meant functions (/procedures, presumably) in a procedural language rather than functions in a functional language. Not that functions in a pure(ish) functional language are that different than those of a procedural language but coding with this paradigm is a drastically different experience than coding in an imperative language, object or procedural (my experience was with ML).

  • @zardozjones
    @zardozjones 9 หลายเดือนก่อน +1

    Just learn a simple 8bit asm - z80/6502/68k for the low level memory/register/optimization knowledge, then C then C++ - every other language will seem totally obsolete for pure performance and raw power.

  • @FuzzhyFoo
    @FuzzhyFoo 2 ปีที่แล้ว +30

    I don't think people have to learn C first. As a starting language, I think C++ contains a much simpler language trying to break free, chained down by legacy. I feel we scare away people from it by spooking them with scary concepts like pointers, references and memory safety. As though that is something exclusive to C/C++.
    If I were to introduce someone to programming through C++, I wouldn't teach them about raw memory allocation. No pointers, pointers to pointers, or even references. Reduce the friction between them and their code until it becomes relevant to understand the more core concepts. Let them pass variables by copy while they're learning. Move semantics have reduced the overhead of that dramatically. Let them return copies, they don't have to understand copy elision or NRVO. You don't teach someone java or C# by telling them how to appease the garbage collector.
    It's naive, yes. But even basic things in C can appear arcane. Take the supposedly safe "sprintf" - lovely name.
    You need to understand stack vs heap allocation, when to alloc/free. null terminators, the caveats of the sprintf family of functions, the 'safe' versions of them, what that strange 'restrict' keyword means, etc.
    Of course, there are nice, basic, declarative examples like adding strings together, which while basic, lets beginners appreciate how that happens under the hood.

    • @FuzzhyFoo
      @FuzzhyFoo 2 ปีที่แล้ว +9

      Though, as a C++ developer, definitively try pure C at some point. There are a bunch of things you can learn to appreciate from it. It'll make you a better C++ developer for sure.
      Junior me's mind was blown realizing you could hide details in translation units. Or how often all you needed was some fixed size buffer/variable allocated on the stack.

    • @conrad9196
      @conrad9196 2 ปีที่แล้ว

      Greetings! I want to learn programming basics, final goal being able to develop my own tools in cibersecurity (malware analysis/development).
      I have roughly two years to dedicate to learn the basics, programming included. Could I ask for your opinion on how to structure a complete beginner study guide for not only programming in general but doing it in c++? What resources would you use? Any input is appreciated from an experienced and advanced user.
      Later on I will need python for automation, c#, powershell... But I could use a direction from zero level.
      Thank you in advance, sir

    • @FuzzhyFoo
      @FuzzhyFoo 2 ปีที่แล้ว

      Don't you worry, I know what I'm talking about, and I know very well what you're talking about as well. I'm omitting parts to make a point. Details that also shouldn't matter to beginners.
      It's hardly a perfect language and never did I suggest it was. More experienced people are free to take educated decisions, and provide good reasoning for it.
      When it comes teaching people programming, I wouldn't say Ada would be my first pick.

    • @matyasmarkkovacs8336
      @matyasmarkkovacs8336 2 ปีที่แล้ว +3

      C is much simplier to understand and it takes less time to learn than C++.
      Pointers are really not a big deal if it is explained well to a beginner.

    • @alzon5712
      @alzon5712 ปีที่แล้ว

      Agreed, however I think the perception of pointers is they are somehow complicated, but they are not, its just a variable that holds the memory address to a value, to get the value you have to dereference the pointer first using * or -> and that's mostly it. To allocate a pointer you can use the new keyword, and to delete it delete. You don't delete it then it will stay in memory. When I have mentored beginners they picked this up quickly so I have no doubt someone with an aptitude for programming won't struggle too much then, once they are comfortable with that introduce them to smart pointers and tell them never to use raw pointers again lmao

  • @GnuChanOS
    @GnuChanOS 2 หลายเดือนก่อน +1

    i'm new in c and what is this?
    a = {1} is this array? and &s ???? what is this man? 1:37

  • @peperoni_pepino
    @peperoni_pepino ปีที่แล้ว +4

    My main issue with C++ (although I have only played around in it to try and mod games) is that I mainly learned to program in Python and I really take line 14 (and 15 lol) of the Zen to heart, while C++ just has too many parallel ways to do something. It is not obvious which way to use, and it seems that in the same code (e.g. the same game) different developers will use different ways to do essentially the same.
    Oh, and I have seen an open source software that both had a custom class Color and imported QColor, and mostly used QColor for colors that could update (user settings) and Color for fixed color, but there were exceptions. Why?!

    • @UsernameUsername0000
      @UsernameUsername0000 10 หลายเดือนก่อน +2

      The latter isn’t a C++ issue though? It’s how that particular dev team decided to use other packages.

    • @erik9817
      @erik9817 10 หลายเดือนก่อน

      Last paragraph: Probably to abstract away the use of QColor.

  • @acetrainerarcane1755
    @acetrainerarcane1755 2 ปีที่แล้ว +2

    2:40 "Do not learn this as first language" Meanwhile my college proceeded to teach that in our programming 1 course, a course meant for people with little to no background in programming

  • @michaelmueller9635
    @michaelmueller9635 2 ปีที่แล้ว +7

    Lol, the more I understand Haskell, C and C++, the more I understand why Rust is there.
    But vice versa, without Haskell, C and C++ I wouldn't understand Rust or why to do so.

  • @user-hk3ej4hk7m
    @user-hk3ej4hk7m 2 ปีที่แล้ว

    The most powerful features of cpp are templates and resource lifetime management with RAII. Neither of these features need classes or OOPs to exist

  • @Ma1ne2
    @Ma1ne2 2 ปีที่แล้ว +20

    I like C++. I love Rust. From my experience, learning C++ is difficult alone because it is so old and had so many changes. There are 10 ways to achieve something, often the new ways are better and easier. There is a good to great language hidden inside C++, a subset that is modern, comparably easy and safe to use . Then again, why hurt your brain by trying to find that language when you just can learn Rust that doesn't have the baggage of history and C compatibility.

    • @michaelmueller9635
      @michaelmueller9635 2 ปีที่แล้ว +3

      Just the whole CMake-Game and to figure out, what is outdated or not ...and if outdated is compatible with current CMake or if it's a dead end and deprecated.

    • @Ma1ne2
      @Ma1ne2 2 ปีที่แล้ว +3

      @@michaelmueller9635 Oh yeah, I so wanted to learn CMake and invested a lot of time in it. But it is not good, it is not easy to use, it is overcomplicated imo. Then the whole splitted ecosystem of librarier. Conan, Cmake, direkt Git, Microsoft's pkg or whatever the name was. No standardised way to do anything so you start at 0 with every new project.
      That's the thing with languages, it's not just the syntax, the performance i.e. the language itself. It is the build tools, the standard library, external library support and so much more. And if you view all of that together, developing C++ projects is just so exhausting.
      It is great for embedded stuff though because Arduino and PlatformIO did an amazing job at creating an ecosystem for all what's embedded for C++!

    • @heavymetalmixer91
      @heavymetalmixer91 2 ปีที่แล้ว +4

      Because of existing code, software and platforms that already use it, like games.

    • @exnihilonihilfit6316
      @exnihilonihilfit6316 2 ปีที่แล้ว +2

      @@heavymetalmixer91 Yep. Reason #1 in my opinion.

  • @semicharmedkindofguy3088
    @semicharmedkindofguy3088 2 ปีที่แล้ว +1

    C++ is more than C with classes now, modern C++ feels nigh unreadable to my C brain. IMO if you're using C++ it's best to completely decouple it from C and use modern C++ paradigms. If you're starting a new project use Rust instead.

  • @heitormbonfim
    @heitormbonfim 2 ปีที่แล้ว +9

    I tried learning C at the begining, but that made me frustrated, so I went to Python, it made me feel much better and I learned the fundamentals fast, now I am learning C with much less struggle. I think it's better to start with a high level language and then go to a low level language.

    • @LowestofheDead
      @LowestofheDead 2 ปีที่แล้ว +2

      @@kmouratidis If you do Python than C++, it's like climbing one storey of the stairs.
      Starting C++ is like trying to jump to the next storey with no stairs

    • @gianni50725
      @gianni50725 2 ปีที่แล้ว +5

      @@LowestofheDead Disagree. There's more syntactic complexity but it's very possible to stay away from all the parts that actually make C++ difficult. If syntax is your blocker for learning programming, you have a tough road ahead.

    • @matyasmarkkovacs8336
      @matyasmarkkovacs8336 2 ปีที่แล้ว +1

      If C is explained well it shouldn't be that hard to understand at least the basics.

    • @2eanimation
      @2eanimation 2 ปีที่แล้ว +1

      @avfr hardly disagree. Excel in languages you actually need, try and learn other (maybe even obscure) languages to widen your horizon as a software developer.

    • @2eanimation
      @2eanimation 2 ปีที่แล้ว +1

      @avfr You assume people can only do isosceles triangles and temperature converters after 1 month of C? Get off your high horse lol. Not everyone chooses C as their first language. If you've got plenty of experience in, let's say, Python and JS, it wouldn't even take a month to learn C, the standard library is not that big, especially compared to Python and JS. Doesn't mean you're suddenly being able to code kernels and stuff, you'll need way more knowledge than just C for that.
      It's like spoken languages. Just because you're proficient in English doesn't mean you'll be the next Shakespeare. Or the next Mozart if you can play the piano.
      _
      As an anecdote: after seeing Haskell for the first time I immediately fell in love with it. Got myself a copy of "Learn you a Haskell for great good" and worked my way through that book in less than a month. Delightful read! I wasn't able to code anything I want at that point, but oh well, it's Haskell after all. Fiddled around with it for a couple of months and eventually stopped digging deeper. I'd say I'm pretty good at it now, though I only really use it to tackle and solve projecteuler problems, never used it for professional purposes. I can say with confidence that it boosted my abilities in Python(mostly data analysis and simulations, if we're talking about money making :)) like, A LOT, as well as my problem solving skills as a whole. It started as a recreational activity, for the jest of it, and now I'm a better programmer. Am I a Haskell god? No. Have I learned the whole language? No. Who cares? And who cares what and what not someone can do after 1 month of C?

  • @ditz3nfitness
    @ditz3nfitness ปีที่แล้ว +1

    Bjarne is the King. Went to the same University I currently are taking my degree in software engineering at! Second semester in!

  • @7alfatech860
    @7alfatech860 2 ปีที่แล้ว +5

    I am in the process of learning both C and C++. My limited observation so far is that one really needs to understand the limitations of C++ when it comes to embedded. I do like some of the features found in algorithm. On the other hand, having so many different ways just to initialize a variable in C++ is just one example of how the whole system is creaking under the weight of backward compatibility.

    • @WilliamWeatherholtz
      @WilliamWeatherholtz 2 ปีที่แล้ว +13

      "C is what you get when you almost always say no to adding something to the language.
      C++ is what you get when you almost always say yes to adding something to the language "

    • @0xTas
      @0xTas 2 ปีที่แล้ว +5

      @@WilliamWeatherholtz and "Rust is what you get when you design a language sensibly from the start" :p

    • @absalomdraconis
      @absalomdraconis 2 ปีที่แล้ว +1

      @@0xTas : Oh? Then why does it still use symbols to declare pointers? That was an _experiment_ when C did it, and it hasn't turned out to be a great idea.

    • @JJSmalls
      @JJSmalls ปีที่แล้ว +3

      @@0xTas Another Rust shill.
      How much you get paid per post?

  • @Airatgl
    @Airatgl 2 ปีที่แล้ว +2

    I heard different opinion. Learn C++ separately from C, and learn it as a high-level language like Java. So without raw pointers but with stdlib. So it will be much more gentle learning curve.

    • @nunyobiznez875
      @nunyobiznez875 2 ปีที่แล้ว +1

      Whoever told you that, gave you bad advice. If you were even able to learn that way at all, that would be the best way to learn to write bad code, by not understanding how anything actually works. You don't need to learn to master it, but spend even just 1 or 2 months learning C first, and you'll at least understand the basics of how things work under the hood in C++. It'll save you a lot of time, headache, and trouble down the road, and make the learning process in C++ far, far easier.

    • @Airatgl
      @Airatgl 2 ปีที่แล้ว

      @@nunyobiznez875 I think that advice comes from Bjarne himself. Check his lecture "Learning and Teaching Modern C++" from CppCon. Also good lecture "Stop Teaching C" from Kate Gregory

    • @nunyobiznez875
      @nunyobiznez875 2 ปีที่แล้ว +1

      ​@@Airatgl I know Bjarne is the original source, though many repeat it. I've read him make similar statements in Programming Practices and Principles. It's still terrible advice, but coming from him, you at least know his motivation. He wants people to use C++ and not C. It's also been a very, very long time since he was a beginning programmer, and he's never even been a beginner looking in on C++ for the first time. I can tell you from experience, that it's the worst programming advice I ever received. Had I not gone and learned C, I would have never even have learned C++, because I would have probably given up on it long before. After learning C, I was able to focus directly on C++'s unique features, since I already knew all of the basic stuff. It made it so much easier. I can't even put into words, just how much easier it was. I was also able to come into it, with full understanding of how things were working under the hood, or at least a very good idea of what was going on, which makes it easier to use the tools correctly, and avoid common mistakes. It was a significant advantage having that knowledge at the start. Not to mention, I had a greater appreciation for the convenience features, since I knew what was actually being done for me.
      But to each their own. You are free to do as you like. I can only tell you that I heard both advice, and to some extent, I put both into practice personally. I think it's terrible advice to tell someone to start with C++, without at least learning C first. Fortunately, I was also lucky enough to have heard someone else's bad experiences of trying to hop over C right into C++ as well though too, who also advised it's much easier to start with C and wished they had done that. So, it saved me a lot of headache.
      I'll also point out, that every University CS course that I've seen, also starts with C, long before any talk of C++. There may be some out there I haven't seen, but I'm not aware of any.
      This is only one University Professor, but here's a CS Professor at Clemson University, explaining some reasons why he uses C for beginners, and not C++:
      th-cam.com/video/KGFOLJiIo1g/w-d-xo.html
      and: th-cam.com/video/BIht65Xu1jI/w-d-xo.html

  • @hgbugalou
    @hgbugalou ปีที่แล้ว +4

    My introduction to computer programming in school was Visual Basic 4 in year 1 and then C++ in year 2. Granted this was the late 90s, but it was still a trial by fire and a lot of unlearning in the years after. I still like C++ though.