Do You Like C or C++ More ?

Поделиться
HTML-код
  • Опубликовано: 10 янв 2025

Комментарии • 1,5 тыс.

  • @norhamsfinest9761
    @norhamsfinest9761 Год назад +6410

    I don't mind C++ code I wrote because I only use the subset of features I like and understand. The biggest problem of C++ is that everyone uses a different subset of the language and so trying to learn a new program every is like learning a new language.

    • @capsey_
      @capsey_ Год назад +155

      Ding ding ding ding!

    • @sacredgeometry
      @sacredgeometry Год назад +303

      Exactly this. Good C++ looks and behaves a lot like C anyway. Just with classes.

    • @maciejprokop2001
      @maciejprokop2001 Год назад +10

      Yeah o think you're right man !

    • @trans_rights_ftw
      @trans_rights_ftw Год назад +29

      This is similar to the problem with Kotlin as well! Reading others' Kotlin is so hard lol

    • @SkyyySi
      @SkyyySi Год назад +68

      ​@@sacredgeometryIf you think that C++ is just C with classes, then you probably never used anything beyond C++89

  • @ISKLEMMI
    @ISKLEMMI Год назад +2918

    People say you can simply avoid using the ugly parts of C++. The problem is that you still have to read and use code written by people who DO use those features.

    • @KanashimiMusic
      @KanashimiMusic Год назад +46

      Sadly, at this point, you literally can't even avoid those parts while writing code, either.

    • @captainfordo1
      @captainfordo1 Год назад +92

      @@KanashimiMusicyou can, just remove the those two little p’s at the end of the file extension

    • @KanashimiMusic
      @KanashimiMusic Год назад +5

      @@captainfordo1 Yeah, but as soon as you access those files from cpp code you gotta deal with the same shit

    • @NinjaRunningWild
      @NinjaRunningWild Год назад +3

      Have to?

    • @Dremth
      @Dremth Год назад +15

      You should try not collaborating with bad programmers. It's pretty nice.

  • @happyfase
    @happyfase Год назад +5474

    With macros, every C++ project becomes it's own programming language.

    • @mdev790
      @mdev790 Год назад +175

      Not macros but more like templates

    • @homelessrobot
      @homelessrobot Год назад +255

      even without templates, ever c++ project is its own programming language because every project uses a different subset of the language.

    • @NimerionTech
      @NimerionTech Год назад +16

      @@homelessrobot go binary then.

    • @homelessrobot
      @homelessrobot Год назад +111

      @@NimerionTech binary isn't a programming language

    • @tsunamio7750
      @tsunamio7750 Год назад +70

      @@homelessrobot He doesn't know about assmblers i think. Just don't bother with the guy. His soul will forever rest in heaven.

  • @rkroll17
    @rkroll17 Год назад +1380

    Low level is great because it feels like you understand everything but abstraction is great cause you can get stuff done quick

    • @natescode
      @natescode Год назад +67

      There is a point where abstraction goes too far. EVERYTHING in C++ can mean something else. Macros, operator overloading and numerous features makes it extremely difficult.

    • @Hardcore_Remixer
      @Hardcore_Remixer Год назад +26

      Hence why C hits the sweet spot for me.

    • @fr89k
      @fr89k Год назад +26

      Abstraction is good if you have a large code base and need to extend and modify the code. With a very good software architecture a similar convenience level can be achieved in C, but a) you have to be able to really really create such a good architecture and usually you notice too late all the oversights you made and b) if a new guy joins the team, you have to teach him a lot about how this architecture is too work. In contrast, every C++ developer knows how C++ inheritance works, so you have that covered already.

    • @powertomato
      @powertomato 11 месяцев назад +10

      Abstraction is good, if you don't need bare metal access, but why on earth C++? It has features that don't matter if you need abstraction, but lacks features if you value it. It's like it takes the worst of both worlds: it's bad for if you need abstraction and it's bad if you need low level access.

    • @fr89k
      @fr89k 11 месяцев назад +5

      @@powertomato In C++ you can do very low level things. In embedded systems that is important for a few things. A language that doesn't allow direct interaction with the hardware is not suitable for ended systems.

  • @bobson_dugnutt
    @bobson_dugnutt Год назад +2270

    "You can tell what every line of code is doing"
    *laughs in compiler optimizations*

    • @phusicus_404
      @phusicus_404 Год назад +90

      "As-if" principle

    • @WillD-jj9kg
      @WillD-jj9kg Год назад +33

      Haha yeah man that's wild, no just kidding I got no clue or care what that means 😂

    • @koiledPythonRain
      @koiledPythonRain Год назад +65

      Excactly. This seems like an ego problem

    • @pyrus2814
      @pyrus2814 Год назад +73

      You seriously overestimate how much the compiler actually does.

    • @scr4932
      @scr4932 Год назад +42

      ​@@WillD-jj9kgThe compiler may optimize the code while compiling it to make it faster depending on how it's configured.

  • @3KLANGMUSIC
    @3KLANGMUSIC Год назад +207

    Many people told me Im the smartest guy that they ever met. So I bought an Unreal Engine C++ course, but the only thing I learned was that they lied to me.

    • @TheShmrsh
      @TheShmrsh 7 месяцев назад +4

      😂😂😂

    • @TheShmrsh
      @TheShmrsh 7 месяцев назад +5

      I had a friend he tried to learn that shi too and he ended up quitting after not event getting past vs code

    • @K3rhos
      @K3rhos 6 месяцев назад +24

      Don't worry I'm a C++ dev myself for years, and I wanted to test Unreal Engine one day (without using Blueprints, so only using real coding with C++) and I quickly quited lol
      Unreal Engine C++ is like a new language by itself, everything from the original C++ is different, UE built their own garbage collector, they have built their own smart pointers, their own defines etc...
      It's liking learning a new language from scratch tbh.

    • @crispybatman480
      @crispybatman480 6 месяцев назад +8

      ​@@K3rhosMan, imagine what the source code for something like Ark Survival Evolved looks like then... Pure spaghett.

    • @mattmurphy7030
      @mattmurphy7030 6 месяцев назад

      @@K3rhosyou’re a piss poor c++ dev if you found unreal c++ complicated. It’s an extremely restricted subset of C++.

  • @karansethia1037
    @karansethia1037 Год назад +1046

    That one guy at every hackathon

    • @frederico-d3l
      @frederico-d3l Год назад +54

      imagine this guy talking to women. lmao

    • @Cobalt985
      @Cobalt985 Год назад

      @@frederico-d3l people like this are the only reason the internet works

    • @HeyIntegrity
      @HeyIntegrity Год назад +25

      Do people who already know how to code go to hackathons or is that a place to learn how to code too?

    • @amir_husseyn7712
      @amir_husseyn7712 Год назад +29

      I think both​@@HeyIntegrity

    • @Dom-zy1qy
      @Dom-zy1qy 10 месяцев назад +43

      ​@user-hl3qv8qg2s You would think that, but there are many women who appreciate guys like him, and how they articulate things; even if its nerdy. I have a friend who's slightly more attractive appearance wise, he's legit got a fkn harem at his college.
      I don't know how tf that happened, but he's had like 4 different groups of females orbit around him.
      I think being authentic is a big part of it.

  • @sinom
    @sinom Год назад +156

    This in general is a "problem" with abstraction. You trade code that is more traditionally readable and more concise for not immediately knowing low level details of what does what.
    Which is better is very dependant on the use case and personal preference.
    For most sub millisecond usecases I've had to deal with when writing stuff with C++ using some linear algebra library that does operator overloading it was more than fast enough for the job while making it just easier to write simple vector and matrix maths.

    • @ollicron7397
      @ollicron7397 Год назад +6

      It literally makes everyone hate c++ in a production environment.

    • @egg-mv7ef
      @egg-mv7ef Год назад +26

      people forgetting they can ctrl + click to go to a class definition and use their eyeballs to see what the overload does is crazy

    • @Deadmanstrolln
      @Deadmanstrolln Год назад +21

      ​@@egg-mv7efc coders are a wild bunch. Them and bash scripters are the only group you'll find refusing to use IDEs in general. In reality, unless you absolutely need the best performance down to nanoseconds, you probably shouldn't be dealing with C at all. Use a modern language and develop 100x faster with infinitely easier to read code.

    • @egg-mv7ef
      @egg-mv7ef Год назад +2

      @@Deadmanstrolln eh c++ is great to use tbh i use it for almost everything. this dude in the vid straight up doesnt know what hes talking abt

    • @OverruledDood
      @OverruledDood Год назад +4

      ​@@egg-mv7ef this isn't reliable 100% of time in 100% of IDEs, yes you can find how the abstractions are implemented but if the abstraction wasnt necessary to begin with all it means is anyone reading that code is going through more steps than they need to to figure out what thw code is doing.

  • @CrittingOut
    @CrittingOut Год назад +223

    I like C++ more as long as it's used for the initial goal of "C with classes"

    • @jasonenns5076
      @jasonenns5076 Год назад +23

      But, that is not the point of C++. The point of C++ is versatility, limit itself to what C does, but to expand on it.

    • @AetherStreamer
      @AetherStreamer 4 месяца назад +2

      @@jasonenns5076 No thanks.

    • @jasonenns5076
      @jasonenns5076 4 месяца назад +8

      @@AetherStreamer What disadvantage is there to use C++? If you have a good C++ compiler there is no reason you should use C.

    • @MrGriefCreep
      @MrGriefCreep 4 месяца назад

      ​​​​​@@jasonenns5076
      1. Modern C++ syntax
      2. Lack of abstraction (as in this vid)
      3. Extensibility
      4. C++ contributors' inability to name things correctly (see iota and range confusion)
      5. The fact that I should use Rust instead of C++ in almost every instance, but the same can't be said for C, which is lower level.
      6. Operator overloading 🤮
      I can keep going. If you want modern language features, why not just use Rust? C is useful because it almost directly translates to assembly, while C++ is so far removed that there's no practical reason to use it. C syntax is simple, ubiquitous, and universal; C++ syntax changes between individual C++ developers because of how bloated the language is these days.
      Why even bother with C++? Just write in C, because everything you can do in C++ can be done in C, just maybe with different syntax.

    • @jasonenns5076
      @jasonenns5076 4 месяца назад

      @@MrGriefCreep C++ is true freedom. You are allowed to choose what you want to use. Operator overloading makes iterators such a pleasure to use. C++ syntax does not change, there are just additions to the language. Structured binding is a useful abstraction that does not change anything. You can still use the "older" syntax if you so choose. If you were to complain about how coroutines are inplemented in C++ and the whole promise object thing, then I would grant you that argument, but are you ever confused how to use std::vector? It was named incorrectly, but everyone knows how to use it. So then, what is the problem with iota or range. However, your suggestion of using C instead of C++ is ridiculous. It would not just have a different syntax, but it would be more work. The implementation of virtual functions would be additional work that is not necessary. There would be no automatic destructor call as there are for stack objects. There is no boost equivalent for C. So you would have to extern "C" all the functions you might want to use. That "slightly different syntax" is a large amount of work and not very memory safe.

  • @StupidusMaximusTheFirst
    @StupidusMaximusTheFirst Год назад +483

    You're obviously correct. You read C, you know what it does, C++ not so much. But that's the thing with OOP and higher level. That's the point. You don't really care to know how a tire is made. You just wanna use a tire to swap it for your flat tire in your car. In the same way, I don't wanna build a doubly linked list in C yet again, I'd rather just use something like a C++ std::list or whatever suits my problem.

    • @BigJMC
      @BigJMC Год назад +34

      Yeah but the issue arises when you’re doing more advance stuff or debugging with those types especially on such a low-level language you need to know exactly what it’s doing which can be really difficult with C++
      Edit: don’t worry guys, I was wrong. Decided to buy a C++ textbook and go back and study it a lot more in-depth. Ended up liking it a lot.

    • @StupidusMaximusTheFirst
      @StupidusMaximusTheFirst Год назад +116

      @@BigJMC if you're doing more advanced stuff, you'd wanna use libs others wrote, you don't wanna reinvent the wheel. You pretty much know what the structures you are using are doing. Most libs also have documentation. I wouldn't worry as much on debugging, most problems are likely gonna be in your code.

    • @joshnjoshgaming
      @joshnjoshgaming Год назад +2

      exactly

    • @alish2001
      @alish2001 Год назад +22

      @@BigJMC as giannis said then you'd wanna use battletested libraries not reinvent the wheel.

    • @BigJMC
      @BigJMC Год назад +11

      @@StupidusMaximusTheFirst I would but I’m writing a game engine that sits directly on top of the Vulkan library which means it’s very time sensitive, I need to make sure my buffering and render call’s aren’t being held up by another library or it’ll cause big fps drops.
      Plus I wouldn’t even know what the libraries are actually doing, they could be doing the most inefficient loop calls known to man and I would be loosing my mind for hours straight wondering why my code is running so slow.

  • @aliendroid8174
    @aliendroid8174 Год назад +36

    I like c++ because I can choose how much I want to abstract if at all. And once you get experienced with it, you know what's underneath the abstractions too and can think of it in both ways.

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад +6

      Yes. In general C++ is just a C (except constructs which are not compatible in C++ standard with C) with many OPTIONAL extensions. You can select what suits you the best.

    • @bgdgdgdf4488
      @bgdgdgdf4488 2 месяца назад +3

      ​@@PiotrPilinkoif you do solo projects. Which most people don't.

    • @PiotrPilinko
      @PiotrPilinko Месяц назад

      @@bgdgdgdf4488 Solo? 20+ devs, 1mln LOC are not a solo projects.

    • @nikolaikalashnikov4253
      @nikolaikalashnikov4253 13 дней назад

      C-lang can still do abstractions with function pointers.

    • @flori5296
      @flori5296 7 дней назад

      @@bgdgdgdf4488 if you don't work solo you also can't just choose what Language you use.

  • @ThePandaGuitar
    @ThePandaGuitar 9 месяцев назад +5

    c++ is like a continent full of countries. everybody uses a different language derived from a root language. you can kinda understand but not really

  • @nicholasfreitas8662
    @nicholasfreitas8662 Год назад +757

    never show this man python

    • @finalformluigi
      @finalformluigi 9 месяцев назад +112

      For real lmao. Python is the pinnacle of abstraction!

    • @julian_handpan
      @julian_handpan 9 месяцев назад +14

      @@finalformluigilol you don’t know ruby 😂

    • @finalformluigi
      @finalformluigi 9 месяцев назад +25

      @@julian_handpan you're correct; I did not know ruby, but I did a little speed reading and I feel like it's got a bit of that assembly flavor hidden in there so I'm gonna have to say its not zen enough for me 😜

    • @julian_handpan
      @julian_handpan 9 месяцев назад +3

      @@finalformluigi a lot of meta programming in ruby my friend!

    • @finalformluigi
      @finalformluigi 9 месяцев назад +8

      @@julian_handpan python has meta programming too. both languages are very similar; I was just poking some fun at Ruby's syntax.

  • @zonea4860
    @zonea4860 Год назад +498

    In my personal projects I generally just create cpp files but write mostly C code and occasionally use C++ features where I need them and where I see a clear benefit over C counterparts. That's also why I really LIKE C++. You (mostly) aren't forced to use C++ features. Theoretically if someone really wanted, they could write a program in C++ but only using C features without anything from C++. Also I think there are good uses for both C and C++. For example when I'm writing more low level stuff (like drivers, internal os stuff etc) I like to use C. But for example when I'm writing code for games or stuff with UI, I prefer C++ and the OOP aproach instead of functional. This is my personal opinion, but writing game stuff or UI stuff not in OOP is pain, and on the other hand writing low level stuff in OOP is pain too, so I think everything has it's own use cases

    • @mage3690
      @mage3690 Год назад +22

      My biggest complaint with trying to write C in C++ is the fact that MSVC doesn't comply to any _remotely_ modern C standard. So I do things that C should be able to do, and get hella frustrated as a noob because I downloaded Visual Studio because "internet said start with Visual Studio." But what you said is absolutely right, my problem is with the discrepancy between MSVC and RTFM.

    • @leggoentertainment2947
      @leggoentertainment2947 Год назад

      ​@@mage3690would vim solve this?

    • @vinylSummer
      @vinylSummer Год назад

      ​@@mage3690just use Linux

    • @Templarfreak
      @Templarfreak Год назад +2

      it's possible C existed long before the idea of a closure existed, im not completely sure, but if C just had closures then i think you wouldnt necessarily need to use C++ for game development because closures on its own can accomplish many of the same things that an OOP language can but that an OOP language needs multiple separate features for. its really odd that C seems to continue to not adopt the idea of closures because it's a feature that would fit in perfectly with C and that is basically a given in any other much more modern functional-centric language.

    • @mage3690
      @mage3690 Год назад

      @@Templarfreak what do you mean by a "closure"? Do you want a locally scoped variable inside a function to retain its value between function calls? That's the "static" keyword you're looking for. Do you want to call a function via dot operator? Let me introduce you to the wild and whacky world of 🌈 function pointers 🌈. It goes a little like this:
      struct mystruct {
      int a;
      void (*printvals) (struct mystruct);
      };
      void printvals(struct mystruct mystruct) {
      printf("d%", mystruct.a);
      }
      struct mystruct mystruct = {3, printvals};
      Then just call it by going "mystruct.printvals(mystruct);". It's a little annoying to type "mystruct" twice at the calling point, but I have not a singular clue how one would manage it without that. I'm pretty sure C just isn't that smart. Also, unless you use a constructor function (a macro would probably work best for that), that function pointer could point to any void with a single argument of type mystruct. Not sure how many of those you have lying around, but it's conceivable that that could screw things up.

  • @lukewatson8848
    @lukewatson8848 Год назад +1665

    "'Do you like C or asm more?' Dude, 100% like asm more, now this gonna probably come off as a skill issue, and it might, but, I don't like C because I think it abstracts away a lot of how the computer actually behaves. The reason why I like asm is because I can tell you exactly what every line of code is doing on the actual hardware."

    • @WoWUndad
      @WoWUndad Год назад +830

      Do u like asm or electrically charging each transistor 1 by 1 and poking the logic gates manually

    • @Omsip123
      @Omsip123 Год назад +10

      👍

    • @EmptyJarDoto
      @EmptyJarDoto Год назад +144

      Yeah that logic is so cringe.

    • @natescode
      @natescode Год назад +136

      ​@@EmptyJarDotocompletely sound actually. Have you used C++? It has every feature known to man.

    • @natescode
      @natescode Год назад +50

      ad absurdum.

  • @UteChewb
    @UteChewb 4 месяца назад +9

    Did a lot of C++ programming, and the first lesson I learned was that operator overloading is overrated and should be used *sparingly*. It just confuses things.

    • @kthegreat69420
      @kthegreat69420 28 дней назад +1

      I agree! I'll usually declare a namespace and define my functions that do some special operations in it rather than overload the operators. It's much more readable that way.

  • @joshnjoshgaming
    @joshnjoshgaming Год назад +41

    I don’t need to sort through my entire T shirt thread by thread to understand it’s an article of clothing

    • @joshnjoshgaming
      @joshnjoshgaming Год назад +11

      Abstractions are great for saving time and not reinventing the wheel every day. Everything has its costs, low level is great but not a one size fits all

  • @codelapiz
    @codelapiz Год назад +85

    you should try c#. in c# not only dont you know what the OS is doing, you dont know what the program is doing on any level. It may just randomly decide because of how you spelled a variable name that it is gonna create a SQL server, or provide an API endpoint with that name.

    • @NuevoVR
      @NuevoVR Год назад +5

      csharp is like lego

    • @guxershmeg
      @guxershmeg 10 месяцев назад +9

      C# code is way more easier to understand then C++.

    • @sporksto4372
      @sporksto4372 10 месяцев назад +7

      As a C# fan, this is so accurate.

    • @adialwaysup8184
      @adialwaysup8184 9 месяцев назад

      Can't mate. You need a language that compiles to machine code for low level or kernel programming. C# is like java in that sense. C/C++, Rust and Zig are a few that can do this. Yes, there are workarounds for some, like fortran. But at this point, if you're not going with Rust or Zig, you might as well stay with C/C++

    • @eyoo369
      @eyoo369 7 месяцев назад +1

      I love C# for web projects. From backends to frontend. It’s great for that.

  • @andrew_ray
    @andrew_ray 6 месяцев назад +22

    Operator overloading was a mistake.

    • @jpviscaino
      @jpviscaino 4 месяца назад +1

      @@andrew_ray nightmarish to say the least

    • @mikebond6328
      @mikebond6328 2 месяца назад

      Context

    • @rursus8354
      @rursus8354 Месяц назад +1

      Operator overloading is OK, it is just that using it for streams is a horrible idea. iostream is really badly designed.

    • @andrew_ray
      @andrew_ray Месяц назад

      @rursus8354 I would prefer something like typeclasses (unfortunately not to be confused with types or classes) that define operators and can be implemented by a class. Haskell takes this approach: in order to make use of + - * you have to be a Num; to use / you have to be a Fractional. That way, we know that someone's not going to run off and start using + for string concentration or / for set intersection or whatever. Of course, that also ties into Haskell's type system, which is completely different from C++'s.

  • @neerajn376
    @neerajn376 Год назад +11

    bruh he literally said skill issue, im dying LMAOO

  • @gerarddip
    @gerarddip 7 месяцев назад +11

    I legit had a nightmare yesterday that I was sitting at my desk in my dorm in a really bad incongruous outfit, typing “word.word.word.word.word” and trying to compile it and I’d get some errors, then I’d keep adding more “.word”s only for it to keep failing. I had a C++ nightmare.

  • @ZombiesWerePeopleToo
    @ZombiesWerePeopleToo 20 дней назад +2

    Even though I dropped out, a moment of my computer science course that permanently changed the path of my career is when we compiled a non-trivial C program by hand. Since then I’ve worked a lot on compilers, with low-level hot loop optimisation (including giving talks/workshops on working with the compiler to produce faster code), and on real-time signal-processing.

  • @lonelyshpee7873
    @lonelyshpee7873 Год назад +48

    C++ is what happens when you take a simple langauge like C, that is very close to the hardware, and add a bunch of features that allow you to abstract away from it... But coding in C often makes me wish I could use C++ features. So the solution would be to code in C++, but only use the C++ features you want. That's fine if you're the only programmer, but if you're in a team? You're opening the floodgates of incomprehensible code.

    • @KanashimiMusic
      @KanashimiMusic Год назад +9

      The problem is that we're at a point where not all C code is valid C++ code anymore, and I feel like at that point the language just fails at what its purpose was

    • @breadiusloafus5068
      @breadiusloafus5068 Год назад +3

      INTRUDER ALERT! A RED SPY IS IN THE BASE!

    • @cmxpotato
      @cmxpotato Год назад +3

      That's why you enforce linters and static analyzers in your cicd pipeline to make sure the team follows the standard. This shouldn't be too much of problem since you should always have that pipelined whether it's C++ or any other language.

    • @martijn3151
      @martijn3151 Год назад +2

      Just make sure you lay down programming rules in your team, and all will be fine.

    • @mynameisjeff9124
      @mynameisjeff9124 Год назад

      ⁠@soyel94
      int main() {
      char* xs = malloc(128);
      return 0;
      }
      This compiles in C but not C++, because you can’t simply concert pointer types without explicitly casting.

  • @Lord_zeel
    @Lord_zeel Год назад +33

    Abstraction is the name of the game though. In a well written program, you should be able to tell *what* is being done, but you don't need to know *how* for most of it. The less implementation you have to keep in your head, the more space you have for other ideas. Abstraction lifts the burden, and makes it much much easier to write incredibly complex programs without needing to understand every nuance of complexity all at once.

    • @PixLgams
      @PixLgams 5 месяцев назад +4

      You can achieve a lot of that with libraries, though.
      Python is actually a good case study here: If you listen to some of the developer's talks or read through their PEPs, you'll notice that in it's basic form, Python is not much more complex than C. Python's developers have added a lot of well thought out syntactic sugar to the language though upon which it's interpreter/JIT compiler can pick up (e.g. notice how Python's class methods always require you to give a "self" parameter while most other languages don't). That combined with it's vast standard library ranging from common data structures to full-on HTTP networking and multiprocessing however has made the language incredibly convenient to use, even if the base language is pretty weird compared to most others.
      If C had a standard libary as expansive as Python's, it would probably be a lot more popular. If you added Python's absurd amount of syntactic sugar to it... you'd basically get C++.

    • @dmitripogosian5084
      @dmitripogosian5084 3 месяца назад

      @@PixLgams And large chuck of python libraries are written in C

    • @KishoreG2396
      @KishoreG2396 Месяц назад

      @@nezbrun872 It could also be the opposite and make things more secure. If you are making a custom pointer type that does memory management with reference counting you can effectively eliminate memory leaks by abstracting away the internal implementation of when heap memory is deallocated, whereas it would be harder to do that in C
      Plus you can overload operators to make the custom type syntactically operate like a regular C pointer, so you can do something like *ptr instead of dereference(ptr) or ptr->obj instead of dereference(ptr).obj

  • @mintx1720
    @mintx1720 Год назад +14

    rust can also heap allocate with the minus sign lmao

  • @Dhekranh
    @Dhekranh 8 месяцев назад +3

    Dude, I learned C before even college, when it was still considered a “high level language”and is my favourite. I never managed to learn C++. College was the last time I was able to use it. Since the first job I got, it was Java, PHP, JSP, C#, Javascript. I got fired last year but can’t get a job anymore ‘cuz I wasn’t using Python, Node, Spring boot, Angular, or React at my last job. Now there’s so much abstraction it seems they just want people to feed programs to a damn language model rather than actually develop software. I’d rather deal with C++ abstraction at this point.

    • @BobrLovr
      @BobrLovr 2 месяца назад +1

      Brother, if your code structure is anything like your sentence structure... I can see why you were fired.

  • @muvoksismakings
    @muvoksismakings Год назад +48

    You would probably vomit while doing ruby. I dont have this issue with c/c++ but holy shit the amount of 'magic' ruby has going under the hood its disgusting.

    • @natnial1
      @natnial1 Год назад +48

      I don't see any problem with my code accidentally summoning demons

    • @qorso
      @qorso Год назад +3

      it pretty 😍

    • @Drummerx04
      @Drummerx04 Год назад +18

      Well, now we really are comparing apples to coca cola, aren't we?
      Ruby is just a prettier python to me. If i need a hardcore text processing program, ruby is my go to language because everything I need to do that is front and center in the language syntax.
      Example: I used ruby to generate custom C++ template libraries and DDS interface files from xml schemas.
      I could have built the tool in C++, but it likely would have taken several times longer to write and the only benefit would be saving 1 second of runtime processing every 4 months or so.

    • @RetroAndChill
      @RetroAndChill Год назад +10

      I mean isn’t that the point of a scripting language? It’s for doing high level processing where you don’t care about having direct control over the OS.

    • @zerberus1097
      @zerberus1097 Год назад +4

      Why would I care about instructions on the OS when wanting to parse a string lol

  • @nazzak2093
    @nazzak2093 4 месяца назад +2

    I started by learning and working on projects with assembly for embedded, which pushed me to understand the instructions set, CPU architecture, ALU, memory, …etc. Then I naturally moved to C for embedded, which I found it boring after 3 or 4 years. C hasn’t improved over years, the latest standards didn’t bring much, and I always had the feeling that I was limited in the possibilities and locked to a certain design and architecture. Then I got interested in C++ and its features, SOLID principles, design patterns …etc, libraries such as Qt, OpenCV. I then understood the power of the language. You can basically do anything, in the most efficient way. I’m still using it after 10years. Of course I also learned Java/C#/JS/Python but C++ is my preferred sword. The language is not for everyone, it is particularly difficult for those who started by high level languages with garbage collections etc. I think that the language will not die soon, it is still widely used in the video games industry, banking, medical, embedded, machine learning…etc.

  • @platin2148
    @platin2148 Год назад +183

    The worst thing is classes in 600 hundred different files which inherit methods from some parent / or abstract class that then is defined somewhere as virtual thingy somewhere else.

    • @AntonioZL
      @AntonioZL Год назад +19

      Jesus christ, I hate that. It makes everything so hard to follow.

    • @clementlebeau484
      @clementlebeau484 Год назад +13

      I feel like inheritance can be decently readable as far as there’s a UML class diagram to follow along with

    • @platin2148
      @platin2148 Год назад +18

      @@clementlebeau484 Which there is non 99% of the time + even the will not help to find which virtual interface is behind X can only give you possible options.

    • @Cd5ssmffan
      @Cd5ssmffan Год назад +7

      OOP is really basic why dont you take the time to learn abstraction and inheritance?

    • @platin2148
      @platin2148 Год назад +3

      @@Cd5ssmffan It‘s a tool but i never said that it’s difficult to use but it’s creating code that is easily viewable without having a full indexer + IDE in it is not possible to brain compile except for extremely basic things. The Argument you make that i don’t know it seems to be inferred by simply nothing.

  • @hallrules
    @hallrules Год назад +2

    I understand your point, because I have seen some C++ code before and sometimes it looks like a completely different language and I always need some kind of translator to see what's going on. But, if you write C++ code like C, you get to use all the new features of C++ without having to worry about installing a third-party library or straight up building it yourself.

  • @duckenjoyer13
    @duckenjoyer13 Год назад +5

    using a c++ compiler but pretending to write in c while reserving things like polymorphism, virtual functions and the standard library for when they are critical is my preferred approach.
    when working low-level like in graphics programming, oop and other random things ends up getting in my way later on.
    namespaces tho...

  • @outlawfps3948
    @outlawfps3948 Год назад +7

    Respectable answer. I am the exact opposite. I find C++ so comforting to read and I have a better time reading all of the little macros and overloads than when I code in C

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад +1

      I regret that C++ inherits macros (and plain includes) from C as this is a pure and evil cancer of a modern programming language.

    • @AetherStreamer
      @AetherStreamer 4 месяца назад

      @@PiotrPilinko You cannot say _C++_ and _cancer_ in the same phrase without also saying _templates._

    • @Keithfert490
      @Keithfert490 Месяц назад

      @@AetherStreamer templates are amazing and get way too much hate

  • @pedrolantyer
    @pedrolantyer 3 месяца назад +3

    C++ being hard to read isn't much of a problem if the code you are dealing with is well written and documented.
    If you are having a harder time reading other people's C++ code, it's very likely that the people who wrote the code aren't very good at their jobs.
    C++ adds a lot of things that make your life easier, while still being lower level than something like Python or Javascript.
    Also "I can tell you what every line is doing in the OS"? I'm sorry, are we going to act like compiler optimizations aren't a thing?
    Just like any other programming language, C++ serves as a tool. If it allows you to write code faster, while still having good enough performance, then there's no reason to complain.

  • @awesomedavid2012
    @awesomedavid2012 8 месяцев назад +2

    These languages like C++ have a context problem where you have to follow much more code to understand it. Languages like Go or C don't have this problem to the same extent because they limit their semantics a lot so that it becomes a lot clearer what is actually happening in any given place.

  • @mu11668B
    @mu11668B 8 месяцев назад +15

    I didn't know I wasn't alone.

  • @troglodytto
    @troglodytto 10 месяцев назад +2

    "the f**in minus sign can do heap allocations"
    Preach!!

  • @fr89k
    @fr89k Год назад +64

    I think it's highly overestimated how much a programmer knows about what's happening. Even if you write C code, there are still compiler optimizations and translations from CISC to RISC instructions in the processor. On top of that, you have several optimizations happening in hardware such as out-of-order execution, branch prediction, or register renaming. Imho, the programmer has less control over the things that are actually happening than many programmers like to believe. Nonetheless, it is good to have a basic understanding of the things that are happening, but the desire to always write code where you 100% understand what's happening leads nowhere - it only leads to code which the programmer feels like being super performant and optimized. However, we don't need code where the programmer has a good feeling about performance and optimization. We need code that is actually performant for real but still readable and debuggable.

    • @onionwarlock7407
      @onionwarlock7407 10 месяцев назад +6

      Can you say that in clash royale terms 😖

    • @mycelia_ow
      @mycelia_ow 10 месяцев назад

      SO what you're saying is, I should be writing stuff in assemble to truly understand everything going on?

    • @fr89k
      @fr89k 10 месяцев назад +4

      @@mycelia_ow Even if you do that, you still can't be 100% sure what the CPU will do with this at the end. Writing a few small programs in Assembly is really good idea to get a better grasp of the interaction between CPU, the OS, and your application. However, for productive use, I would recommend to avoid Assembly as much as possible.

    • @turnoff7572
      @turnoff7572 10 месяцев назад

      ​@@fr89kis there a way to do it then?

    • @fr89k
      @fr89k 10 месяцев назад

      @@turnoff7572 Of course. You can learn about CPU micro architectures and build your own CPU, emulated on FPGA. However, this really takes a significant amount of time and it's not worth it if you don't need to know the inner workings of a CPU. However, as a software developer you should always be aware that you probably know less about the things that are actually happening in the CPU than you like to believe.

  • @Machinely
    @Machinely 2 месяца назад +2

    The idea of higher level languages is to abstract all that detail away, and make it easier, safer and more efficient to write code.

  • @DaFrancc
    @DaFrancc 10 месяцев назад +3

    It all depends on what you're doing. I prefer C++ more for games or higher level stuff because C++ is a higher level language. If you're trying to do something lower level, then you should definitely use C. Now theoretically you could do everything in either language, but using one over the other for certain tasks brings a lot of benefits. A lot of times I find writing generic code in C to be super cumbersome since using generics requires you to manually keep track of types and to typecast everything. C++ just does it for you and it works great and all your code becomes very reusable

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      C++ can be the same level as C: if you don't use the feature, it has no impact on your code performance. But if you ever try to write a code with multiple potential failures it is much easier to do this with C++ and with exceptions than with C and error codes - specially if there are a lot of allocated resources when the failure occurs.

  • @Pepo..
    @Pepo.. 3 месяца назад +1

    At some point you'd have to get out of that shell, with code becoming more abstract it's just a matter of time, i understand your point and that's why i also want to learn low level.
    But at the point of wanting to know exactly how it works from the baremetal it's just overthinking...

  • @segueoyuri
    @segueoyuri 7 месяцев назад +3

    I have the exact same issue with C++. After years without touching C++ and only dealing with C I went to look and algorithm thinking I could just apply it to whatever I was doing and I couldn't. What the functions were doing weren't clear to me. I was def weirded out

  • @AkiiiMatcha
    @AkiiiMatcha Год назад +1

    I really feel you, I tried a lot of programming languages and when I had to decide whether I stick with C or C++, I instantly choose C just because as you mentioned in C++ sometimes it’s really hard to decipher the real purpose of a specific line of code. When you think you know C++, the language just kindly presents you the fact that you don’t know anything.

  • @Klosterhasi
    @Klosterhasi Год назад +283

    "c++ abstracts away a lot of how the language actually behaves" yeah. thats. the point. of higher level programming languages. If we know all 10 ways to use pointers, we dont need 1 Million people implementing the other 90 shitty ways on accident because they didnt spend 3 years coming up with already known best practices by themselves.

    • @m1000-n8w
      @m1000-n8w Год назад +60

      I hate C++! It makes everything so much simpler! Ahhhhh!

    • @ViolentFury1
      @ViolentFury1 Год назад

      ye except c++ implementations suck and when you do to have performance you will throw out c++ bullshit abstractions and use c

    • @BigBoss0112
      @BigBoss0112 Год назад +43

      extremely weird comment considering the entire point of the short is that he knows WHY c++ does these things but he just doesnt like it. i can tell 100% youre an ego coder

    • @arie1906
      @arie1906 Год назад +8

      ​@@BigBoss0112"ego coder" woah, new phrase to be stolen

    • @SeeMyDolphin
      @SeeMyDolphin Год назад +9

      But isn't the point that higher level languages usually come with additional features to compliment the abstraction, like memory safety/garbage collection, etc. and C++ doesn't?
      C++ reads like a high level language yet acts like a low level language, whereas C reads and acts like a low level language.

  • @crispybatman480
    @crispybatman480 6 месяцев назад +1

    You can do the same with C++, it is open source and so are most of the libraries...
    Your resoning is kinda deductive, where does it end? Assembly? Microcode? Designing the circuits yourself?

  • @rachit7645
    @rachit7645 Год назад +343

    Obligatory skill issue

    • @douwehuysmans5959
      @douwehuysmans5959 Год назад +29

      Oh god, the zoomers are starting to join the workforce

    • @wiczus6102
      @wiczus6102 Год назад

      @@douwehuysmans5959 Pretty sure milienials know what skill issue is.

    • @TheALPHA1550
      @TheALPHA1550 9 месяцев назад

      ​@douwehuysmans5959 it's much too soon ...

  • @BigCobra191
    @BigCobra191 3 месяца назад +1

    I started at C++ first and my god how learning other languages is so easy its not even funny. Doing C++ i feel like the codes and how I understand them just resonates with my brain and it automatically translates what I want into code. Then comes the other programming langauges like Haskell, J, JS, python, C#. It was really easy. C++ is the perfect language to start on and once you understand 80% of it sometimes its too hard but once you reach 80% then you can start learning other languages and see how fast you learn them

    • @bogdanlevi
      @bogdanlevi 2 месяца назад

      @@BigCobra191 there are very few people on this planet who understand 80% of C++.

  • @AxelStrem
    @AxelStrem Год назад +72

    and in C you'd have to call it "calculate_difference"... and it still can do heap allocations

    • @bies_moron4404
      @bies_moron4404 Год назад

      IT IS ACTUALLY - OPERATOR IN HIS CODE AND ALL ITS DOING IS SUBTRACT SIZEOF STRUCT FROM PAGE SIZE

    • @AxelStrem
      @AxelStrem 11 месяцев назад +5

      @@bies_moron4404 I guess my point was that in C you still have to call functions, and all this reasoning can be applied to function calls just as well: you can't tell what a function actually does just by looking at its name. Does this mean it's a dangerous abstraction? Can we even use functions if we want to "know what every line of code does exactly"? If someone writes a function that mines bitcoins and names it "calculate_factorial" is that really a language problem?

    • @KingBobXVI
      @KingBobXVI 8 месяцев назад +1

      @@AxelStrem - You're kind of missing the point though. A function doing a heap allocation doesn't apply to what he's talking about, because that function would be known to do a heap allocation - you know it's explicitly calling that function, whereas the minus operator is overloaded so at a glance, you don't know what function it's calling until you look up and get the types at that location and figure out which overload of the operator it's going to use. But if you explicitly use, say, "set_sub", you know just from the call-site that it's going to do a subtraction operation on a set, and that's going to necessarily return a new set which will have to be allocated.

    • @cd2320
      @cd2320 7 месяцев назад +1

      @@KingBobXVIand you would know that that particular overloading does a heap allocation. It’s a function like any other, it’s not rocket science.

  • @jefferymuter4659
    @jefferymuter4659 Год назад +1

    I graduated from a programming bootcamp and got a pretty jr job as a front end dev. It wasnt the dream job but it lets me get paid to look at code all day. And I have started to scrape some time together to work on side projects and learn some weird stuff now too. I want to understand the OS better and have a way deeped understanding of computers and the true fundamentals of how programming works in a way a 4 month bootcamp could never teach. Hopefully in a year or so i can get promoted to the job i want, or find something that checks all the boxes for me.

  • @emstallz1781
    @emstallz1781 Год назад +103

    I like operator overloading! For example to concatenate string you can use the + symbol, which is pretty intuitive. Also for file system paths you can use / operator to concatenate paths :)

    • @jacksonsmith2955
      @jacksonsmith2955 Год назад +45

      I think that works decently in high level languages like Python that are already super abstract, but in low level languages that kinda gives me the ick ngl. If I'm making a function call I wanna SEE that I'm making a function call.

    • @emstallz1781
      @emstallz1781 Год назад +17

      @@jacksonsmith2955 I understand, but I wouldn’t call C++ particularly ‘low level’. Yes, you have access to low level functions, but does this make the programming language ‘low level’? C++ is very versatile and the developer can choose if they want to program in abstracted layers of code, or just stick to the bare bones. You aren’t forced to use these operator overloading functions at all. But why program in C++ if you aren’t taking advantage of these features? Then yes, use C. Both have their own use cases and some overlap :)

    • @jacksonsmith2955
      @jacksonsmith2955 Год назад

      @@emstallz1781C++ better be low level if it wants to excuse that template syntax imo, doesn't have much else going for it

    • @sb_dunk
      @sb_dunk Год назад +5

      Something about this doesn't sit right with me, you've defined '/' on strings but not all strings are paths.
      I'm not saying it's wrong, and as long as you're comfortable with it then great, but I personally wouldn't do this.
      My comment also doesn't mean operator overloading is intrinsically bad either.

    • @emstallz1781
      @emstallz1781 Год назад +20

      @@sb_dunk I might be misunderstanding, but the overloaded ‘/‘ operator only works on file path objects in std::filesystem::path. You can (and that’s the beauty of it) use this operator to concatenate a string to a path object. The library takes care care of OS specific filesystem paths (posix, windows). I strongly recommend you to take a look (and tinker) at it to understand it better, and see how intuitive and easy it makes handling file paths :)

  • @thejackimonster9689
    @thejackimonster9689 7 месяцев назад +2

    100% agree. I personally like writing my own C++ code. But the moment you touch other peoples code, I definitely prefer C over C++ every time. The code is just much more readable even if it's more verbose.

  • @mobslicer1529
    @mobslicer1529 Год назад +4

    i usually prefer c but sometimes i write some damn fine c++ that feels pretty nice

  • @micahwelf
    @micahwelf 2 месяца назад +1

    I prefer Ada and assembly together. I *like* C++, but I must agree that the abstraction features are over used. I think the Ada community is just as significant to why I like the Ada language as the language itself. The same goes for C++ The issue is that if you don't drown yourself in C++ features, then some features can fix a few problems that C never got over.

  • @MrSlowestD16
    @MrSlowestD16 Год назад +25

    Eh, I [generally] prefer C as well, but this complaint is just b/c he's a new developer. When you get into large C code bases they become abstract as well - they have a whole book of utility functions in their util files to work with 'primitives' in their abstracted form. This is where the operator overloading he's complaining about really comes in handy, b/c now you can [for example] just add 2 complex numbers together with the + operator instead of calling a function passing both of them. It simplifies a lot of it.
    Also with the massive code bases, you wind up in function pointer hell, which has the same problem is abstracted class definitions in C++. You wind up with function pointers that get set to 1 of a dozen different functions at initialization so now you have no idea which one is being called unless you step through or printf all of them. Also, see opaque pointers, for how proper abstraction is done in C.
    If somebody is doing crazy things with operators, that's just bad design, you can do bad design in any language.
    When you're dealing with simple examples like in the window C may be better b/c you don't have to look at complex class definitions. But C for large code bases is equally as abstract. My main problem with C++ is more of a problem with OO in its entirety, and that's that people are afraid to not use it because it's considered a 'best practice'. So you wind up with these goofy fuckin ownership relations or friend classes b/c somebody's trying to over-design something simple.

    • @fr89k
      @fr89k Год назад +6

      I would argue that function overloading in C++ is more transparent than the function pointer hell in C. If you have a good IDE, it can help you navigate the inheritance tree. However, in C it would be very very difficult for the IDE to find all the positions where the function pointers are assigned, so you are left on your own to find all the potential candidate functions which might be called, when the function pointer is called.

    • @MrSlowestD16
      @MrSlowestD16 Год назад +2

      @@fr89k Yeah I'd agree they're generally more transparent. But as a slight devil's advocate, while function pointer assignments CAN be anywhere, they're generally all localized in terms of file structure, so you're generally not looking too deep. But yeah, not as explicit as in C++.
      Wish I knew what a "good IDE" is though when it comes to C/C++ parsing, haha. They're all pretty shit except for visual studio (OG, not VS Code) IMO. Never found one that could pick up on everything. Most IDE's don't account for even the majority of all basic setups in C++ (eg. inheritance), but even if one nails that down it can't account for linker externs and stuff so it'll never account for everything. That's one thing that's a real pain point for C/C++, IMO. But yea, VS was quite good with parsing. Wish they open sourced that instead of the VS Code shit we got.

    • @imrevadasz1086
      @imrevadasz1086 Год назад

      C99 actually has complex numbers as a native type, so you used a bad example there 😅. But I fully agree, the C++-style of object orientation makes people overcomplicate everything. But object-orientation isn't bad in general, for example languages like Smalltalk keep it very understandable and simple.
      My best C++ experience has been with the Qt GUI-framework, because it manages to abstract things well enough so you really don't have to care too much about the low-level behaviors.

    • @MrSlowestD16
      @MrSlowestD16 Год назад +3

      @@imrevadasz1086 That's fair, never seen a native complex # in the wild before. I don't think OO is bad, but I do think OO as a general concept leads to people overcomplicating things and that it's not necessarily C++ specific. There's too much stress on the possibility of extending or augmenting code that it makes people over-complicate it, like making and inheriting from some interface that will NEVER be inherited from after. We even see this at a more basic level outside of inheritance, like #defining "NUM_DAYS_IN_YEAR" as if that will change at some point. Another issue is just that not everything fits nicely into an "object". Sometimes a function just needs to be a function, and doesn't need to maintain any state. In that case, OO just becomes a burden - but nobody will ever say it b/c merely suggesting that OO can be a burden in real life is wildly unpopular.
      I too enjoy the inheritance hierarchy of QT. It is very well done. It's unfortunately a bit obvious when seeing some of it why it's not as performance oriented as something like GTK, but the trade-off is that it's a very intuitive framework to use. It's my go-to for GUI apps. Wish the licensing was a bit better, but it's really great. 2 thumbs up from me.

    • @imrevadasz1086
      @imrevadasz1086 Год назад

      @@MrSlowestD16 True, in too many cases objects are used where just a "module" (namespace in C++) would be enough. Part of the problem in C++ programming is that a lot of people come to C++ from Java, which only offers Classes for modularizing and namespacing code, and every bit of code has to be in a class. Hence a lot of C++ code is written in Java style.

  • @SalivatingSteve
    @SalivatingSteve 6 месяцев назад +1

    Agreed! I had to translate lines of C code into MIPS ASM in my hardware architecture class. C maps more directly to the low-level instructions. C++ tends to abstract away too much and the syntax can be weird. Personally I prefer coding in Java though.

  • @arakwar
    @arakwar Год назад +48

    So basically you prefer what you know. As most people does.

    • @natescode
      @natescode Год назад +4

      No, he prefers sanity. Do you even code ? 😂

    • @dumdum7099
      @dumdum7099 10 месяцев назад +4

      Listening comprehension zero. You.

  • @xt3rm1nat0r8
    @xt3rm1nat0r8 8 месяцев назад +1

    Exactly why I like C. Another reason is coz I learnt C first, and data structures algorithms, operating systems, networking and all in C language. So everything else feels like vague. I feel uncomfortable when I don't know what the function is gonna do exactly for any change I make.

  • @suoyidl2654
    @suoyidl2654 7 месяцев назад +10

    Everytime i hear someone say C is better then C++, i want to see a project where they don't use C++.

    • @amuldoodh556
      @amuldoodh556 6 месяцев назад

      @@suoyidl2654 the linux kernel ain't enough?

    • @desplmfao
      @desplmfao 5 месяцев назад +1

      linux kernel source code

    • @haricharan9852
      @haricharan9852 5 месяцев назад

      Can projects made using C along with the Raylib library be considered a C-based project?

    • @amuldoodh556
      @amuldoodh556 4 месяца назад

      @@suoyidl2654 I did

  • @paulbronowski6875
    @paulbronowski6875 10 месяцев назад +1

    You don't really know exactly what every line of code is doing without disassembling. All modern compilers have varying degrees of voodoo, depending on platform/processor, options, your code, etc. This is orthogonal to the complexity/abstractions in the C++ ecosystem and common to most modern compilers. But, I understand your sentiment and frustration with overly-complex C++. Throw the C preprocessor in the works and both languages are very messy. A fact that influenced why they neutered the C# preprocessor.

  • @BeeboHamido
    @BeeboHamido 11 месяцев назад +102

    I don’t like assembly either. I like to exactly know what bits are getting executed in the machine.

    • @monkeibusiness
      @monkeibusiness 9 месяцев назад +44

      I dont really like machine code either. I like to know where my electrons are, I need to see what my electromechanical transistors are doing!

    • @borisletic
      @borisletic 8 месяцев назад +18

      ​@artemis4771atoms are too abstract...I like elementary particles more...

    • @johnver9245
      @johnver9245 7 месяцев назад +22

      You guys are pathetic, when I code I wanna know exactly what quarks and leptons are doing. It's fundamental to know about them if you wanna keep track of your protons, neutrons and electrons.. 😂

    • @michaelburggraf2822
      @michaelburggraf2822 6 месяцев назад +3

      I love watching the wave functions.

    • @fugyamom
      @fugyamom 5 месяцев назад

      That's what the rip register on x86 asm is for you dingleberry

  • @jamesjamey8596
    @jamesjamey8596 7 месяцев назад +1

    Yess! C is quite readable and understandable. But Cpp has so many variants and features that each project is effectively written in it's own language. At least thats how I feel about it.

  • @TheRealJman87
    @TheRealJman87 Год назад +12

    C++ is great **IF** you (and the code you are working with) stick to the standard and follow best practices for modern C++ (i.e. C++11 onward). Pre-C++11 was a nightmare and people who still code like that should just stop plz

    • @marcossidoruk8033
      @marcossidoruk8033 Год назад

      Modern C++ makes me want to vomit.

    • @sinom
      @sinom Год назад +5

      You're probably not gonna convince people who love c with this. The reason a lot of people who like c trash about c++11 onwards is because that's when it started doing a lot of things differently than just c. Pre c++11 code often feels bad to c++ devs because it feels like c code with classes added on top

    • @Jol_CodeWizard
      @Jol_CodeWizard Год назад

      Modern C++ is pure crap.

    • @fr89k
      @fr89k Год назад

      @@sinom One of the biggest C++11 features to me are smart pointers. Before C++11 you had a huge problem with keeping track of the ownership of objects. Even if you dislike shared_ptr because it does one additional redirect and you don't have 100% control over the destruction of the object, you have to agree that unique_ptr is awesome. Your method doesn't take ownership? Fine, you can still use raw pointers in the method arguments. Your method takes ownership? Use unique_ptr in the arguments and move the unique_ptr in from the caller. It's perfect to track ownership.

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      @@fr89k C++11 has big issue with smart pointers. C++14 is much better with this case (but not perfect) but it break the compatibility - on the other side: it's not a big problem. Some features are also introduced with C++17 and C++20. But C++14 is usable.

  • @threewheeler7
    @threewheeler7 3 месяца назад

    100%. Plus every time I am looking at a new c++ project I have to look at multiple classes just to have a clue what is going on.

  • @FyberOptyk
    @FyberOptyk Год назад +12

    I wonder if this guy would have a stroke if asked about C#?

    • @Phantom-lr6cs
      @Phantom-lr6cs 9 месяцев назад

      c# is easier than c++ and c . so what a stroke ? idk

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      @@Phantom-lr6cs C# is DIFFERENT. Not really easier than C, as it has a lot of features which are not present neither in C nor C++.

    • @Michael-mr3ig
      @Michael-mr3ig 5 месяцев назад

      C# is the best language I have ever used when it comes to productivity and actual enterprise level code. The code just comes out super clean and easy to understand. Performance is excellent too.

    • @BobrLovr
      @BobrLovr 2 месяца назад

      This dude has a "stroke" every time someone mentions C

    • @BobrLovr
      @BobrLovr 2 месяца назад

      @@Michael-mr3ig not for game dev, for game dev the GC is a nightmare on performance. You end up having to use compute shaders and other tricks for performance half the time

  • @sherwinbangs
    @sherwinbangs 7 месяцев назад +1

    That's the beauty of cpp as well! Do whatever you want. If someone's code is unreadable it's not a language fault

    • @Mr-Sinister
      @Mr-Sinister 2 месяца назад

      it's not a language's fault, it's a segmentation fault.

  • @renato360a
    @renato360a Год назад +29

    these C lovers really hate operator overloading.. But that is the feature that I like the most about C++ and that sets it apart in freedom for creativity. Of course there's a very limited use case for it, but it is extremely helpful in my area, computational mathematics.

    • @K3rhos
      @K3rhos 6 месяцев назад +4

      Yeah as a C++ dev I also didn't understand his point about operators overloading lol
      C++ to me is freedom, I can code really low level or really high level by building from the ground up and having a lot of features safety like smart pointers etc...
      When C is just stuck as a low level language, make it pretty much useless in most modern use cases tbh (I would rather use Python) bcs if I do some UI frontend for example I will use C++ and if I need stuff like memcpy, memset, reinterpret_cast, sizeof and a lot of diverse low level stuff I will still use C++ because I can do both:
      Low and High level at the same time, having the best of both world !

    • @ThatJay283
      @ThatJay283 6 месяцев назад +2

      yeah. i think its really neat how in c++ i can make a vec struct template that overloads a bunch of math operators, so i can do math on them how i would with base number types. the alternative (explicitly calling functions for everything) would be much more verbose.

  • @SloppyPuppy
    @SloppyPuppy 9 месяцев назад +1

    Exactly, STL has way too much abstractiom that you cant even begin to imagine whats happening under the hood, and Im really having trouble forcing myself to memorize the custom syntax for those layers of abstraction. I really gotta buckle down and learn it, so I can stop bothering with it, I dont ever write rust, but I know I should.

  • @seanhollibaugh3776
    @seanhollibaugh3776 Год назад +10

    Hard agree, c++ is difficult to read, i hate having to constantly pull up manual pages

    • @martinprochazka3714
      @martinprochazka3714 Год назад

      If you find C++ hard to read it's your colleagues who are to blame. You could write stinky unreadable code in any language if you really wanted to.
      And yes, C++ is difficult, that's why not everyone should be using it. It's not like you go design nuclear reactors after taking your physics introductory course, why is everyone thinking they can get away with it in CS? If you suck at programming just do Python and be happy its not like it pays less than C++ 🤷

    • @cd2320
      @cd2320 7 месяцев назад +2

      Lol and you don’t have to do that with C? Have you never dealt with Linux code? Or any library or API whatsoever?

    • @BobrLovr
      @BobrLovr 2 месяца назад

      @@cd2320 excuse me, why would he need libraries for all of his "hello world" variations

  • @ILLUMINATED-1
    @ILLUMINATED-1 2 месяца назад +1

    You kind of need a fully featured modern ide with autocomplete and display over hover to really use C++, it sounds like, then.
    Which is precisely why it’s fallen face flat on linux. No such thing. CLion is close, but realistically C++ is most used on OSes with these sorts of editors, e.x. VS, VSCode, Xcode. vsc is on linux now so it could be languages that can only be rapidly used with the use of tools may expand. My theory anyway.
    Using C++ in anything but visual studio for me is a nightmare.

  • @MrDaAsif
    @MrDaAsif Год назад +10

    I like C++ but I'm pretty judicious in my use. Operator overloading is really nice if you're dealing with mathematical types e.g. arbitrary precision numbers

    • @RetroAndChill
      @RetroAndChill Год назад

      For me the only operators I typically overload are = and ==.

    • @MrDaAsif
      @MrDaAsif Год назад +3

      @@RetroAndChill I really don't like a lot of operator overloading I've seen for =. Part of what makes someone used to C have a hard time understanding what's happening in code

    • @ic6406
      @ic6406 Год назад +2

      @@RetroAndChilloverloaded = operator is evil, I don’t see any reasons to use it

    • @RetroAndChill
      @RetroAndChill Год назад

      @@ic6406 Move semantics is a good reason to

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад +1

      @@ic6406 If your class has a shared pointer (or even - god save us - a plain pointer) it is very unwise to use default implementation of an assignment operator - very unwise... Unless you want to keep the member object shared between all of the object of the class. So always check your class semantics.

  • @matteoroccomico
    @matteoroccomico 4 месяца назад +1

    i think c++ is better just because you can put c and asm code inside .cpp code, so you can entirely create a code in c and use c++ just when necessary without creating 2 different codes to link

  • @afj810
    @afj810 10 месяцев назад +6

    At that point just use assembly then

    • @BobrLovr
      @BobrLovr 2 месяца назад

      what a beginner dev thing to say

    • @afj810
      @afj810 2 месяца назад

      @BobrLovr what is sufficiently low for you? All thresholds on this matter are arbitrary.

  • @TurdFergusson374
    @TurdFergusson374 4 месяца назад

    I think one thing that really smacks c++ developers when they first do c++ is the implicit casting. People think string literals get implicitly casted to string in all scenarios, but that is not the case if there is boolean override. The ADL converts const char ptrs to bool and then some developers spend hours trying to figure out what is going.

  • @wattihrvolt-pn3pf
    @wattihrvolt-pn3pf Год назад +7

    im gonna wait for him to learn about languages with implicit type conversion

  • @roberteltze4850
    @roberteltze4850 Год назад +1

    When i first read about operator overloading i thought it was great. I immediately thought of things like a complex number library where it makes perfect sense to overload your basic math operations. Then my roommate started to describe some of the horror stories he'd seen where the overloaded operations don't make sense or are counter intuitive.
    I still think it has a place but programmers really need to make an effort to only use it when it makes sense.

  • @carl_84
    @carl_84 Год назад +19

    I don't like C++ because in some scenarios different compilers or different language versions behave differently. To me, C++ seems like a language that was patched way too many times while trying to have backwards compatibility.
    Then you add on top libraries like Boost and QT that add another level of complexity.
    Seems like there's no real standard library, even for basic types like a string, there are way too many types. Like QString, std::string, char *, wchar_t *, etc, etc, etc. it's really annoying on a large code base.

    • @__Brandon__
      @__Brandon__ Год назад +5

      std::string

    • @mage3690
      @mage3690 Год назад +6

      I mean, C does that too to a much smaller degree, but I agree. The "different compilers do different things" is 99% "MSVC is doing it's own thing again and everyone else is following the C standard and building C++ on top of it as the standard intended." ISTG, MSVC supports 0% of the C changes after C89 or so.

    • @sinom
      @sinom Год назад

      ​@@__Brandon__std::string_view

    • @captainfordo1
      @captainfordo1 Год назад

      struct String
      {
      char *str;
      u64 len;
      }

    • @zhulikkulik
      @zhulikkulik Год назад +4

      Char* and wchar_t* are classic C strings.
      Wchar is 2 byte Unicode or something like that.
      There's also std::wstring if you need Unicode.

  • @izimsi
    @izimsi 7 месяцев назад +1

    also in C there is usually one or two ways or doing something, in C++ there's a hundred and the hardcore OOP fans will only accept one.
    I was just dumped into a C++ project with only C experience and I'm literally writing the same amount of logic 10x slower and its still not enough

  • @matthewrichardson4435
    @matthewrichardson4435 Год назад +5

    I think C++ is as readable as C. Everything which you can't read and know what's happening on the OS is just some form of a function call just like with C. You just have to bear in mind that you can call "functions" in more ways than just func(). For example: operator overloading
    In C++ (t1 + t2) should be read as add(t1, t2) in C where add is some user defined function (unless t1 and t2 are primatives).
    Complexity is not necessarily harder to read or understand it just means you need to look at the internals of those structures to find out what the programmer is doing, which lends itself to useful abstractions.

    • @fdc4810
      @fdc4810 Год назад +1

      Things get difficult quickly when you have lvalue, rvalue, pvalue, xvalue, gvalue and all the templates adding to the syntax. It is a language that’s difficult to read, understand and program(in certain styles). While in C, whatever you do you know if it is for the compiler or run time or just some macros you define, and you know what the computer is doing in memory.

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      @@fdc4810 It's about good practices and a knowledge of a team members. Always. I've seen a lot of very obfuscated code in C (because C allows to do many nasty things). This is a place for a code guard and peer reviews.

  • @philoldout7489
    @philoldout7489 9 месяцев назад +1

    You can use C++ just as a better C if you like. Have to be careful not to pull in too much overhead though. Typically applications where C is the best choice want to be lean. In the end, just choose the best tool for the job at hand.

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      Yes. As you do not pay ANY price for not used c++ features you can use it as a better C - even on microcontrollers (of course 95% features would not be available nor reasonable, but at least you get a lot of type safety forced by a compiler).

  • @homematvej
    @homematvej Год назад +11

    Yeah it's a skill issue.
    I can spend hours looking how a new structure compiles and behaves before I start using it.
    You just not supposed to use in c++ something you don't understand how it compiles and works.

    • @JNelson_
      @JNelson_ Год назад +1

      Sometimes you are in a codebase too big to understand before you start debugging, or it's infeasible, the last place I worked just the section of code my team handled was 8 million lines of C and C++

    • @wiczus6102
      @wiczus6102 Год назад +1

      Have fun working on a large project with a huge code-base then. Have fun having to understand the whole code base before you make a change.
      You seem like a guy who's only ever worked on his unreal demo project.
      If a collegue gives you a hammer and it turns out to be a screwdriver you're going to waste so much time for nothing. And that time costs money for the company.

    • @homematvej
      @homematvej Год назад

      @@wiczus6102 I always understand the whole system before making changes no matter how big the codebase is, it's never more than 3 days. If your team is unable to make the right abstractions it's a skill issue. And it will result in bug fixing taking more than 5% of your teams time.

    • @Dremth
      @Dremth Год назад +3

      He can tell you what each line does, but he'll have to stare at the code for an extra 6 hours to figure out what the program itself is doing.

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      @@wiczus6102 And in this case C++ may be a great tool for responsible developers. I've spent a lot of time rescuing big and "doomed" projects by introducing correct design patterns (which took time but in the long run it gave a lot of benefits to the company).

  • @Dominexis
    @Dominexis 7 месяцев назад +1

    I really like operator overloading though. In fact, that's just about the only unique part of C++ that I use. If I have a struct for a vector, I would much rather do vectorA + vectorB than something ugly like addVectors(vectorA, vectorB).

  • @anassqadil1376
    @anassqadil1376 Год назад +17

    skill issue :/

  • @q2yogurt
    @q2yogurt 2 месяца назад +1

    As someone who writes C++ comercially... yeah I guess I agree

  • @WillD-jj9kg
    @WillD-jj9kg Год назад +6

    I just write straight to the transformer with a pin

    • @Isawadigitalferrari
      @Isawadigitalferrari Год назад +1

      Yup. I manually drag the electrons through the circuitry of the board to run all my programs.

  • @braedonwatkins967
    @braedonwatkins967 9 месяцев назад +1

    that's how i feel about a lot of more abstracted languages (i.e. python, JS) bc i can only reason about the abstractions. i can't make sense of what's really happening with the code i write.

  • @scottlivezey9479
    @scottlivezey9479 7 месяцев назад +3

    When I was involved with software development full-time, I never made the leap from C to C++. My main issue with the whole concept of C++ stemmed from its lack of efficiency. This commentary over 25 years later is music to my ears. 😊

    • @mightymalakai
      @mightymalakai 6 месяцев назад +2

      C++ is very efficient

    • @scottlivezey9479
      @scottlivezey9479 6 месяцев назад +1

      @@mightymalakai hmmm, then which operating systems have moved onto a C++ foundation from C? You can claim potential development efficiency gains. I’m referring to runtime performance.

    • @kazoud290
      @kazoud290 3 месяца назад +1

      @scottlivezey9479
      Not every OS is Linux. Operating systems now incorporate C++ in their code.
      I'm sorry but your bit about runtime performance is doubtful as best, to avoid saying plain wrong. The motto of c++ is 0 overhead abstraction. ​You can watch quality tutorials or presentations from cppcon to get an idea of the philosophy behind c++ and how to write quality c++ code. I invite you to watch the presentation of Jason Turner in the 2016 edition of cppcon where he demonstrates to you live how added abstractions and clarity in the code will not affect the generated assembly.

  • @sharpfang
    @sharpfang Год назад +1

    C++ has its advantages. Use a bignum library with C, a = (a+1)%max; becomes bignum_add(tmp,a,1); bignum_divmod(tmp2, tmp1, max); bignum_copy(a, tmp2.modulo); I can write constructors for my structs. I can namespace my globals. I can use json without wanting to kill myself.

  • @williamandre2984
    @williamandre2984 Год назад +50

    This is the own dck sucking issue.
    99.9% of programmers don't need to know exactly how/where the memory is allocated. Otherwise go for assembly if you just want to show off.
    A higher level of abstraction allows the code to be understandable, and you can still look at the implementation of the language/compiler/whatever if you really need to.

    • @Obscurite1221
      @Obscurite1221 Год назад +16

      @@Xevion You will never need to know what the operating system is doing unless you're working on optimization or drivers/onboard software.

    • @marcs9451
      @marcs9451 Год назад +2

      you sound like you never worked on an embedded system, game or any performant software. Being able to know the flow of resource allocation does **not** reduce expressiveness. Using custom allocators you get a lot of control and a lot of convenience, C and C++ were poorly designed by having one global allocator and no defer keyword and EVEN THEN you can still reap the benefits of using one.

    • @dubvascl5840
      @dubvascl5840 Год назад

      ​@@marcs9451ah yes, that only one allocator in C called operating system

    • @OverruledDood
      @OverruledDood Год назад +5

      ​@@Obscurite1221 this mentality of "developers don't need to do things because it's done for them" is so lazy, why are we trying to foster an environment of developers that don't know what they're doing?

    • @Obscurite1221
      @Obscurite1221 Год назад +7

      @@OverruledDood Are you a developer? Or are you yet another person who has no actual idea what they're opinionating on and just spew out words?

  • @briannoel7398
    @briannoel7398 3 месяца назад

    I use c++, but only for the constructors/destructors/assignment because it's useful for handling resources acquisition. I only ever overload operators when it *really* makes sense and doing it some other way makes it harder to follow.

  • @emmafountain2059
    @emmafountain2059 Год назад +11

    C for low-level control, python for high-level abstraction. In my (admittedly limited) experience c++ tries to give both low-level control and high-level abstraction which leads to messy code that spans too many levels of abstraction at once

    • @martijn3151
      @martijn3151 Год назад +4

      You have just as much low level control in C++ as you’d have in C. C++ can be messy, sure. But so can C be. Just enforce coding standards in your team and you’ll be fine.

    • @egg-mv7ef
      @egg-mv7ef Год назад +5

      i can see your experience is limited cause youre yapping absolute bs. c++ gives you a high level of low level control and good mid-level (wouldnt call it high level at all) abstraction. understand how simple continuous and non continuous memory works and suddenly understanding how a vector works isnt such a big deal

    • @mynameisjeff9124
      @mynameisjeff9124 Год назад

      Python is one of the shittiest languages out there

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      @@martijn3151 "Just enforce coding standards"
      YES. This is the correct way of handling mess in teams.

  • @r0yce
    @r0yce 5 месяцев назад +1

    The problem with people who defend C++ often doesn't use C++ at all. They just write procedural C++ like it's C with classes and vectors. If they actually start using advanced C++ features theyd understand how error prone that code is. Now it is definitely a skill issue for me but I'd rather write simple code than debug hours of complicated code

    • @onlinealias622
      @onlinealias622 2 месяца назад

      Complicated projects in C inevitably end up having horrible, hard to read stuff in them though. Every legacy C codebase I’ve worked with has some crazy macro shit to do things that normally come working out of the box in C++, and they inevitably implement their own string library to make string handling easier and do a bunch of other redundant stuff. C can be nice for smaller projects but large C codebases can be really rough.

  • @____uncompetative
    @____uncompetative Год назад +6

    C++ has the worst syntax of any language not deliberately designed that way as a joke.
    Rust has the worst semantics of any language not deliberately designed that way as a joke.

  • @anshumankhanna8296
    @anshumankhanna8296 3 дня назад

    Loved overloading as a beginner but like the same can be done with a function which will make it clear what is happening, compared to overloading

  • @haubro18
    @haubro18 Год назад +4

    Language readability is only one aspect of several factors you should consider when choosing a language.

    • @homelessrobot
      @homelessrobot Год назад +3

      yes, but it is a pretty important one.

  • @hansdampf2284
    @hansdampf2284 Год назад +1

    I also like C more.
    Modern C++ is just a totally different approach of a language than C.
    C++ is solving things by adding new stuff to the language. C is solving things in code.
    I like C’s approach more because it makes the language itself very lean. This is good because it gives us all a common ground. This helps tremendously when maintaining packages and patching old software or making PRs.

  • @elementkingaming1947
    @elementkingaming1947 Год назад +10

    His c++ problems sound more like a skill issue. Like if the first learnt c++ instead of c, he would be saying the exact same thing but about c

    • @kensclark
      @kensclark 11 месяцев назад +3

      Nah. I've used C++ for a long time and just started using C. I like C a lot better. Sure, I miss some C++ features, but C makes much more sense to me.

    • @PiotrPilinko
      @PiotrPilinko 8 месяцев назад

      I've learned 6502 and x86 and C before c++ (and after that ada95, java, c#, python and many more) and when I have a choice C vs C++ I ALWAYS choose C++ (even on microcontrollers). It's simple: even if I don't need (or cannot use) specific c++ feature I got it's type safety (well, maybe it's not perfect but it at least exists).

  • @user-vs7cw2rg7r
    @user-vs7cw2rg7r 7 месяцев назад +1

    100%. I won't write c++ unless I absolutely have to and even then I use the bare minimum of features.

  • @nroos2043
    @nroos2043 Год назад +16

    i thought he was talking ab bra size

    • @JS-mg8no
      @JS-mg8no Год назад +9

      This man knows nothing of the sorts

    • @gabrielbarrantes6946
      @gabrielbarrantes6946 Год назад +2

      Even A can be pretty nice, you could think GGs are good but they are way too impractical!

  • @honkhonkler7732
    @honkhonkler7732 9 месяцев назад +1

    I see the value in object oriented programming but my brain just has a much easier time wrapping itself around procedural code.

  • @po1sonseede9001
    @po1sonseede9001 Год назад +7

    No offense but this is probably your worst take.

    • @ker0356
      @ker0356 8 месяцев назад

      A man can't prefer one language because it has less abstractions than the other? I don't get why this discussion is so controversial

    • @BobrLovr
      @BobrLovr 2 месяца назад

      jr. dev ah comment

  • @gwentarinokripperinolkjdsf683
    @gwentarinokripperinolkjdsf683 9 месяцев назад +2

    I do kinda wish that C would at least have some built in types like matrix and vectors and have some operators specifically for those, but other than that yeah