Some tips that made me code better.
Tags: codequality, codereview, career
Published: 2019-03-15 01:47:24

---
title: Some tips that made me code better.
published: True
description: I decided to list some situations that made me improve how I should create my code
tags: #quality #codereview #career
---
As a programmer, for some time I had a hard time to find a good way to code better, in order to make my code work just fine. Just like an artist who wants his art to be understood and appreciated by other people, we want other programmers to understand my work, especially if I work with others who have to use my code to create new functions.
<h3>Lack of standards</h3>
We do not have a manual how to code, in addition, each programming language has its characteristics and recommendations to build a project, from its structure to its coding, so we do not have many standards to code, at least in those years, I I have never seen a "philosophy of how to write systems", this turns out to be the responsibility of our experience over time, but since each one has different experiences throughout life, we can have valid encodings with advantages and disadvantages of each other and yet , are very different.

For these reasons, I decided to list some situations that made me improve how I should create my code ...

##1. View open source projects on GitHub
See how great projects are done, and how programmers code inside them. There are some people and theories who argue that one way to improve yourself in a sport or some skill is to see how a very good professional in that area or sport acts, in programming is almost the same thing. GitHub helped me a lot with this, I went after some .NET projects that had a strong community and were up to date. View community projects helped me:


<ul>
<li> Understand abstract concepts of <strong> design patterns </strong>, such as SOLID, CQRS, DDD, TDD, Abstract Factory, Singleton. These concepts even help us make better and more cohesive codes. </li>
<li> Helped me find ready-made functions that are very generic, like sending an email, an SMS, retrieving a password. </li>
<li> Understand important features of the language paradigm, in case object orientation </li>
<li> Learn the language resources I use, which I would only find reading through all the documentation. </li>
<li> Help me understand using the <strong> Ubiqua </strong> language, which I highly recommend </li>
</ul>
 
##2. Create your code so the lay person can understand.
<blockquote> The appropriate use of comments is to compensate for our failure to express ourselves through the code
<p style = "text-align: right;"> - Robert Cecil Martin, Clean code </p>
</blockquote>
There are ways and ways of coding, but to say that there are good and bad ways of coding. I always try to think of some rules that prevent another person from looking at my code and thinking "What the fuck is this that I'm reading, I do not understand anything".

<img class=" aligncenter" style="max-width: 100%;" src="https://i.pinimg.com/originals/c4/8f/91/c48f917bf087db5d30b791465daba2de.png" width="331" height="261" />

It's no wonder that <strong> code review </strong> is being a very accepted technique among programming communities, to improve the quality of your code, I try to follow some rules:
<ul>
<li> Using "CamelCase" to write my code, there are other options, but that's what I like the most. </li>
<li> Use as little as possible Ctrl + C / Ctrl + v in my code </li>
<li> Leave my methods with at most 3 ~ 4 <strong> if / for / while </strong> nested </li>
<li> Put each statement a comment, saying what I'm doing and what, (projects using the <strong> Jupyter Notebooks </strong>, are great to understand this, have several in GitHub) </li>
<li> Have the least documentation, even a readme </li>
</ul>
<h2> 3. If you do not know how to start creating a better way to encode, download a program that does it for you. </h2>
There are several options in the Plugins market that review your code and propose better solutions for coding, some examples are:
<ul>
<li> <a href="https://www.jetbrains.com/resharper/"> Resharper </a> </li>
<li> <a href="http://www.codemaid.net/" target="_blank" rel="noopener noreferrer"> CodeMaid </a> </li>
<li> <a href="https://www.devexpress.com/products/coderush/" target="_blank" rel="noopener noreferrer"> CodeRush </a> </li>
<li> <a href="https://www.freeformatter.com/html-validator.html" target="_blank" rel="noopener noreferrer"> FreeFormatter </a> </li>
<li> <a href="https://developers.google.com/web/tools/lighthouse/" target="_blank" rel="noopener noreferrer"> Google Chrome Lighthouse </a> </li>
<li> <a href="https://www.devart.com/dbforge/sql/studio/sql-analyzer.html"> SqlAnalyzer </a> </li>
</ul>
There are other options that can help you write code directly through your IDE, so going after tools and language features can help us create better codes.

<strong> [Conclusion]: </strong> There are several other ways to develop good ways of coding, after all if you take the time x to make your code and not think about it right, someone will take 2x, 3x, 4x. .. * x to understand your code and fix it if necessary so take good care of your code, and you will be an excellent programmer. And for you, what things makes you code better?: