J
J
JunEternal2022-02-07 02:36:40
C++ / C#
JunEternal, 2022-02-07 02:36:40

Rationality of C# code?

Recently started learning C#. Wrote r##no-code for a simple game according to the task. All that I wanted to start - realized. But after viewing the code, and even while writing it, there was a feeling that perhaps somehow I was not rationally using cycles, operations, and it was possible to write them more compactly without making thousands of conditions. Consider commenting on each line to make it more readable. I would like to hear what mistakes I made in order to avoid them in the future.
Code - https://paste.ofcode.org/ZWDFWib4cZff4Y8Nf5ZyCk

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Myclass, 2022-02-07
@Myclass

Of course, after watching a thousand different things, I want to say. And about non-modularity in your code, and about not using constants, which, by their use, make unnecessary code commenting, etc. But. For a prototype, it's ok. And the fact that you reflect what you created is also good.

N
Nik Faraday, 2022-02-07
@NikFaraday

You need to study or at least read about it:

  • C# classes
  • Multi-project solutions
  • Design patterns
  • Design books

It can take a very long time to fully study, but the result is worth it. Read a little bit from each paragraph and you will learn a lot of new things, which even at this level will help you right now.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question