3 ms·
Nothing wrong with it. The only downside is having to either use RAII(C++) or SESE. RAII removes pretty much all pointers and wraps allocations in a class. SESE
by maldev 3y ago
Nothing wrong with it. The only downside is having to either use RAII(C++) or SESE. RAII removes pretty much all pointers and wraps allocations in a class. SESE is using goto's and only returning in one location and all the variables at the top so you don't bypass control flow. Otherwise you have a coding style that can cause issues with memory leaks.
Languages like Go are designed so that someone who's not familiar or wants to use these patterns can write safe and good code. And ALOT of people are complete idiots at c and c++ in a good fashion. You can see the most obvious and horrible programmers making critical things like routers who just have the most blatant bugs or bad practices. And what you don't know, you don't know. So these people exist in bliss pushing shitty horrible, bug ridden code. ANd using these coding styles which prevent that are extra tedious and annoying.
For libraries, try to use VCPKG to find and build new ones to statically link. You also need to learn about compiler definitions, like declspec. And need to worry about alignment on some things as well.