When we’re learning to code, it is quite common that we will make plenty of mistakes. To make it worse, most of the time we don’t know that we are making those mistakes. Mistakes in coding can really make the overall process of learning and coding a headache and less enjoyable for anyone. If you are a beginner learning coding, keep in mind that this article is not meant to make you feel bad about the mistakes that you might be making, but rather to help you be more aware of them and how to fix and avoid those mistakes.
As we start something new, it’s fun and exciting to learn new things that we’ve never experienced or done before, learning programming is no different. We get a sense of accomplishment when we are able to create a project even if it is with guidance and help. Oftentimes, we might overestimate ourselves, assuming we know everything there is to know because we executed well on a guided project. As beginners, we ought to know that there are plenty more things to learn. Keep your head down, and continue to grind because you will never know-it-all, and that’s a good thing.
You want to learn programming because you want to do what big companies are doing? We definitely understand, because we want the same thing too! Remember as you chase after trending topics such as Web3, Cybersecurity or DevOps, these topics are carried out by seasoned programming veterans who have years of experience in coding. As you start your journey in programming, it is vital that you master your fundamental and foundational skills before hopping on trendy bandwagons. As Rome wasn’t built in one day, so your programming skills are not developed in one day too. The faster you master your fundamentals, the more success you will find in chasing trends.
When learning something new, it is good to have fear and doubts, because that’s when you start to have questions about uncertainties and the unknown. Just remember that if you think you can or can’t, you’re actually right, because it will eventually lead you to doing research to clarify your doubts. In the end, you’ll learn something new as a result of that fear and doubt that you have.
Naming variables should be clear and concise, not too long and certainly avoid short abbreviations. This is when having a good set of vocabulary will help in setting clear name conventions.
Ex:
//bad way
//better way
The annoying part of variable naming is when you make spelling mistakes. It’s hard enough to remember variable names, what’s more is when you have to find out which spelling mistake you made, so be sure to avoid any typos in your variable names.
It’s also a good practice to form your own set of naming conventions that are easily identified and remembered as it saves you a lot of time wondering what you called things when you come back to old projects.
Sometimes you might be concerned with how people might misunderstand the codes in the program that you’ve created, then it leads you to comment over each code or stating the obvious with codes that are self-explanatory without having comments over it. To avoid this, just use better names for functions that can eliminate any unnecessary comments. The question to ask before you write comments will be : “Is there a better name for the function that makes my code easier to read?” Commenting is a good practice to have when it is necessary to comment on your codes to answer reasons for using the codes rather than what the code is doing.