This Habit Separates Average Programmers From Great Programmers
No matter what language you specialize in, writing clean code is a crucial skill for all software developers to have. Being able to write clean code will enable you to scale projects more efficiently and make you easier to work with. Most people underestimate the amount of time it takes to figure out how a block of code works when it wasn’t written by themselves. If people on your team have to spend an hour just to figure out how your code works, this means they have less time to work on growing the project.
Although this is probably common sense for most programmers, it goes without saying. It’s better to have too many comments than to have not enough. Trust me, everyone around you will thank you for writing helpful comments within your code. In fact, I was once paid a bonus for writing comments that made my code much easier to understand.
When writing comments within your code, try to explain only a specific block of code and be as detailed as possible. At the same time, avoid writing comments that are longer than a line or two. This could actually end up having the opposite effect and make your code more confusing.
Modular programming is a design principle that makes reading code much easier for other developers. The easiest way to explain modular programming is by imagining one main file that contains references to “sub files” the “sub files” contain a block of code that is responsible for only one specific piece of functionality.
Modular programming is slightly different from object oriented programming. With modular programming you define all code relating to a specific piece of functionality. However with object oriented programming you define only a specific object that will likely be used in multiple places throughout your project.
Have Common Sense
A big problem I see with newer developers is they use seemingly random names for variables and other objects. This is especially confusing for other developers who are trying to understand how your code works. This is also just a bad practice to get into since it could very easily become a habit.
Writing clean code is something you will get better at with practice, however it is a habit you should start working on sooner rather than later.
One More Thing
For general questions or business inquiries feel free to contact me at firstname.lastname@example.org