Is C++ better than C?

Поділитися
Вставка
  • Опубліковано 13 тра 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...
  • Наука та технологія

КОМЕНТАРІ • 265

  • @froop2393
    @froop2393 22 дні тому +28

    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!

  • @AlessandroStamatto
    @AlessandroStamatto 22 дні тому +93

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

    • @skeleton_craftGaming
      @skeleton_craftGaming 22 дні тому +9

      he implemented oop..

    • @bofa-zi4fj
      @bofa-zi4fj 22 дні тому +4

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

    • @rusi6219
      @rusi6219 22 дні тому

      @@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 22 дні тому

      @@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 21 день тому

      @@skeleton_craftGaming ]*

  • @DogeOfWar
    @DogeOfWar 22 дні тому +76

    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 22 дні тому

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

    • @rogo7330
      @rogo7330 21 день тому +8

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

  • @stolenlaptop
    @stolenlaptop 22 дні тому +142

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

    • @cobbcoding
      @cobbcoding 22 дні тому +23

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

    • @SimGunther
      @SimGunther 22 дні тому +5

      @@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 22 дні тому +10

      C is the best programming language.

    • @valizeth4073
      @valizeth4073 22 дні тому +5

      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 22 дні тому

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

  • @user-do4fm1nz2f
    @user-do4fm1nz2f 22 дні тому +14

    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.

  • @NoizyCr1cket
    @NoizyCr1cket 21 день тому +9

    36:24 "Barney Soursoup" 🤣

  • @saidwho9891
    @saidwho9891 20 днів тому +9

    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 22 дні тому +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

  • @maxpoulin64
    @maxpoulin64 22 дні тому +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.

  • @exosdel
    @exosdel 22 дні тому +3

    Love ur vids on C, keep them comming!

  • @Eugensson
    @Eugensson 22 дні тому +42

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

  • @Cmanorange
    @Cmanorange 22 дні тому +7

    26:10 raysan appreciation post

  • @hedlund
    @hedlund 22 дні тому +1

    @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?

  • @GoldoEb
    @GoldoEb 22 дні тому +3

    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 21 день тому

      Ooh, never came across that before. Cheers!

    • @saidwho9891
      @saidwho9891 20 днів тому

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

  • @prof.dr.davidbuzatto
    @prof.dr.davidbuzatto 22 дні тому +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 21 день тому

      LISP programmers be like:

    • @xravenx24fe
      @xravenx24fe 21 день тому +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.

  • @kibels894
    @kibels894 22 дні тому +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.

  • @opsJson_
    @opsJson_ 22 дні тому

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

  • @John-yg1cq
    @John-yg1cq 21 день тому

    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?

  • @misisumegi6138
    @misisumegi6138 22 дні тому

    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

  • @markmckenzie5343
    @markmckenzie5343 22 дні тому

    44:18 the way you said "pure" lmao

  • @TurtleKwitty
    @TurtleKwitty 21 день тому +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

  • @TheJanhalsema1
    @TheJanhalsema1 22 дні тому +10

    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 21 день тому +1

      i agree

    • @StevenMartinGuitar
      @StevenMartinGuitar 21 день тому +3

      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 21 день тому

      Same order only named struct init but mostly yes

    • @araarathisyomama787
      @araarathisyomama787 18 днів тому +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

  • @danopamine
    @danopamine 21 день тому

    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

  • @belst_
    @belst_ 22 дні тому +28

    Barney Starsoup is actually a genius

  • @xavierthomas1980
    @xavierthomas1980 22 дні тому +15

    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 22 дні тому +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 22 дні тому +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 22 дні тому +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 22 дні тому +5

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

    • @Henry-sv3wv
      @Henry-sv3wv 20 днів тому +1

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

  • @saidwho9891
    @saidwho9891 20 днів тому

    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.

  • @MrMeltdown
    @MrMeltdown 15 днів тому +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.

  • @saidwho9891
    @saidwho9891 20 днів тому +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

  • @antonpieper
    @antonpieper 22 дні тому +6

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

    • @Argoon1981
      @Argoon1981 21 день тому

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

    • @antonpieper
      @antonpieper 21 день тому

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

    • @Argoon1981
      @Argoon1981 20 днів тому

      @@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.

  • @apenaswellignton
    @apenaswellignton 22 дні тому

    POG

  • @babenoff
    @babenoff 22 дні тому +1

    Daesh horoshii uchebny jazyk😮

  • @pemrograman-cepat3393
    @pemrograman-cepat3393 18 днів тому

    Wow. Your title is always legit 😮

  • @trwn87
    @trwn87 22 дні тому +10

    C is cool because it's challenging. 😎

    • @rubyciide5542
      @rubyciide5542 22 дні тому +8

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

    • @depralexcrimson
      @depralexcrimson 22 дні тому +1

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

    • @DiegoSita
      @DiegoSita 22 дні тому +1

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

    • @Argoon1981
      @Argoon1981 21 день тому +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 20 днів тому

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

  • @derekpmoore
    @derekpmoore 22 дні тому +1

    Yes

  • @mrmaniac9905
    @mrmaniac9905 22 дні тому +1

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

  • @alexpyattaev
    @alexpyattaev 22 дні тому +2

    Clangd LSP is quite good with c++ too

  • @Idiomeme_com
    @Idiomeme_com 22 дні тому +1

    Wow 1 hour

  • @msxmlable
    @msxmlable 22 дні тому +1

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

  • @aniketbisht2823
    @aniketbisht2823 22 дні тому +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 22 дні тому +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 22 дні тому +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 22 дні тому +1

      there's a `_Generic` macro for that 😉

    • @rusi6219
      @rusi6219 22 дні тому

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

    • @dysfunc121
      @dysfunc121 22 дні тому

      @@rusi6219 Lazy can be good, efficient.

  • @Argoon1981
    @Argoon1981 20 днів тому +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.

  • @redheavenhero7709
    @redheavenhero7709 22 дні тому

    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 22 дні тому

      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 22 дні тому

      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 18 днів тому

      @@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 18 днів тому

      @@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.

  • @alanwest6949
    @alanwest6949 22 дні тому

    Yes.

  • @FDominicus
    @FDominicus 18 днів тому +1

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

  • @FDominicus
    @FDominicus 18 днів тому

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

  • @SimGunther
    @SimGunther 22 дні тому +15

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

    • @FlanPoirot
      @FlanPoirot 22 дні тому +5

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

    • @astro4490
      @astro4490 22 дні тому +2

      ⁠@@FlanPoirotwym more constrained?

    • @0xfadead
      @0xfadead 22 дні тому

      ​@@astro4490 No compile-time crimes

    • @SimGunther
      @SimGunther 22 дні тому

      @@0xfadead Like what?

    • @rusi6219
      @rusi6219 22 дні тому +2

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

  • @buriedbones-nh9xr
    @buriedbones-nh9xr День тому

    Its the same as askin if a V8 is better than a V4 engine.
    Technically it is but its much more dangerous to drive a V8, and if you screw up with a V8 its much more disasterous than screwing up with a V4.
    Its not the best analogy

  • @MG-yc6jr
    @MG-yc6jr 22 дні тому +31

    C++ is just a dlc of c

    • @Capewearer
      @Capewearer 22 дні тому +1

      More like Total Conversion.

    • @rusi6219
      @rusi6219 21 день тому

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

    • @Capewearer
      @Capewearer 19 днів тому

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

    • @rusi6219
      @rusi6219 18 днів тому

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

    • @Capewearer
      @Capewearer 18 днів тому

      @@rusi6219 that's true for Rust.

  • @jhi-42
    @jhi-42 22 дні тому +5

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

    • @RushFuture
      @RushFuture 22 дні тому +1

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

    • @mwlulud2995
      @mwlulud2995 22 дні тому

      ​@@RushFuture why not use electron JS😉?

    • @RushFuture
      @RushFuture 22 дні тому

      @@mwlulud2995 mbedded, low resources

    • @qqshutup7175
      @qqshutup7175 21 день тому

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

    • @Henry-sv3wv
      @Henry-sv3wv 20 днів тому

      Is writing GTK GUI in c that much nicer? ( GObject )
      or do you use vala?

  • @TechTutor429
    @TechTutor429 14 днів тому

    Great

  • @inferrna
    @inferrna 22 дні тому +1

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

    • @TsodingDaily
      @TsodingDaily  22 дні тому +3

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

  • @friedrichmyers
    @friedrichmyers 22 дні тому +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 22 дні тому

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

    • @John-yg1cq
      @John-yg1cq 21 день тому

      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 21 день тому

      @@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 19 днів тому

      ​@@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 19 днів тому

      @@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. :^)

  • @RandomGeometryDashStuff
    @RandomGeometryDashStuff 20 днів тому

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

  • @nordgaren2358
    @nordgaren2358 21 день тому

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

  • @MrMeltdown
    @MrMeltdown 14 днів тому

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

  • @levvayner4509
    @levvayner4509 22 дні тому +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!

  • @origamitraveler7425
    @origamitraveler7425 22 дні тому

    based

  • @hughjass6928
    @hughjass6928 22 дні тому +2

    Short answer is yes

    • @JerehmiaBoaz
      @JerehmiaBoaz 16 днів тому

      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).

  • @nordgaren2358
    @nordgaren2358 22 дні тому

    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 22 дні тому +1

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

    • @nordgaren2358
      @nordgaren2358 22 дні тому

      @@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 20 днів тому

      @@rusi6219 c and c++ is unsafe

  • @ominusliticus8264
    @ominusliticus8264 22 дні тому

    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`

  • @rssszz7208
    @rssszz7208 22 дні тому

    Am learning cpp hope it helps😅

  • @RajVishwakarma-jt4kw
    @RajVishwakarma-jt4kw 22 дні тому

    What is his real name 🤔?

  • @Painple
    @Painple 22 дні тому +3

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

    • @OREYG
      @OREYG 22 дні тому +1

      Those languages are incomparible

    • @dutchdykefinger
      @dutchdykefinger 22 дні тому

      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 21 день тому

      @OREYG what makes you say that?

    • @Henry-sv3wv
      @Henry-sv3wv 20 днів тому

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

  • @shrddr
    @shrddr 22 дні тому +5

    Barney Soursoup 🤔

  • @michaelmas9817
    @michaelmas9817 22 дні тому +3

    yeah yeah, Java is just a subset of JavaScript

  • @user-nt1uf4gl1i
    @user-nt1uf4gl1i 22 дні тому

    почалось)

  • @kirillratkin1590
    @kirillratkin1590 22 дні тому +1

    Maybe Zig will save this World ;)

    • @vincentl7022
      @vincentl7022 22 дні тому

      I was looking for that comment thanks

  • @MrLT-vf3wr
    @MrLT-vf3wr 22 дні тому +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.

  • @dvillegas
    @dvillegas 22 дні тому

    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 21 день тому +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.

  • @MrKevinontube
    @MrKevinontube 21 день тому +2

    Script tcl Bebe has got your back.

  • @GillesLouisReneDeleuze
    @GillesLouisReneDeleuze 22 дні тому +5

    oh yes my favorite language zeep-zeep lus-lus

  • @nobodyspecial1553
    @nobodyspecial1553 22 дні тому +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 22 дні тому

      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

  • @potatomaaan1757
    @potatomaaan1757 22 дні тому

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

  • @BobChess
    @BobChess 22 дні тому

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

    • @dutchdykefinger
      @dutchdykefinger 22 дні тому

      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

  • @cobbcoding
    @cobbcoding 22 дні тому +1

    C wins yet again

  • @oraz.
    @oraz. 22 дні тому +1

    C is more enjoyable. Objectively I dunno.

    • @Phantom-lr6cs
      @Phantom-lr6cs 22 дні тому

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

    • @rusi6219
      @rusi6219 21 день тому

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

  • @ZoraAlven
    @ZoraAlven 22 дні тому

    44:22

  • @wlcrutch
    @wlcrutch 15 днів тому

    No.

  • @epic_gamerXD12345
    @epic_gamerXD12345 22 дні тому

    No

  • @God-vl5tk
    @God-vl5tk 22 дні тому +5

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

    • @Nova32x
      @Nova32x 22 дні тому

      Is he wrong tho?

    • @RandomNoob1124
      @RandomNoob1124 22 дні тому

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

  • @aniketbisht2823
    @aniketbisht2823 22 дні тому +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.

  • @MrOnePieceRuffy
    @MrOnePieceRuffy 22 дні тому +1

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

  • @danielmilyutin9914
    @danielmilyutin9914 22 дні тому +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.

  • @patrickjdarrow
    @patrickjdarrow 22 дні тому

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

  • @rogo7330
    @rogo7330 21 день тому

    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 22 дні тому +4

    no

    • @Capewearer
      @Capewearer 22 дні тому

      ...because it's MUCH better.

  • @gagagero
    @gagagero 22 дні тому

    My dad is stronger than your dad.

  • @inferrna
    @inferrna 22 дні тому +10

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

    • @heco.
      @heco. 22 дні тому +4

      so like rock paper scissor

    • @rusi6219
      @rusi6219 22 дні тому +6

      Actually Rust curls up into a corner and cries.

    • @arson5304
      @arson5304 22 дні тому +1

      ​@@rusi6219 why

    • @rusi6219
      @rusi6219 22 дні тому

      @@arson5304 because of its atrocious userbase.

    • @huistelefoon5375
      @huistelefoon5375 22 дні тому

      ​@@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 22 дні тому

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

  • @pavelperina7629
    @pavelperina7629 6 днів тому

    My takes, I don't want to watch two hours video:
    * C is much less complex, whereas C++ is like a mix of several languages (templates with specifics of C+11/C++17/C++20, several ways how to initialize variable with some side effects of {})
    * C does not have RAII and relatively safe way to free resources by class going out of scope
    * conveniency of STL library despite some of it's design decisions are "weird" to put it mildly
    * There are edge cases when C++ is slower if you try to target them, but calling function/method (virtual or not) hundred million times in a loop is bad design regardless of the language

  • @ron3060
    @ron3060 22 дні тому +1

    Cpp= C+Class 😎

    • @nirajandata
      @nirajandata 22 дні тому +4

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

    • @dutchdykefinger
      @dutchdykefinger 22 дні тому

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

    • @valizeth4073
      @valizeth4073 21 день тому

      @@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.

  • @user-gh4lv2ub2j
    @user-gh4lv2ub2j 22 дні тому

    Sometimes?

  • @debooger
    @debooger 22 дні тому

    c++ nuuuuuu you fell off lmao

  • @thsposito
    @thsposito 22 дні тому +1

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

    • @FlanPoirot
      @FlanPoirot 22 дні тому +6

      u won't be missed

    • @ElPikacupacabra
      @ElPikacupacabra 22 дні тому +5

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

  • @lukefidalgo8154
    @lukefidalgo8154 19 днів тому

    no