I think making code self-explanatory, without need for comments all around the place, is a big advantage. But could you suggest methods and techniques how to reduce the amount of code, make it more readable and understandable.
Also what do you think are the good techniques for reducing big if statements
and nested for loops
and other structures which sometimes are hard to understand at the first glance.
Here are few of the things I thought would my C# application more readable and self-explanatory:
foreach
loops into LINQ
statements.Also suggestions about the books which covers these topics would be appreciated.
I recommend you take a look at Clean Code by Robert C Martin. It's an entire book dedicated to writing readable code. Highly recommended if you ask me.
Resharper is also very useful as it has numerous suggestions for naming, reducing nesting and the like.
Aside from syntactical/structural considerations, consistency is extremely important - code styles and formatting preferences vary, which is fine, but within a project you should standardise as much as posibble to avoid having to keep readjusting yourself as you read through the code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With