Is C++ better than C?

Sdílet
Vložit
  • čas přidán 13. 05. 2024
  • Streamed Live on Twitch: / tsoding
    Enable CC for Twitch Chat
    Panim Playlist: • Panim
    Support:
    - BTC: bc1qj820dmeazpeq5pjn89mlh9lhws7ghs9v34x9v9
    - Pay for my VPS: zap-hosting.com/en/shop/donat...
  • Věda a technologie

Komentáře • 265

  • @AlessandroStamatto
    @AlessandroStamatto Před 14 dny +86

    1:44:30 "No, C++ was not better than C for this project."

    • @skeleton_craftGaming
      @skeleton_craftGaming Před 14 dny +7

      he implemented oop..

    • @bofa-zi4fj
      @bofa-zi4fj Před 14 dny +3

      @@skeleton_craftGamingjust because another language comes with one specific functionality does not automatically make it better for the project.

    • @rusi6219
      @rusi6219 Před 14 dny

      @@bofa-zi4fj yeah, also most learning resources for C++ present OOP as the default so that's what people typically end up implementing whether they intend to or not.

    • @skeleton_craftGaming
      @skeleton_craftGaming Před 14 dny

      @@bofa-zi4fj I agree . But When the other language split from The language that you're using specifically for a feature that you were required to implement (for your algorithm to not crash) then it might [I wouldn't say that it necessarily does but it might; and it does in this case (Because C++ is objectively better language [as unpopular as that may be)]

    • @mattshu
      @mattshu Před 13 dny

      @@skeleton_craftGaming ]*

  • @DogeOfWar
    @DogeOfWar Před 14 dny +66

    If you used the C-style "virtual" functions where they are beneficial and use C++ specific stuff where it's beneficial then you are still writing C++, the best C++ devs know when to use certain features and when to fall back on "raw-dogging" it. that is a strength of the language imo

    • @chepossofare
      @chepossofare Před 14 dny

      That's exactly why C++ is a disgrace.

    • @rogo7330
      @rogo7330 Před 13 dny +5

      So, strength of the language is that it compiles to the ELF file?

  • @stolenlaptop
    @stolenlaptop Před 14 dny +135

    "C sucks... But a little less than everything else"... Some random Internet guy.

    • @cobbcoding
      @cobbcoding Před 14 dny +19

      C is the worst programming language except for every other programming language.

    • @SimGunther
      @SimGunther Před 14 dny +4

      @@cobbcoding Which is why C is a lingua franca and making a transpiler that generates C++ code is a futile effort. Ask Andreas Kling and what happened with Jakt.

    • @blastygamez
      @blastygamez Před 14 dny +10

      C is the best programming language.

    • @valizeth4073
      @valizeth4073 Před 14 dny +4

      Except that isn't true at all, 60 years of language development and it's practically unchanged. C23 is praised to the heavens and they added roughly 5 valuable additions.

    • @rusi6219
      @rusi6219 Před 14 dny

      @@valizeth4073 precisely; it's not bloated to hell like C++ is.

  • @froop2393
    @froop2393 Před 14 dny +22

    Sorry to say that your videos aren't recreational at all...
    They are highly educational and I learn a lot from them.
    Thank you so much!

  • @user-do4fm1nz2f
    @user-do4fm1nz2f Před 14 dny +11

    There is an useful technique called CRTP - static polymorphism. It allows you to write compact OOP code and doesn't raise problem with func pointers invalidation.

  • @Eugensson
    @Eugensson Před 14 dny +41

    ... you can find the answer to this and other questions in our new issue of “NO!”. Coming in June.

  • @exosdel
    @exosdel Před 14 dny +3

    Love ur vids on C, keep them comming!

  • @maxpoulin64
    @maxpoulin64 Před 14 dny +2

    I think the proper solution for the state preservation would be a custom allocator that keeps tracks of allocations like React hooks work: when reloading, the allocator just hands back out the same allocations in the same order so your state is preserved. Then you also get to detect when the data layout changes and force a full reload if the number of allocations change or the requested size changes. It still would break the objects though, so you'd also need to only do that for the state and have a separate struct just for state so you don't overwrite the vtable pointer.
    Fundamentally hot reloading native code without breaking pointers is hard.

  • @saidwho9891
    @saidwho9891 Před 12 dny +6

    1:01:00 Lol, we can already tell that C++ is worst than C, cause you're already starting to ask yourself "should I make this public or protected", and fall in the C++ dilhemma of philosophizing about objects 😂

  • @Rose-ec6he
    @Rose-ec6he Před 14 dny +1

    You missed out linking the source in the description today, i dont know if that was intentional or not. I personally find it extremely valuable, i have learnt so much from being able to follow along with your process by video and consulting your source when I mess up any details or want a rough idea of conventions to follow. Obviously, I don't expect this of you but if this was a slip-up, here's your opportunity to fix it.
    Anyway, love your content. Thanks again

  • @GoldoEb
    @GoldoEb Před 14 dny +2

    1:26:00 BTW, you can also specify the name of the "X" macro.
    Just use the macro parameters like in the following example.
    #define LIST(handler_) \
    handler_(banana) \
    handler_(apple) \
    handler_(cherry)
    And now you can have multiple different X-macros (handlers) and each of them will be defined.

    • @hedlund
      @hedlund Před 14 dny

      Ooh, never came across that before. Cheers!

    • @saidwho9891
      @saidwho9891 Před 12 dny

      Yes, this is less known but you can pass the second macro name as an argument, just not sure if this is 100% standard

  • @MrMeltdown
    @MrMeltdown Před 7 dny +2

    29:42 I spent many hours in a pub reading through the C++ books understanding this... that along with move constructors etc.... Then you embed that lot in some Templates and you have entered a new layer of &&& ... hell.
    People have a problem with perl... It is no where near that bad. Tbh.

  • @Cmanorange
    @Cmanorange Před 14 dny +7

    26:10 raysan appreciation post

  • @hedlund
    @hedlund Před 14 dny

    @35:00 (-ish): Have you done any streams or vods on Rust/C interop specifically? If not I'd love to see it, at some point :)
    Edit: Also, wasn't Soursoup head of programming research at Bell Labs for a long-ass time?

  • @TheJanhalsema1
    @TheJanhalsema1 Před 14 dny +7

    Depending on your definition of better, arguably, C++ is always better. You can just use it as C and only add the bits you like e.g. constexpr / templates / operator overloading and such. In recent years C++ even got the long standing missing bits from C like named struct initalization.

    • @meme-vw1vi
      @meme-vw1vi Před 13 dny +1

      i agree

    • @StevenMartinGuitar
      @StevenMartinGuitar Před 13 dny +2

      Was going to make the same point, you can 'pretty much' always use C++ and if you feel like only using C you just type it and it works. Besides people only get stuck with the messiness and complexity of C++ because they chose to use those features of C++ to begin with. You can just choose not to use them and go about it the C way instead.

    • @TurtleKwitty
      @TurtleKwitty Před 13 dny

      Same order only named struct init but mostly yes

    • @araarathisyomama787
      @araarathisyomama787 Před 10 dny +2

      Always better? Risky argument. It could be true if C++ compilation wasn't so dog slow compared to C and it gets exponentially worse in big projects if you're not actively preventing this problem and almost nobody is. So, if one's target style is very close to C either way, there is an incentive to drop "pp" from the source files. Performance is another rabbit hole where every good argument must be post-fixed with several layers of "but sometimes" or "but actually".
      Honestly I think it's almost a tradeoff. Experienced C programmers are used to manual labor in C, but they get much simpler language in exchange, they get really good at whatever they do and they do stuff that seems "hard", "unnecessary" or "not idiomatic" for C++ programmer automatically. EOT
      On the other hand all C++ programmers had to invest years learning the language that they will never understand fully, nor compilers will be able to implement consistently, as long as committee is extending it every 3 years... in exchange you get a language that can not only implement anything, but be written in any paradigm - to certain extent. Quite honestly if you get over this very high barrier I think you can implement anything pretty fast and in a syntactically verbose, but elegant at times, way, subjectively better than C - focusing a little bit more on the idea, than raw implementation - in a way. Expressing intent is a buzzword for C++ programmers. Yet, for traditionally C programmer those things seem actually "hard and unnecessary" and create a bigger cognitive overhead than the alternative of "just writing some more C code".
      Who is right? Is anybody wrong? I will probably get ran over in a minute

  • @kibels894
    @kibels894 Před 14 dny +3

    I work on a project with a C engine and C++ plugins. If you don't care about what happens with exceptions/signals it's fine but shit gets messy when it has to cross from one runtime to the other and back.

  • @NoizyCr1cket
    @NoizyCr1cket Před 13 dny +5

    36:24 "Barney Soursoup" 🤣

  • @John-yg1cq
    @John-yg1cq Před 13 dny

    I guess the next logical step is to define a pointer to another class that is kept in the application state that contains those function pointers instead of the built-in vtable, and then leverage C++ shenanigans to make that easier?

  • @opsJson_
    @opsJson_ Před 14 dny

    why not set the functions pointers again on hot reload? I mean, u already rebuild the vtable on hot reload

  • @prof.dr.davidbuzatto
    @prof.dr.davidbuzatto Před 14 dny +3

    I'm a C enthusiast and the only thing I miss is a standard implementation of the elementary data structures like lists (stack, queue, deque, list), priority queues, sets and symbol tables (red-black trees and hashtables).

    • @rusi6219
      @rusi6219 Před 14 dny

      LISP programmers be like:

    • @xravenx24fe
      @xravenx24fe Před 13 dny +1

      There's nothing wrong with scouring the web for libraries to accomplish the same purpose a standard library does. You can always write your interfaces to bypass libs and replace them with your own code later, it's not like you're getting by without platform specific or 3rd party libs in any serious project anyway.

  • @misisumegi6138
    @misisumegi6138 Před 14 dny

    im not 100% sure i assume it crashes because you unload the dynamic library and thus the pointer to the vtable is invalidated (sorry i didn't fully watch the previous episodes) to update to it i think the simplest way would be to create a copy of each element but there are 2 problems
    1 there are no virtual copy constructors
    2 you cannot use polymorphism because the vtable is outdated at minimum
    now the best way i can think of solving this is creating a copy factory function that auto registers new classes using CRTP and identifies types using typeid but im not sure if it would work i will try to implement it by the next vod and report about it

  • @xavierthomas1980
    @xavierthomas1980 Před 14 dny +14

    C++ is way better, but also more complicated. It provides a lot of great ways to use a foot gun to shoot yourself in the face. However what you do in C compiles in C++, templates are better and safer than macros, OO is often bad but most abstractions have also very good use cases. You just have to learn how to use C++ correctly. This is (almost) feasible in a lifetime. The bad is not the fault of C++ but of the user of it.

    • @rusi6219
      @rusi6219 Před 14 dny +8

      Only C89 compiles in C++, not C95 or anything more modern. And having a million ways to solve 1 problem is not a good thing; for every potential "solution" you have ten issues you have to think about. And figuring out the right solution to the given problem becomes increasingly difficult the more "solutions" you introduce.

    • @miroaja1951
      @miroaja1951 Před 14 dny +7

      C++ is definitely one of those fine art languages, almost impossible to write well, but when it is written well it is really something. It's absolutely plagued with a bunch of unnecessary bloat brought on by years of iso-wack stuff, but it has a relatively simple core that can do absolutely anything and everything. In a way c and c++ have a lot of similarity in the vibe department aside their syntax and rules. To a C programmer c++ often feels bloated, unintuitive and like it's trying to always be smarter than you. To a C++ programmer c often feels contrived, stale, and pointlessly restrictive. Both are an absolute skill issue and from an outside perspective seem like a meaningless squabble. C++ has its place in building things, C also has its place. You can use either, you can use both, just don't footgun yourself like you can in both.

    • @rusi6219
      @rusi6219 Před 14 dny +1

      @@miroaja1951 neither is a footgun stop telling yourself that to make yourself feel more clever than you are. And C++ devs have a tendency to write "clever" code that is near impossible for any third party to comprehend - that is not a skill issue, it's what bad practices coupled with bloated languages (and ego) lead to.

    • @miroaja1951
      @miroaja1951 Před 14 dny +5

      @@rusi6219 did you actually read what I was saying or did you just want to be angry at someone?

    • @Henry-sv3wv
      @Henry-sv3wv Před 12 dny +1

      why use unsafe c++ if we now have a safe rust

  • @saidwho9891
    @saidwho9891 Před 12 dny

    26:15 Honestly, the only reason you have to convert your libraries to C++ style is that they are header-only libraries, if you separate implementation into .h and .c you can keep using all the C features and still being compatible with C++ or any other systems language.

  • @levvayner4509
    @levvayner4509 Před 14 dny +2

    It's amazing how much effort you can exert if you don't want to write a few lines of CSS to achieve the same goal.
    Great video!

  • @saidwho9891
    @saidwho9891 Před 12 dny +1

    one of the big issues you gonna have with C++ variadic templates is the error messages lol, that's why i think instead you can have parameter pack of Task*... args

  • @danopamine
    @danopamine Před 13 dny

    haha not a fan of python myself but you joke ranting about mentioning "a toy language like python when discussing system languages" just remined me of John Carmack who was asked what programming language he currently loves the most and he responded with python lol :D

  • @TurtleKwitty
    @TurtleKwitty Před 13 dny +1

    To be fair to Bjarne, early C++ was crosscompiled to c so it would literally be a superset and full interop and then it stuck haha

  • @aniketbisht2823
    @aniketbisht2823 Před 14 dny +6

    Function overloading is also a nice feature that C++ have. Lack of it in C forces you to define functions as "sin, sinf, sinl" which is quite lame. C APIs like OpenGL are full of these functions which seems silly as a C++ programmer. Whereas in C++ it's just std::sin and it detects at compile time which version is appropriate and calls that.
    Using function overloading enables static polymorphism / pattern matching based on types and arity (the number of parameters that it takes). If there is any ambiguity it would result in compile error.

    • @Capewearer
      @Capewearer Před 14 dny +3

      I especially love the fact that some people hate operator overloading. That means they have never thought about clarity of syntax with long words (e.g. Matrix.addMatrix(Matrix_2) instead of Matrix + Matrix_2).

    • @aniketbisht2823
      @aniketbisht2823 Před 14 dny +3

      @@Capewearer std::chrono is also an excellent example where operator overloading makes everything simple and intuitive while providing type-safety without any performance loss.

    • @ElPikacupacabra
      @ElPikacupacabra Před 14 dny +1

      there's a `_Generic` macro for that 😉

    • @rusi6219
      @rusi6219 Před 14 dny

      So basically you like that C++ does the actual work for you? How lazy is that

    • @dysfunc121
      @dysfunc121 Před 14 dny

      @@rusi6219 Lazy can be good, efficient.

  • @belst_
    @belst_ Před 14 dny +27

    Barney Starsoup is actually a genius

  • @markmckenzie5343
    @markmckenzie5343 Před 14 dny

    44:18 the way you said "pure" lmao

  • @antonpieper
    @antonpieper Před 14 dny +6

    `override` implies `virtual`, so you only need to put `override` on member functions in child classes

    • @Argoon1981
      @Argoon1981 Před 13 dny

      override keyword, is not available in older c++ code bases, it exists only since c++11.

    • @antonpieper
      @antonpieper Před 13 dny

      @@Argoon1981 you should be using C++11 or newer

    • @Argoon1981
      @Argoon1981 Před 12 dny

      @@antonpieper That is not always a option, because of required libraries that never got updated, there's people still locked on c++03 code bases and they will be for many more years.

  • @SimGunther
    @SimGunther Před 14 dny +15

    Can your C do constexpr like C++ can? I don't think so!

    • @FlanPoirot
      @FlanPoirot Před 14 dny +5

      C23 has constexpr, it's deliberately made more constrained than C++'s version tho

    • @astro4490
      @astro4490 Před 14 dny +2

      ⁠@@FlanPoirotwym more constrained?

    • @0xfadead
      @0xfadead Před 14 dny

      ​@@astro4490 No compile-time crimes

    • @SimGunther
      @SimGunther Před 14 dny

      @@0xfadead Like what?

    • @rusi6219
      @rusi6219 Před 14 dny +2

      Having more poorly-implemented features is somehow supposed to be a w?

  • @Argoon1981
    @Argoon1981 Před 12 dny +1

    I personally code c++, more or less in a C like way, using C++ ism's where they make sense and my life easy or where C ism's aren't supported, not cout/cin or streams either, printf all the way. I follow what is called unorthodox c++.
    I'm not saying is the absolute best way to code c++, is the way I like to code and the way that makes me happy and more productive and that is it.

  • @alexpyattaev
    @alexpyattaev Před 14 dny +2

    Clangd LSP is quite good with c++ too

  • @pemrograman-cepat3393
    @pemrograman-cepat3393 Před 10 dny

    Wow. Your title is always legit 😮

  • @babenoff
    @babenoff Před 14 dny +1

    Daesh horoshii uchebny jazyk😮

  • @derekpmoore
    @derekpmoore Před 14 dny +1

    Yes

  • @msxmlable
    @msxmlable Před 14 dny +1

    re-implement a poor man's COM, love it :)

  • @redheavenhero7709
    @redheavenhero7709 Před 14 dny

    The reason behind inability to compile program with std::vector is an extremely messy design of initializer_list in C++ which poorly supports move-only types. And as far as I know C++ standardisation commitee explicitly refused to fix it.

    • @alf5197
      @alf5197 Před 14 dny

      initializer list's design in general is flawed in many ways, starting with the name. It's a hard thing to get right and it was introduced at the same time as all the other very hard to get right things in C+11 so I don't blame anyone but it's not ideal. there have been proposals to change this though www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4166.pdf

    • @ominusliticus8264
      @ominusliticus8264 Před 14 dny

      It makes no sense to copy construct, then there would exist multiple handles to the underlying pointer which defeats the point of calling it a unique ptr. Instead, you have to be sure to move or forward ownership of the objects throughout your construction or emplacement calls. I wrote another comment that gives two examples.

    • @redheavenhero7709
      @redheavenhero7709 Před 11 dny

      @@alf5197 The issue here is not that they didn't get it right on the first try but they don't want to admit it as a serious enough problem to be fixed.

    • @redheavenhero7709
      @redheavenhero7709 Před 11 dny

      @@ominusliticus8264 yes, it makes no sense to copy however it is behavior std::initializer_list enforces as it only provides const& access to its elements regardless its own qualification thus rendering initalization of std::vector from a braced list of elements impossible.

  • @trwn87
    @trwn87 Před 14 dny +10

    C is cool because it's challenging. 😎

    • @rubyciide5542
      @rubyciide5542 Před 14 dny +8

      Yeah right manually flipping bits inside a flipflop is easier so its trash

    • @depralexcrimson
      @depralexcrimson Před 14 dny +1

      @@rubyciide5542 manually sending electrical inputs through a baseboard is way more challenging so that is trash too.

    • @DiegoSita
      @DiegoSita Před 14 dny +1

      ​@@depralexcrimsonmanaging the velocity and directions of every single electron on a circuit is way more challenging so this is also trash

    • @Argoon1981
      @Argoon1981 Před 13 dny +1

      I don't agree at all, template heavy, virtual function crazy, exception madness, pure OOP c++, is way more challenging and complex.
      C functional/data oriented programing, is so much simpler, so much more fun to work with IMO.

    • @saidwho9891
      @saidwho9891 Před 12 dny

      @@rubyciide5542 U talking about a floppy diks ???

  • @mrmaniac9905
    @mrmaniac9905 Před 14 dny +1

    that title made me have an audible gasp. you scared me tsoding, you scared me.

  • @FDominicus
    @FDominicus Před 10 dny +1

    Maybe you like to make this session with D? Or Objektive -C?

  • @apenaswellignton
    @apenaswellignton Před 14 dny

    POG

  • @inferrna
    @inferrna Před 14 dny +1

    Qt, Новосибирск... А не 2Gis ли это?

    • @TsodingDaily
      @TsodingDaily  Před 14 dny +3

      Нет, это был Новокузнецк. Но в 2gis я тоже чуть-чуть работал.

  • @RandomGeometryDashStuff

    31:31 will `(decltype((da)->items))` preprocess to `()`?

  • @TechTutor429
    @TechTutor429 Před 6 dny

    Great

  • @Idiomeme_com
    @Idiomeme_com Před 14 dny +1

    Wow 1 hour

  • @ominusliticus8264
    @ominusliticus8264 Před 14 dny

    Not sure if you'll read, but to use `std::vector`, your plug_update function should call `std::make_unique(Move_Vec2(...))` for every new task, instead of `new Move_Vec2(...)`. The cleanest way is to then use fold expressions and `push_back` or `emplace_back`

  • @FDominicus
    @FDominicus Před 10 dny

    As long as I can avoid C++ I will. And I can't see a change to needing it in my forseeable future.

  • @alanwest6949
    @alanwest6949 Před 14 dny

    Yes.

  • @jhi-42
    @jhi-42 Před 14 dny +5

    My first job was also C++ Qt. I try to forget it.

    • @RushFuture
      @RushFuture Před 14 dny +1

      What was wrong? I've using this tandem for 10+ years more or less successfully :D

    • @mwlulud2995
      @mwlulud2995 Před 14 dny

      ​@@RushFuture why not use electron JS😉?

    • @RushFuture
      @RushFuture Před 14 dny

      @@mwlulud2995 mbedded, low resources

    • @senbonzakura662
      @senbonzakura662 Před 14 dny

      @@mwlulud2995u mean tauri, nobody uses that bloated garbage anymore

    • @qqshutup7175
      @qqshutup7175 Před 13 dny

      @@mwlulud2995 an engine to render a window, how wonderful... it's like epic games' launcher, a game engine to install a game, an installer that was supposed to have a maximum of 5MB becomes 150MB

  • @MG-yc6jr
    @MG-yc6jr Před 14 dny +31

    C++ is just a dlc of c

    • @Capewearer
      @Capewearer Před 14 dny +1

      More like Total Conversion.

    • @rusi6219
      @rusi6219 Před 13 dny

      @@Capewearer it's to C what The Frontier is to Fallout

    • @Capewearer
      @Capewearer Před 11 dny

      @@rusi6219 likely what Arcane Dimensions to Quake one is: the true sequel.

    • @rusi6219
      @rusi6219 Před 10 dny

      @@Capewearer I think you mean to say what crack life is to half life.

    • @Capewearer
      @Capewearer Před 10 dny

      @@rusi6219 that's true for Rust.

  • @friedrichmyers
    @friedrichmyers Před 14 dny +1

    My rule is simple.
    Write C in C++ and if things needs to be bananas, use C++ features. I still don't write classes unless I HAVE to. I don't use the new C++ std library functions unless I HAVE to.

    • @tapwater424
      @tapwater424 Před 14 dny

      I add templates to all my functions to increase compile times by 1000%

    • @John-yg1cq
      @John-yg1cq Před 13 dny

      Only problem is that C++ hijacks Structs and turns them into classes with public by default semantics. (Including Vtables, constructors, destructors etc. etc.)
      Essentially, you loose the default C PoD struct. There's probably some ways to get it back, but that's not obvious to the new developer.

    • @friedrichmyers
      @friedrichmyers Před 13 dny

      @@John-yg1cq Yes that is a problem but it doesn't hinder much of my performance because C++ isn't Python. And I stick with "hacky" ways of doing things unless I really have to decide on properly making a class and its respective methods. Many games use virtual tables and they are still fast enough. Because C++ is a highly optimized and fast language with modern features And it is not Python or Javascript, ofcourse. I use structs as a way to just group some variables. That's all that is for me.

    • @charlieking7600
      @charlieking7600 Před 11 dny

      ​@@tapwater424it's worth the wait. And the main trouble of C/C++ is header system. You can read the story of Ingo Molnar, who wrote patches for Linux kernel just to speed up enormously slow compilation. E.g. Java and Pascal have module system, which allows for much faster compilation.

    • @John-yg1cq
      @John-yg1cq Před 11 dny

      @@friedrichmyers There was a paradigm shift in gaming I heard, C++ dominated the 2010s but now we're seeing a bit of resurgence towards C.
      Still, it's mostly becoming a problem when you go nitty gritty into the details, I agree. But selling C++ structs as C structs is *technically/achtually* incorrect. :^)

  • @nordgaren2358
    @nordgaren2358 Před 14 dny

    Oh no. Does he find out that vtables aren't FFI safe in this video?

  • @MrMeltdown
    @MrMeltdown Před 6 dny

    In the earliest c++ you could write to the this ptr when you wanted to do in place new….

  • @michaelmas9817
    @michaelmas9817 Před 14 dny +3

    yeah yeah, Java is just a subset of JavaScript

  • @origamitraveler7425
    @origamitraveler7425 Před 14 dny

    based

  • @rssszz7208
    @rssszz7208 Před 14 dny

    Am learning cpp hope it helps😅

  • @MrLT-vf3wr
    @MrLT-vf3wr Před 14 dny +3

    @16:36 "Symbol mangling is done by C++ because the linker only supports a global namespace". - The Secret Life of C++ - Symbol Mangling. The chapter explains all the nitty gritty details of C++ symbol mangling. Quite interesting and informative.

  • @hughjass6928
    @hughjass6928 Před 14 dny +2

    Short answer is yes

    • @JerehmiaBoaz
      @JerehmiaBoaz Před 8 dny

      And the long answer is: yes indeed, the only problem C++ has is the burden of backward compatibility with C and old style C++ that makes the language unsafe and overly complex. What C++ really needs is Rust's "unsafe" keyword to tag all the legacy C and C++11 stuff people shouldn't use unless they know what they're doing (which 90% of them don't).

  • @Painple
    @Painple Před 14 dny +3

    I like C# more than C++. Nice video as always 👌

    • @OREYG
      @OREYG Před 14 dny +1

      Those languages are incomparible

    • @dutchdykefinger
      @dutchdykefinger Před 14 dny

      i never really did much c#
      but i did javascript/ecmascript
      so i actually kind of did as tons of shit is lifted from C# lol
      i guess typescript is even closer seeing as it actually has hard typing lol

    • @meme-vw1vi
      @meme-vw1vi Před 13 dny

      @OREYG what makes you say that?

    • @Henry-sv3wv
      @Henry-sv3wv Před 12 dny

      they say vala is like c# but compiles to c and makes GObject GTK GUI programming more easy

  • @dvillegas
    @dvillegas Před 14 dny

    Oh god not Qt, anything but that, we have a legacy app at work on Qt, I have no fucking clue what it does or how it does it and touching it terrifies me everytime

    • @vladimirkraus1438
      @vladimirkraus1438 Před 14 dny +1

      That's not a problem of Qt but the problem of your badly designed application or your lack of understanding of Qt. Qt is still (one of) the best tool for professional grade desktop applications.

  • @RajVishwakarma-jt4kw
    @RajVishwakarma-jt4kw Před 14 dny

    What is his real name 🤔?

  • @user-nt1uf4gl1i
    @user-nt1uf4gl1i Před 14 dny

    почалось)

  • @nordgaren2358
    @nordgaren2358 Před 14 dny

    I recently had to model C++ "inheritance" into Rust, so that I could "make" C++ structures in Rust for patching Elden Ring.
    It was pretty cool! There's some pain points in Rust. Mostly just stuff that has to be done manually. I could imagine C is even more painful in that regard.

    • @rusi6219
      @rusi6219 Před 14 dny +1

      Well if you tried C you a) wouldn't have to imagine and b) find out that you're wrong

    • @nordgaren2358
      @nordgaren2358 Před 14 dny

      @@rusi6219 I have done it in C for less complicated projects.
      How am I wrong ? You literally have to do things more manually in C.

    • @Henry-sv3wv
      @Henry-sv3wv Před 12 dny

      @@rusi6219 c and c++ is unsafe

  • @ZoraAlven
    @ZoraAlven Před 14 dny

    44:22

  • @kirillratkin1590
    @kirillratkin1590 Před 14 dny +1

    Maybe Zig will save this World ;)

    • @vincentl7022
      @vincentl7022 Před 14 dny

      I was looking for that comment thanks

  • @nobodyspecial1553
    @nobodyspecial1553 Před 14 dny +2

    I just like writing code in C. That is all. I make no claims about superiority. I'm a guy who programs for pleasure. 😏

    • @dutchdykefinger
      @dutchdykefinger Před 14 dny

      my c++ code is filled with standard C library shit lol, it's deceptively close to ansi C under the hood the way i play with it lol
      but man i love the namespaces, i kind of use them as (strictlt public) classes to organize and categorize my codebase,
      but it's mostly just good old structs and pointers under the hood, i don't even bother with c++ class implementation, but i do love the namespaces

  • @shrddr
    @shrddr Před 14 dny +5

    Barney Soursoup 🤔

  • @user-gh4lv2ub2j
    @user-gh4lv2ub2j Před 14 dny

    Sometimes?

  • @GillesLouisReneDeleuze
    @GillesLouisReneDeleuze Před 14 dny +5

    oh yes my favorite language zeep-zeep lus-lus

  • @MrKevinontube
    @MrKevinontube Před 13 dny +2

    Script tcl Bebe has got your back.

  • @potatomaaan1757
    @potatomaaan1757 Před 14 dny

    1:23:43 X-Potato (only real Gs will get this reference)

  • @cobbcoding
    @cobbcoding Před 14 dny +1

    C wins yet again

  • @oraz.
    @oraz. Před 14 dny +1

    C is more enjoyable. Objectively I dunno.

    • @Phantom-lr6cs
      @Phantom-lr6cs Před 14 dny

      c is more easy that's all and it's not complex as c++

    • @senbonzakura662
      @senbonzakura662 Před 14 dny +1

      How is it enjoyable? You have to literally do everything yourself. At some point it becomes a waste of time, and honestly a pain in the ass when other languages exist

    • @rusi6219
      @rusi6219 Před 13 dny

      @@Phantom-lr6cs complex with bloat is bad, not good.

  • @wlcrutch
    @wlcrutch Před 7 dny

    No.

  • @BobChess
    @BobChess Před 14 dny

    C++ can do C but C can't do C++

    • @dutchdykefinger
      @dutchdykefinger Před 14 dny

      well that can't be entirely true
      C++ was literally a C library for over a decade at bell laboratories, until c++ was standardized to its own standard in 1998 lol
      of course C compilers were updated with new tricks to support more things for the library in C as it evolved, before c++ became its own thing
      but it was still a newer ISO standard of C rather than a C++ compiler.
      before 1998, C was the only one that could do C++ lol
      there's a reason pretty much every C++ compiler can compile C,
      they wouldn't all go out and implement backward support for C in their C++ compilers for shits and giggles, it was already there because it evolved from C
      that's pretty much the only reason they almost all can and do, C is the cause, not the effect lol

  • @epic_gamerXD12345
    @epic_gamerXD12345 Před 14 dny

    No

  • @God-vl5tk
    @God-vl5tk Před 14 dny +5

    Not surprised by someone who says "Right" after every statement he makes.

    • @Nova32x
      @Nova32x Před 14 dny

      Is he wrong tho?

    • @RandomNoob1124
      @RandomNoob1124 Před 14 dny

      Bruh corporate engineers spam right after every statement at work holy shit it’s like shadow clones 🤦🏾‍♂️

  • @aniketbisht2823
    @aniketbisht2823 Před 14 dny +2

    Macros's are poor man's templates for generic programming and meta-programming. Not having constexpr (compile-time computation) is a huge downside for C. C23 introduced constexpr but those are only "variables" a.k.a constants not "computation". And lack of "constexpr if" means you can't make compile time decisions with them. For that you still rely on the pre-processor (#if def's). These two features alone enables you to write libraries like std::chrono and fmt. Both of which are better than their C counterparts : and . They catch many errors at compile-time and generate better assembly (due to eliding computations which could be done at compile-time).
    You are passing floats every in the name of "seconds". The only thing backing it up is the documentation (if any). std::chrono::seconds performs all the checks and conversions for you without any loss of performance.

  • @patrickjdarrow
    @patrickjdarrow Před 14 dny

    Me watching this as a python script kiddie 👁️👄👁️🍼

  • @MrOnePieceRuffy
    @MrOnePieceRuffy Před 14 dny +1

    Whats this Question? A good language has a string class. Case closed.

  • @danielmilyutin9914
    @danielmilyutin9914 Před 14 dny +1

    Provide the link to your code. Want to see what are you doing there with C++.
    Maybe (no promises here), will give you some advice how to improve it or to use idiomatic C++.
    Looks like your std::vector should be `std::vector`.
    This will relief you from writing destructor.

  • @rogo7330
    @rogo7330 Před 13 dny

    One thing why people talk about C as "old" and "hard" just because libc is very old, full of bugs and most of the times inconvinient. I personally reference to it as "undefined code with global states library". Thankfully POSIX does include functions where you can provide a pointer to an instance of the state, thus having ability to do several things at the same time, but it is not everything at it honestly should be the default.
    If Python would not had a lot of predefined classes for strings and stuff it would be very annoying language to write in. Standart library of the language _is_ the language these days.

  • @matrixnorm6672
    @matrixnorm6672 Před 14 dny +4

    no

  • @gagagero
    @gagagero Před 14 dny

    My dad is stronger than your dad.

  • @inferrna
    @inferrna Před 14 dny +10

    C beats Rust, C++ beats C, Rust beats C++

    • @heco.
      @heco. Před 14 dny +4

      so like rock paper scissor

    • @rusi6219
      @rusi6219 Před 14 dny +6

      Actually Rust curls up into a corner and cries.

    • @arson5304
      @arson5304 Před 14 dny +1

      ​@@rusi6219 why

    • @rusi6219
      @rusi6219 Před 14 dny

      @@arson5304 because of its atrocious userbase.

    • @huistelefoon5375
      @huistelefoon5375 Před 14 dny

      ​@@arson5304afaik Rust is barely used in enterprise software, and it is significantly higher level. the comparison of C, C++ vs Rust is questionable

  • @paladin80lvl
    @paladin80lvl Před 14 dny

    на сдинозавры пишут тыче бле

  • @ron3060
    @ron3060 Před 14 dny +1

    Cpp= C+Class 😎

    • @nirajandata
      @nirajandata Před 14 dny +4

      sorry, this terminology was only valid upto c++98

    • @dutchdykefinger
      @dutchdykefinger Před 14 dny

      fuck classes
      i only care about the namespaces
      templates can be handy in a pinch too :D

    • @valizeth4073
      @valizeth4073 Před 13 dny

      @@nirajandata Not even then really, it was only valid around 40 years ago when C++ was still "C with Classes" and still transpiled down to C.

  • @debooger
    @debooger Před 14 dny

    c++ nuuuuuu you fell off lmao

  • @thsposito
    @thsposito Před 14 dny +1

    i was hooked, and than all this bs about scripting languages not being actual programming languages... too pendantic. bye

    • @FlanPoirot
      @FlanPoirot Před 14 dny +5

      u won't be missed

    • @ElPikacupacabra
      @ElPikacupacabra Před 14 dny +4

      He's joking. He programs in a bunch of languages, and makes the same sarcastic statements for all of them.

  • @lukefidalgo8154
    @lukefidalgo8154 Před 12 dny

    no