Comments by "MrAbrazildo" (@MrAbrazildo) on "The Good And Bad Of C++ As A Rust Dev" video.
-
4:55, I don't use to have much problems with types. In games, they use to be way different from each other. For instance, if you mem. some data in a class, it will sooner than later be packed into bits. If you put some other object, when that 1 was expected, a compiler error will arise.
6:47, games are too wild to not use OO. They require proper encapsulation, in a level that FP can't provide.
13:34, I think a better design is to have several containers, 1 for each type. So 1 could has 1 for the white-hat guys, other for black-hat dudes, other for things, and so on. And those holding just data control, small stuff on stack, 100x faster. Only for multimedia, really large data, those smart-pointers would apply.
So another container on the stacks holds inf. for composing the scene: the index and container of things present in a certain moment. So data for other containers will be reached via indexes, avoiding the pointer invalidation problem - and also being much faster, since most data were computed on the stack.
14:17, sure. But doing this it'll be horrendously slow. The idea is to avoid the reallocation, for at least 90% of the time. So std::vector::reserve preallocates enough memory for that.
24:44, I heard that zealling feelings attract them.
26:18, it's possible to create a macro for both - so that both are changed together.
1