E
E
Evgeny Petryaev2020-05-22 22:58:35
Game development
Evgeny Petryaev, 2020-05-22 22:58:35

Independent evaluation of the test case code?

Challenge
5ec825a46e7bf834586600.png
AND code https://github.com/Beginerok/DominiGames and app https://dropmefiles.com/NSpao

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2020-05-22
@gbg

We immediately see the bydlokod:

Game* game = new Game();
game->execute();
return 0;

We observe a pointer leak, which is unacceptable. If you allow yourself this in a test task, what will you do in the production code? The fix is ​​to either remove the pointer altogether, or use unique_ptr()
Using bare pointers is deprecated in modern C++.
We continue the cessation: all the fields of the class are crowded into the public, which is an anti-pattern. A sign of good taste is the complete hiding of fields, so that only constants stick out.
Poor codestyle - function names are neither CamelCase nor underscore_separator, but some kind of hybrid, several variables on one line (a reason to get confused), no comments.
And then I saw this cpp file with no obvious cycles and finally went nuts. It's a shame, you are incompetent.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question