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.
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.
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
@@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.
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.
@@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.
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 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
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.
@@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!
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.
@@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.
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.
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.
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.
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 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()) { /* ... */ }
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.
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.
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.
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.
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
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.
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.
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
@@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?
@@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.
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.
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 😮
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.
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
@@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.
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.
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.
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.
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.
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
Yes but then you're forced to rely on awkward and weird compiler magical stuff instead :)
@@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.
@@bruterasta True again, and well said 🙂
Now imagine how much people don't understand when GPT is writing their code.
The best of the best... GPT itself doesn't understand its code neither.
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.
this guy has a an opinion on everything and keeps popping up in my recommendeds to let me know about it...
And somehow you keep watching.
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!
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.
But if you *master* C, you could make many times what you'd make with JS.
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.
@@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.
@@FoxFavinger You're still a baby--I'm damn near twice your age😞 Enjoy your youth😁!
@@yapdog How about me. I'm 19.
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
Nah you just don't know how to use JS. I have worked on multiple large scale backends built on node. They work fine.
@@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
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.
Golang is actually a good middle ground for server side applications.
@@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!
BASED. never agreed with a Jon blow opinion more in my life!
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.
To do, this you have e to use smart pointers everywhere
@@llothar68 you clearly don’t understand what I’m talking about.
That’s why I only code in Java
What's harder, game development or system programming?
Isn't game development(programming) a form of systems programming?
@@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.
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.
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.
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.
Pascal is the best programming language
*Turbo Pascal
Odin and jai both have some pascality to them
Not since it was superseded by Oberon.
@@vitalyl1327 I'm very interested in Oberon, Wirth's reaction against C++
The golden middle is to use C++ with templates, consteval and destructors, but without RTTI, exceptions, STL and all the "modern" garbage.
The only feature C++ has that I’m jealous of is platform atomics tbh.
So pretty much JAI
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.
@@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 ;-)
@@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()) { /* ... */ }
if it's harder then i guess you should respect people who write JS more so than berate them
Are there ANY sizable, complicated JS programs out there? Ever?...
unfortunately there are...
For example, variety of front-end frameworks...
Sure.
Google Maps / Google Earth?
lots of JS games out there
Displaying hello world with electron is NOT easy, what is he talking about?
Man, imagine being able to just build desktop app with JS in less than 5 minutes, instead of fighting with electron api...
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.
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.
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.
Prove it
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.
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
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.
Odin and Zig are the new shiny players in this field….
Dude making a 58 second video feel like 5 minutes.
So why he used to use a C++ instead of C?
Because APIs are
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.
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
Code a web server in c. Preferably a modern one that can do asynchronous stuff. I think you will quickly understand why
@@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?
@@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.
@@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
Javascript variables are a guessing game. No data types or hints.
In HTML/js/css a hello world is literally writing the words Hello World
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.
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 😮
C is simple... Remember what Thomas the Tank Engine says: "Simple is better".
"what individual bits are doing"
do you even know what you're saying?
I hope you got the irony 😃 (apparently you did not) . I am qualified enough to know what I am saying ( both academically and professionally).
@@RedionXhepa yeah, I'm sure you are
Love TypeScript and Golang, I don't need anything else 🤑 :)
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.
You just said "always".
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
Can be more productive on the beginning of a project, but it makes you lose productivity on the long run.
@@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.
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.
For big projects Rust is the best at this point
Downvoted