D
D
DanielMcRon2020-02-03 20:44:23
C++ / C#
DanielMcRon, 2020-02-03 20:44:23

Clean code in C #, how to achieve?

Hey! Yes, I already googled and it is interesting to hear the opinion of those who have gone through this (preferably with the
C # language). I strive to write adequate code, to me about the names of variables, methods, etc., etc. understandably. But what piece of code to take out into the method, where to replace it, is not yet clear. Where the code is repeated, something else can be done, but there is little experience to think of making everything more compact and understandable. I saw Robert Martin's book "Clean Code", but everything is in Java, and maybe there is something else.
In general, share advice on how you got through it. Or just the key to success - get a job

Answer the question

In order to leave comments, you need to log in

3 answer(s)
G
GavriKos, 2020-02-03
@DanielMcRon

but everything is in Java

C# is not far from Java. In general, one must be able to abstract from the language . The
key to success is practice, practice and more practice. You won’t get clean code the first time, you don’t have to be afraid to rewrite it and refactor it.
To some extent, designing "on a piece of paper" can help.

T
Tom Nolane, 2020-02-03
@tomnolane

No books will teach you how to write "clean code". Since this skill is acquired only in practice, and in practice in a team where there are colleagues with knowledge / skills higher than yours. Where your code will be code reviewed a million times and you will redo what you wrote 100500 times. And only (can) then, you will write cleanly and competently. Although this is a utopia... and the eyes of cool programmers are blurred and they do not notice any jambs, typos, flaws. Only in a team, with a team, you will learn what "clean code" is.
Pull requests Open source projects to help
Know what letters to write, in what order, brackets, where tabs / spaces, etc. this is not "clean code".
5e3870094d639801170551.jpeg

V
Vladimir Korotenko, 2020-02-04
@firedragon

Read what was advised above, just remember "clean" code does not give you profits, it's just a tool for solving problems.
Testing a limited amount of code
Ease of support
Speed????
Ease of expansion

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question