Jonathan Blow on C++ and JavaScript

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2025

ความคิดเห็น • 137

  • @Dr.UldenWascht
    @Dr.UldenWascht 9 หลายเดือนก่อน +42

    A 1 minute opinion piece by JB that has a clear beginning, body and a conclusion. I'm ready to pass on to the great beyond. I've seen everything.

  • @bruterasta
    @bruterasta 9 หลายเดือนก่อน +66

    But in C++ you're not forced to rely on magical stuff that is doing mysterious stuff with memory. You can take control without hacks by builtin mechanisms dedicated for that purpose.

    • @miikavihersaari3104
      @miikavihersaari3104 9 หลายเดือนก่อน +8

      True, but writing idiomatic C++ still means you need to adhere to at least RAII, which will make it harder to manage memory efficiently. Adding any additional rule to follow means having an extra constraint, which always has a cost that needs to be considered.

    • @pretro6136
      @pretro6136 9 หลายเดือนก่อน +5

      you still do, it's not at the same level as javascript, but with the way OOP works and how the std library works, it could be considered awful compared to a large c program

    • @Mallchad
      @Mallchad 9 หลายเดือนก่อน +5

      Yes but then you're forced to rely on awkward and weird compiler magical stuff instead :)

    • @bruterasta
      @bruterasta 9 หลายเดือนก่อน +12

      @@miikavihersaari3104 True. But you're not forced to use idiomatic C++ either. Also RAII does not mean "delete memory" at the end of the scope, it can easly be used as "I don't need this scratch memory anymore" signal to whatever memory management system you need underneath. Without hacks. All features are optional and you can always defer to C if you need.
      I know C++ is missed opportunity in native languages evolution but I feel like sometimes our disappointment clouds our judgement. Like, I can easly point to objectively bad design decisions that actually make it extra hard to do the right thing (ex. signed types overflow UB), but memory management is not that bad.

    • @miikavihersaari3104
      @miikavihersaari3104 9 หลายเดือนก่อน +2

      @@bruterasta True again, and well said 🙂

  • @anispinner
    @anispinner 9 หลายเดือนก่อน +24

    Now imagine how much people don't understand when GPT is writing their code.

    • @mjthebest7294
      @mjthebest7294 5 หลายเดือนก่อน +6

      The best of the best... GPT itself doesn't understand its code neither.

  • @yapdog
    @yapdog 6 หลายเดือนก่อน +4

    I don't always agree with JB, but on this we are absolutely congruent. For nearly the past 2 decades, I've been developing an OS or Creators. It's nearly 10 megabytes of code. All in C.

  • @awesomegamer31
    @awesomegamer31 9 หลายเดือนก่อน +66

    this guy has a an opinion on everything and keeps popping up in my recommendeds to let me know about it...

    • @captainfordo1
      @captainfordo1 9 หลายเดือนก่อน +15

      And somehow you keep watching.

    • @UnidayStudio
      @UnidayStudio 9 หลายเดือนก่อน +2

      Fun fact: him itself don't know about any of those videos. Random blow fans just record him talk on his streams and uploads it. I love it!

  • @FoxFavinger
    @FoxFavinger 9 หลายเดือนก่อน +15

    I’m learning C and JS at the same time. I’m probably gonna wind up making money with JS, but C is more fun and transparent.

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

      But if you *master* C, you could make many times what you'd make with JS.

    • @sadiulhakim7814
      @sadiulhakim7814 5 หลายเดือนก่อน +2

      I am a Java developer and already making money. But i want to learn some low level stuff. But a bit confused aming c, rust, go etc.

    • @FoxFavinger
      @FoxFavinger 5 หลายเดือนก่อน +2

      @@yapdog I’m not mastering C lol. I’m learning to code at 34 🤣 But I agree with you. I’m also in sales and SEO, so hopefully I’ll still make more than a JS developer.

    • @yapdog
      @yapdog 5 หลายเดือนก่อน +2

      @@FoxFavinger You're still a baby--I'm damn near twice your age😞 Enjoy your youth😁!

    • @mrhotpockets23
      @mrhotpockets23 4 หลายเดือนก่อน +1

      @@yapdog How about me. I'm 19.

  • @pretro6136
    @pretro6136 9 หลายเดือนก่อน +21

    absolutely true. when someone calls js a toy language, this is what they mean. i'm using js rn in one of my projects, and i could never imagine writing backend code using it. not because it would be complicated to start, but because it would be far too complicated to create a full on system for every action. for example, if i wanted to create a static JSON server for the backend, on rust (the current backend language), it took 30 minutes, and it can now handle async requests and handle most situations i would come across, and i can also change it if needed. in javascript, it would take 1-10 minutes to create the same thing, but if i ever needed to change anything, i would be unable to change it since i would be relying on js's json for everything

    • @nou4605
      @nou4605 9 หลายเดือนก่อน +11

      Nah you just don't know how to use JS. I have worked on multiple large scale backends built on node. They work fine.

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

      @@nou4605 maybe, but what i'm saying is not that it's impossible to write backend js code, but that code will be way more difficult to write compared to another language

    • @turolretar
      @turolretar 9 หลายเดือนก่อน +3

      Node is perfectly fine and typescript can be really good as a type system. I think we should look at JS ecosystem as a stepping stone towards better programming experience.

    • @PRIMARYATIAS
      @PRIMARYATIAS 9 หลายเดือนก่อน +2

      Golang is actually a good middle ground for server side applications.

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

      @@turolretar Typescript is the funniest and most tragic pice of software i've ever seen. Imagine spending billions of full-time corporate man-hours in an attempt to make a very bad programming language slightly less bad, and then fail hard. Sad!

  • @CEOofGameDev
    @CEOofGameDev 9 หลายเดือนก่อน +3

    BASED. never agreed with a Jon blow opinion more in my life!

  • @LyubomyrSemkiv
    @LyubomyrSemkiv 8 หลายเดือนก่อน +2

    In C++ I can rely on rule of 5. I can just check that class properly manages resources and use this fact for reasoning. C I cannot do this and need to track everything. So I would say that this is quite an opposite in regards to big C codebase vs big C++ one. JS is a disaster, I agree.

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

      To do, this you have e to use smart pointers everywhere

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

      @@llothar68 you clearly don’t understand what I’m talking about.

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

    That’s why I only code in Java

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

    What's harder, game development or system programming?

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

      Isn't game development(programming) a form of systems programming?

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

      @@Dystisis Depends on the chosen architecture. If you're building on top of an existing (robust) game engine, the system part of the work is mostly done for you.

    • @charlieking7600
      @charlieking7600 4 หลายเดือนก่อน +1

      System programming. Gamedev is mainstream and has ready solutions for everyone (Unity, Unreal with their asset stores).
      In system programming you always reinvent the wheel to make it more safe and effective. You can't "cheat" like in gamedev.

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

    I sort of agree and disagree with Jonathan on this statement. What makes a complicated system unmanageable is more of the lack of code safety features than fancy automatic memory management. You can always refactor code that causes memory problems but if you do that in a language that lacks code safety you will just introduce more and more bugs to the point of losing control over your program.

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

      It's just a bad point not the maintenance but relaying on 'magical' things. C++ has a ton of stuff you don't control so does c if you wanted to control everything you would right machine binary and that's impossible.

  • @limarchenko96
    @limarchenko96 9 หลายเดือนก่อน +12

    Pascal is the best programming language

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

      *Turbo Pascal

    • @ar_xiv
      @ar_xiv 9 หลายเดือนก่อน +2

      Odin and jai both have some pascality to them

    • @vitalyl1327
      @vitalyl1327 9 หลายเดือนก่อน +2

      Not since it was superseded by Oberon.

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

      ​@@vitalyl1327 I'm very interested in Oberon, Wirth's reaction against C++

  • @mrmoebius
    @mrmoebius 9 หลายเดือนก่อน +10

    The golden middle is to use C++ with templates, consteval and destructors, but without RTTI, exceptions, STL and all the "modern" garbage.

    • @sporefergieboy10
      @sporefergieboy10 9 หลายเดือนก่อน +3

      The only feature C++ has that I’m jealous of is platform atomics tbh.

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

      So pretty much JAI

    • @bruterasta
      @bruterasta 9 หลายเดือนก่อน +2

      Non memory allocating parts of STL are usually useful. std::array is also fine even though it allocates memory. However I totally get it why people wouldn't want to deal with STL's template centric complexity.

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

      @@kordanot except that RAII is actually useful and I think JAI will not get it. However I would really love to play with JAI a bit ;-)

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

      ​@@u9vata RAII is bad because it makes resource acquisition look like a normal local variable declaration. Normally, if you have a variable declared within a loop, and you need to refer to its last value outside that loop, you can just move the declaration outside the loop. RAII breaks this, because now a local variable declaration might lock and unlock a mutex or open an close a file, and moving the declaration to a broader scope can result in deadlock or running out of available file descriptors. I think C++ should abandon RAII and adopt something like Python's context managers, adding an abstract class that looks something like this:
      template
      class std::resource {
      public virtual ~resource() = 0;
      public virtual T acquire() = 0;
      public virtual release(bool exited_by_exception) = 0;
      };
      And then adding a new resource acquisition control construct like Python's with statement. I haven't kept up with the latest standards, but I think using currently can't have an open parenthesis immediately following it, so the syntax could be something like this:
      using (Lock(mutex)) { /* ... */ }
      using (auto r : SomeResource()) { /* ... */ }

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

    if it's harder then i guess you should respect people who write JS more so than berate them

  • @Kknewkles
    @Kknewkles 9 หลายเดือนก่อน +5

    Are there ANY sizable, complicated JS programs out there? Ever?...

    • @empireempire3545
      @empireempire3545 9 หลายเดือนก่อน +18

      unfortunately there are...

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

      For example, variety of front-end frameworks...

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

      Sure.

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

      Google Maps / Google Earth?

    • @remsee1608
      @remsee1608 9 หลายเดือนก่อน +3

      lots of JS games out there

  • @southgonholditdown
    @southgonholditdown 9 หลายเดือนก่อน +4

    Displaying hello world with electron is NOT easy, what is he talking about?

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

      Man, imagine being able to just build desktop app with JS in less than 5 minutes, instead of fighting with electron api...

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

    He's going for the strawman, assuming that developers who used managed languages are barred from access of knowing how their GC and development environment handle memory, or that it's too arcane to understand to be able to work with optimally. Probably true for some, but not as a generalization. I guess the keyword is "complicated", but there's flexibility in defining that.

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

    The mistake he is making here is equivalating JS the language with the JS frameworks that come out like mushrooms after the rain. Those frameworkds are as simple or as complicated as the creators want them to be. But JS alone is quite versatile, you can create basically anything with it.

    • @Theonewhowantsaname
      @Theonewhowantsaname 9 หลายเดือนก่อน +4

      The ability to create anything with a language just means it’s Turing complete, which tons of things are. That says nothing about how good of a choice that language is for a large project.

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

    Prove it

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

    I generally like his viewpoints but this didn't seem logical. The main advantage of those languages is that they abstract away many things such that it makes it easier to maintain a large project. Maybe there is some validity in his argument but those labguages are not popular for no reason. Abstraction is necessary. You either build it yourself in C or use Python/Javascript/C++ to do it for you.

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

    There are lots of huge code bases that are managed just fine with javascript. Yeah, you migh not have control over the memory and low level stuff, but you may not need to. The goal of the programming language is to solve your problem. If you can then manage your code base ( which is more about architecture rather than coding language ) and the super high execution performance is not your top priority, why does it matter you what language is written in. Programming is about solving problems. Stop treating it like a religion

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

    Man JB's takes are interesting, but I also feel they are very wrong in some areas... Like what he's saying here is basically everything every Rust developer has said about C++ forever. However the premise is fundamentally flawed in saying "Don't use C++, you don't know how to use it's advanced features!" Because he's basically implying I should just write these features myself in C instead, that way nobody but me understands them!
    There is a reason every major game engine is written in C++ or Rust and not C. Also why use C when GO exists? JB you have good insights, but frankly you're too stuck in your ways, this just isn't good advice.

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

    Odin and Zig are the new shiny players in this field….

  • @jaron_yankey
    @jaron_yankey 9 หลายเดือนก่อน +2

    Dude making a 58 second video feel like 5 minutes.

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

    So why he used to use a C++ instead of C?

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

      Because APIs are

  • @Kim-e4g4w
    @Kim-e4g4w 9 หลายเดือนก่อน +2

    One thing I don't understand is why people think coding with HTML/CSS/JavaScript is the way to go, when I would rather build a server in C with SSL library and then just generate output HTML/CSS/JavaScript to the user. This would making the backend more stream lined, slim and fast. In my opinion this is where the future lies using this technique.

    • @ar_xiv
      @ar_xiv 9 หลายเดือนก่อน +5

      Web stuff requires a lot of loose string manipulation that’s just how it is. Perl and PHP were better than where we are now imo and using C would be like going back to that but without all of the nice features those languages offered for the tasks they were designed for

    • @turolretar
      @turolretar 9 หลายเดือนก่อน +8

      Code a web server in c. Preferably a modern one that can do asynchronous stuff. I think you will quickly understand why

    • @Kim-e4g4w
      @Kim-e4g4w 9 หลายเดือนก่อน +2

      @@ar_xiv Well I would argue in the same manner as J.B. did with why ever bother with scripting in games, it is the same matter with having a Web code generator based on whatever objects you have in memory (strictly no need for DB like SQL etc.) and have those objects treated in the same manner as how games use ECS for game objects to do whatever they are supposed to do. Everything should be _Data Driven_ so why bother with scripting at all?

    • @Kim-e4g4w
      @Kim-e4g4w 9 หลายเดือนก่อน +2

      @@turolretarIt is basically just like making a multiplayer game server but instead handles incoming TCP packages, compute and then create a web response, finally just ship it to the client. Anyone calling themself a professional C developer can do this. Making a basic HTTPS server can easily be done in under 15 minutes, then just iterate with whatever requirement the company needs for its web service. Building your own libraries in C is a multiplier here, essential for making stuff faster.

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

      @@Kim-e4g4w a traditional database is a lot closer to an ECS than you might think. Definitely a lot closer than however js devs store data

  • @ifstatementifstatement2704
    @ifstatementifstatement2704 8 วันที่ผ่านมา

    Javascript variables are a guessing game. No data types or hints.

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

    In HTML/js/css a hello world is literally writing the words Hello World

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

      In just HTML it's the most straight-forward, but if you actually want to write the words on the page using JS and not a console log, a few concepts knowing how to get and modify DOM elements are required. Which probably makes it the hardest approach of them all.

  • @RedionXhepa
    @RedionXhepa 9 หลายเดือนก่อน +2

    Why arent you programming in bits ? You are not understanding what individual bits are doing.That can make you confused ...
    Javascript is bad, C++ might not be the best but I dont see how C is better 😮

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

      C is simple... Remember what Thomas the Tank Engine says: "Simple is better".

    • @the_original_dude
      @the_original_dude 9 หลายเดือนก่อน +3

      "what individual bits are doing"
      do you even know what you're saying?

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

      I hope you got the irony 😃 (apparently you did not) . I am qualified enough to know what I am saying ( both academically and professionally).

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

      @@RedionXhepa yeah, I'm sure you are

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

    Love TypeScript and Golang, I don't need anything else 🤑 :)

  • @lekretka
    @lekretka 9 หลายเดือนก่อน +6

    This is of course an exaggeration. High level languages will always be more productive.
    They are not as productive when you have big performance problems and it would be easier to write with C/C++ from the beginning, but that's not common case.

    • @An7Hoang
      @An7Hoang 9 หลายเดือนก่อน +24

      You just said "always".

    • @pretro6136
      @pretro6136 9 หลายเดือนก่อน +6

      the issue is that moment when you do have a performance problem. the entire reason the tech industry follows the frontend/backend system (instead of having 1 large codebase with everything combined) is that those moment when you do have performance issues or need to do a low level action are so important

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

      Can be more productive on the beginning of a project, but it makes you lose productivity on the long run.

    • @lekretka
      @lekretka 9 หลายเดือนก่อน +2

      @@An7Hoang Well, I meant that they are more productive from features point of view, you can type and get stuff done faster. I do understand that there are a lot of fields when using high-level languages isn't an option, in domain of low-level systems JS, Java or Python will have productivity of 0.

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

      I'm not sure if I agree. High level languages are easier to learn though. For example, Python can be very readable even to a non-programmer. That doesn't mean python is a "productive" language. You can spend a very short amount of time making something in Python but the lack of compilation and static typing inevitably leads to bugs. These bugs take time to solve. Languages like C++ are not only more performant, but the compiler can catch a lot of bugs for you before you encounter them at run-time. The productivity hit from managing your own memory is also optional, languages like Rust and C++ support smart pointers and RAII which is essentially opt-in garbage collection.
      The real issue with C++ is that it is complicated, and sometimes you just don't need the complexity. But when the complexity is useful it can be very useful.
      C is incredibly simple, you would be surprised how simple it is to program in C. Sometimes it feels limiting, and the memory errors can be annoying. But the memory errors you get in C are much like the type-based errors of the scripting languages.

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

    For big projects Rust is the best at this point

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

      Downvoted