Good Software Development Practices

Kenneth Yu
4 min readJan 16, 2019

--

Through code reviews and internships I learned some helpful guidelines to help improve the readability and quality of my code. This blog will be about some of the things that I try to keep mind whenever coding. These practices should be universal amongst all languages!

Whiteboarding

Before even coding, you should always try to draw out or whiteboard any thoughts you have as a solution. This is the same idea as creating an outline before writing an essay. Whiteboarding allows you to sort through your logic and plan a methodical approach. Use some time to plan now so you don’t waste time coding out a solution that might not work later!

Getting good at whiteboarding is pretty important because it’s common during job interviews! Practice speaking out loud while whiteboarding your ideas.

Indentations

It is super important for your code to have clear indentations. Without regular indentations, it is easy to lose track of beginnings and ends. This heavily affects the readability of your code for both yourself and any other developers who need to work on your applications. Be sure to get into the habit of adding indentations and soon enough you won’t even be thinking about it!

Keep in mind that some languages like Python must be properly indented or else it will not run.

Comments/Documentation

Adding comments or inline documentation to your code is a great habit to form because it helps explain what your code is doing. This is beneficial to other developers who are adding features or maintaining the application. Without reading your code, they should understand what your code is doing. This will actually end up helping yourself as well. Imagine developing an app and going back to it months later. You’re not going to remember every nuance of your code. Any comments or documentations that you add will help you remember what your code is doing without you having to read it line by line!

Keep comments meaningful to avoid clutter!

Efficiency/Scalability

While it’s good to know about the “Big O notation” for efficiency, you don’t need it to think about efficiency or scalability. Whenever coding, you should always be thinking about what would happen if you had large sample sizes. While it is completely okay to code a solution that just works, you should always be thinking about how it could be improved.

Note: More on Big O in a later blog!

Refactoring

It’s always a good idea to go back to completed code to check formatting, add additional comments, and efficiency. I enjoy hacking my way through multiple solutions of the same problem. This allows me to familiarize myself with different approaches AND determine which method is the best for what.

Code Review

Always try to code review with a peers or mentors whenever possible. Not only will they teach you new methods of solving a problem, but they will also give you valuable feedback on the readability of your code. I used to be super notorious for writing these elaborate algorithms and then a colleague would look at my code and literally ask me why. Code reviews really changes your perspective and allows you to approach problems from many different angles.

Hopefully your code reviewer isn’t like this…

--

--