Comments by "MrAbrazildo" (@MrAbrazildo) on "Stop Using Rust Use C++ | Prime Reacts" video.
-
7:07, I think C++ fits in this article even better than C#. However, it requires the user to develop "some feelings", if he chooses to use default behavior/resources, instead of developing his own defensive tools. For instance, my 1st thought after certain action(s) are set to:
- Check the result of a f() or algorithm right away.
- If what matters is index where a pointer stopped after an algorithm, I get rid of that pointer at once.
- For things that I'm used too, I write as fast as I can (favouring productivity). When something starts to be unique, I proportionally start to get slower and more reflexive about (favouring defensiveness).
When things get complex or I'm failing often (for whatever reason), I stop everything to write a tool to lock the right behavior forever, going back to be faster/productive. So things go inside f() or classes (yes, including setters as nonpublic) , only 1/few way(s) to reach them, putting as many layers of protection as needed (thanks to C++ high functionality), whatever needed to reach productivity once again, because I value doing things without thinking twice, in crazy fast typing fashion.
So C++ fits in this article purpose of proportionality production, according to its complexity. An example:
I was working from picking values from a string, by pairs. I decided to use its default behaviors. I wrote fast, everything works predictably. No need for fancy tools nor languages. Then I decided to optimized it, by using a pointer that made 2 steps per cycle. It got expressively faster. It was also fast to develop, and worked flawlessly. So I left the computer, with my 15487th easy victory using C++.
But my gut feeling said to me that I wrote too fast something that I'm not used to. So, calmly drinking a coffee, I made a brief reflection about it. Mentally I discovered that the 1st step from the pointer was immediately checked, as I use to do, but not the 2nd. So it would step beyond array boundaries on the last 1, in some cases, whenever the f() didn't return before. Easy check, easy fix, I just added 1 line check for that.
1
-
0:13, C++11 is the "must see" 1. From that, only minor good features have been made. C++20 is now a game-changer, but it's more related to high level features than performance or middle-to-low level functionalities.
0:38, oh... really nice to know that.
2:51, this is what I believe C++ is able to achieve. But that's not its default behavior. 1 should go (sometimes struggle) for it.
7:43, maybe because of its complexity, it feels solid among the complexity of a project. I was making 1 in 2 steps, the 2nd "as a superset" of the 1st. I basically inherited all the 1st step as basic classes for the 2nd. It worked amazingly! Of course I had to amplify things, but no extra problem was added by that. And the classes were organized by data, not so much by meaning. Even so, the whole previous meaning worked for the 2nd, and no performance penalty was added, beyond what was inevitable from more work to do.
9:40, delete all of them, letting the compiler pointing you the missing ones.
1