I see you don't use exceptions. This gives me much relief as I really can't stand them. Thoughts? C++ is indeed a great language, but a negative against it is its sheer size. Likewise the standard library is nearly boundless in scope. On the other hand you can pick and choose what you want to use...
True! I never liked exceptions. Unlike RAII, they actually do obscure control flow, often to a painful degree. The "pick and choose" aspect of C++ is one of its greatest strengths IMO. And that you only pay for what you use. I tend not to use the STL at all, and as a result my programs are nice, tight and pretty fast to compile! ... there might be some bias at play about the "nice" part, of course. :)
Oh yeah, you can make them work.. but I really don't want to. I like my C++ without exceptions and RTTI. I would like RTTI better if I could control how the compiler stores the type information, but since I can't, I just implement my own when I need it :)
Exceptions are just goto with a different name really. In 2006 ish I wrote an Instant Messaging (MSN, ICQ, GoogleTalk etc) filtering proxy in basically C with a few classes and bits of the STL. It was great just having those things on top of C. But using the language in team projects scares me because some projects/teams will use every single language feature/STL feature, which would cause a massive cognitive load. So the size and scope of the language has to, unfortunately, be considered a downside. Luckily with Serenity, like me with my IM proxy, you are in charge.
I do like C++. The language I use at work (php) has a few similarities with it, but quite a few things are different, especially in inheritance. I have been bitten by this so many times, but hey, still enjoy doing stuff in C++
I actually quite like PHP as well. It's really fast to get something quick&dirty going with PHP, and it's way more forgiving than e.g Python or Ruby. I never understood why PHP isn't more popular as a non-web scripting language..
@@awesomekling One of the big issues people have with php is how quick&dirty many projects are. This is not the fault of php but the programmers but people still blame the language. Hey, you have an OS, put in a scripting language, make it PHP :D. Windows has powershell, linux has bash, you'll have PHP
@@awesomekling I know of a couple of guys who used to do rescue data from damaged hard drives, and other IT consulting. I think they knew C++ pretty well, but they wrote all their internal tools in PHP.
Hi Jiří! I think it sounds great in theory and I'm very interested to see how it turns out in practice. I'm definitely going to start using them when they become available in a compiler :)
What do you think about exceptions? i ask because i noticed libAK doesn't have any exception class, which leads me to assume you dont like them, or at least you prefer the ErrorOr pattern over it, however in this video you say you like constructors but how do you deal with that when constructors pretty much requires you to use exceptions (considering you cant return anything obviously)?
I'm interested to hear what your C++ dislikes are Also, obligatory: have you tried Rust? You were almost baiting for that question talking about generics, references, null pointers, lambdas and ranges
Answered: th-cam.com/video/zuRBhxxaQ1g/w-d-xo.html :) As for Rust, I’m sure it’s okay and if it makes someone productive that’s great. The evangelism around it is obnoxious though.
@@awesomekling Love your videos. Have watched a few lately. I was surprisingly turned off by your answer about Rust ( which I have not used yet ). No strike against you per se. You are certainly not the only one turned off by overzealous Rust advocacy. That said, it would bug me to see a comment complaining about somebody that passionately evangelized consistent, professional UX, 90's era Human Interface Guidelines, UNIX / POSIX design principles, or clean vertical integration in an OS. I guess I am attracted to the passion more than I am turned off by the evangelism. Seeing people get criticized for their passion makes me sad. Loved your video on TempleOS. I wish you saw some of the same beauty in Rust ( or its advocates I guess ). Again, this is not meant to be a complaint against you; it is only meant to be a commentary on the world as I wish it was. Please do not take it as a lecture on what opinions to have or how to share them. Glad you like C++ so much. I agree with your video comment that C++ would benefit from more consistent move semantics and fewer buffer overflows. I agree with most of the opinions you share. I guess that is why I notice the ones where I do not.
Hi Justin, this was quite a while ago now. I have since spoken to people from the Rust team and learned that the unpleasant people who were spamming people/projects about how they should rewrite everything in Rust were part of a decentralized smear campaign designed to make the Rust team look bad. In retrospect I should have realized this, but I didn't think critically. That's my bad :)
@ok Obviously; I see his point as "invalid". Just as a reference can be "invalid". Also references are just "static pointers" that cannot be changed, and thus are infinitely less flexible. Just as a static pointer can point to invalid memory, a reference can be invalid and also point to invalid memory, because they are SAME thing. No there is no "cognitive overhead", in C, as the same exists in C. What C offers is much more flexibility.
@ok Nulls are not the problem. A null value may be the correct value and does not mean there is an error in the program. In fact, most programs (should) initialize pointers to null and thus when an object is created and assigned to a pointer, the null condition can be used to to gracefully error check if an object was created or not, and whether it needs to be free it or not, or whether something has failed, etc. Thus nulls are not the problem, they are actually needed, used and accounted for in C systems programming. To the contrary, an invalid reference or pointer is the real problem. C++, (and Java much worse), really complicates, and abstracts too much. If someone wants to program in C++, and it's mechanisms, like templates, references(static pointers) etc. fine. But I see C++,Java, C#, etc. as cognitive overload....and I use to program heavily in C++ MFC(microsoft foundation classes) way back in the day. Then later in Java and C# for some years. And also did many native C++ Carbon apps in Mac, before C++ Carbon was deprecated in favor of Cocoa objective C. But now I have switch to C, and won't look back. programming in C is like playing a video game in "god mode" , anything is possible.
@ok also there is also this thingy called "static". If you cannot write a program setting a static pointer, which is set ONLY one time in the program to the intended value, I can safely say you should NOT be programming.
@ok This is getting little tiring... first, static variables don't need to be global in C. Second, whether one uses const, or static in C, they are intended to be set one time. Thus whether static or const (to clarify so you understand) in C are set ONE time, and if a programmer cannot do that one single assigment well, they probably need to look into learning how to program better rather than hoping some language abstraction will help them. Again there is no advantage in references as they are really just static/const pointers under the hood. And you will say, oh but reference can not be null, and neither can static/const if the programmer takes 2 seconds to set them right, as they are set ONLY single one time. But again NULL, is not the problem, invalid memory locations are. And while on the topìc of OOP, OOP is probably even more obsolete than globals, where data oriented programming has shown to be much more efficient in design than OOP and in fact the "inventor" of OOP Alan Kay, is now saying OOP abstraction is being abused. Thus Abstaction is really becoming "obsolete". Just look at Vulkan vs OpenGL, which is reverting the "abstraction" trend. Obviously OOP in moderation can be useful, but is not the holy grail, in fact, in excess may be the opposite.
I agree with all of these good things. C++ has really improved since 98
I see you don't use exceptions. This gives me much relief as I really can't stand them. Thoughts? C++ is indeed a great language, but a negative against it is its sheer size. Likewise the standard library is nearly boundless in scope. On the other hand you can pick and choose what you want to use...
True! I never liked exceptions. Unlike RAII, they actually do obscure control flow, often to a painful degree.
The "pick and choose" aspect of C++ is one of its greatest strengths IMO. And that you only pay for what you use. I tend not to use the STL at all, and as a result my programs are nice, tight and pretty fast to compile! ... there might be some bias at play about the "nice" part, of course. :)
Oh and also... I found a little bit of a pain make C++ exceptions work in a kernel.At least with gcc.Same with RTTI.
Oh yeah, you can make them work.. but I really don't want to. I like my C++ without exceptions and RTTI. I would like RTTI better if I could control how the compiler stores the type information, but since I can't, I just implement my own when I need it :)
Exceptions are just goto with a different name really.
In 2006 ish I wrote an Instant Messaging (MSN, ICQ, GoogleTalk etc) filtering proxy in basically C with a few classes and bits of the STL. It was great just having those things on top of C. But using the language in team projects scares me because some projects/teams will use every single language feature/STL feature, which would cause a massive cognitive load. So the size and scope of the language has to, unfortunately, be considered a downside. Luckily with Serenity, like me with my IM proxy, you are in charge.
Love the point you made about passing parameters by (const) ref !
I do like C++. The language I use at work (php) has a few similarities with it, but quite a few things are different, especially in inheritance. I have been bitten by this so many times, but hey, still enjoy doing stuff in C++
I actually quite like PHP as well. It's really fast to get something quick&dirty going with PHP, and it's way more forgiving than e.g Python or Ruby. I never understood why PHP isn't more popular as a non-web scripting language..
@@awesomekling One of the big issues people have with php is how quick&dirty many projects are. This is not the fault of php but the programmers but people still blame the language.
Hey, you have an OS, put in a scripting language, make it PHP :D. Windows has powershell, linux has bash, you'll have PHP
I'm really bad at typing $
@@awesomekling I know of a couple of guys who used to do rescue data from damaged hard drives, and other IT consulting. I think they knew C++ pretty well, but they wrote all their internal tools in PHP.
how about c+=14: auto returns, generic lambdas, c++17: guaranteed copy elision, structured binding? c++20: coroutines/generators.
What do you think about modules in C++20 ?
Hi Jiří! I think it sounds great in theory and I'm very interested to see how it turns out in practice. I'm definitely going to start using them when they become available in a compiler :)
@@awesomekling Any update on this?
Do you have a link to that smart pointer you wrote for work? Would love to see it.
What do you think about exceptions? i ask because i noticed libAK doesn't have any exception class, which leads me to assume you dont like them, or at least you prefer the ErrorOr pattern over it, however in this video you say you like constructors but how do you deal with that when constructors pretty much requires you to use exceptions (considering you cant return anything obviously)?
Only C for me.
Mad lad!
Agreed C is the best!
@@brian_n_millar I did the opposite. I used C++ for more than 15 years, and now I have switch to C for the last years. So much better!
Because C++ is the best language!
I mean aside from Haskell of course :)
Obviously :)
@@user-hufgfdsddssdfdsdsdsdd2 hahah, no C++ is best, but I had to write a Haskell compiler many many years ago
I'm interested to hear what your C++ dislikes are
Also, obligatory: have you tried Rust? You were almost baiting for that question talking about generics, references, null pointers, lambdas and ranges
Answered: th-cam.com/video/zuRBhxxaQ1g/w-d-xo.html :)
As for Rust, I’m sure it’s okay and if it makes someone productive that’s great. The evangelism around it is obnoxious though.
@@awesomekling Love your videos. Have watched a few lately. I was surprisingly turned off by your answer about Rust ( which I have not used yet ). No strike against you per se. You are certainly not the only one turned off by overzealous Rust advocacy. That said, it would bug me to see a comment complaining about somebody that passionately evangelized consistent, professional UX, 90's era Human Interface Guidelines, UNIX / POSIX design principles, or clean vertical integration in an OS. I guess I am attracted to the passion more than I am turned off by the evangelism. Seeing people get criticized for their passion makes me sad. Loved your video on TempleOS. I wish you saw some of the same beauty in Rust ( or its advocates I guess ). Again, this is not meant to be a complaint against you; it is only meant to be a commentary on the world as I wish it was. Please do not take it as a lecture on what opinions to have or how to share them. Glad you like C++ so much. I agree with your video comment that C++ would benefit from more consistent move semantics and fewer buffer overflows. I agree with most of the opinions you share. I guess that is why I notice the ones where I do not.
Hi Justin, this was quite a while ago now. I have since spoken to people from the Rust team and learned that the unpleasant people who were spamming people/projects about how they should rewrite everything in Rust were part of a decentralized smear campaign designed to make the Rust team look bad. In retrospect I should have realized this, but I didn't think critically. That's my bad :)
@@awesomekling Well that's news! I've always felt that Rust was overhyped.
Like for all c++ developers it is about self hate.
I prefer C
this is a joke video right?
Sorry to break it to you, but C++ references are just C pointers, when you see how they are implemented in assembly.
@ok Obviously; I see his point as "invalid". Just as a reference can be "invalid". Also references are just "static pointers" that cannot be changed, and thus are infinitely less flexible. Just as a static pointer can point to invalid memory, a reference can be invalid and also point to invalid memory, because they are SAME thing. No there is no "cognitive overhead", in C, as the same exists in C. What C offers is much more flexibility.
@ok Nulls are not the problem. A null value may be the correct value and does not mean there is an error in the program. In fact, most programs (should) initialize pointers to null and thus when an object is created and assigned to a pointer, the null condition can be used to to gracefully error check if an object was created or not, and whether it needs to be free it or not, or whether something has failed, etc. Thus nulls are not the problem, they are actually needed, used and accounted for in C systems programming. To the contrary, an invalid reference or pointer is the real problem.
C++, (and Java much worse), really complicates, and abstracts too much. If someone wants to program in C++, and it's mechanisms, like templates, references(static pointers) etc. fine. But I see C++,Java, C#, etc. as cognitive overload....and I use to program heavily in C++ MFC(microsoft foundation classes) way back in the day. Then later in Java and C# for some years. And also did many native C++ Carbon apps in Mac, before C++ Carbon was deprecated in favor of Cocoa objective C. But now I have switch to C, and won't look back. programming in C is like playing a video game in "god mode" , anything is possible.
@ok When "references" are needed, there is the static pointer in C.
@ok also there is also this thingy called "static". If you cannot write a program setting a static pointer, which is set ONLY one time in the program to the intended value, I can safely say you should NOT be programming.
@ok This is getting little tiring...
first, static variables don't need to be global in C. Second, whether one uses const, or static in C, they are intended to be set one time. Thus whether static or const (to clarify so you understand) in C are set ONE time, and if a programmer cannot do that one single assigment well, they probably need to look into learning how to program better rather than hoping some language abstraction will help them. Again there is no advantage in references as they are really just static/const pointers under the hood. And you will say, oh but reference can not be null, and neither can static/const if the programmer takes 2 seconds to set them right, as they are set ONLY single one time. But again NULL, is not the problem, invalid memory locations are.
And while on the topìc of OOP, OOP is probably even more obsolete than globals, where data oriented programming has shown to be much more efficient in design than OOP and in fact the "inventor" of OOP Alan Kay, is now saying OOP abstraction is being abused. Thus Abstaction is really becoming "obsolete". Just look at Vulkan vs OpenGL, which is reverting the "abstraction" trend. Obviously OOP in moderation can be useful, but is not the holy grail, in fact, in excess may be the opposite.