This blog is not intended to make you feel bad about your coding skills. Let’s be honest we make mistakes and that’s the point we can learn from. Been in the IT industry for almost a year, I do make a lot of mistakes every day, but looking back at a time that rate changed from hundreds to ten or fifteen. Make mistakes, learn from it & don’t be ashamed of that. Today I’m going to point out some mistakes I did as a programmer and how I learned from it. The list is just in random order.
When we are assigned to write a code for a specific functionality without adequately understanding the problem statement or without any planning, we jump off and start writing codes. It needs planning & research. Think of writing code as art. You can’t jump off and start drawing you’ll have to plan what you want to draw, how you are going to draw, what are the things you are going to need to draw that. Same goes for writing codes also. You need to plan how you are going to solve the problem, research how to make it better, data you are going to need to complete the functionality. If you are working with a team, discuss with other members, plan your goal, draw diagrams, take notes, to make everything clear in your mind or if you are working alone, give yourself some time to think of possible solutions and choose the best from them and then start writing.
One of the great mistakes was to jump in and start coding without thinking of the impacts or anything. It might work for small projects but not for big ones and once done check and recheck every line of code. Make it even better.
Like I told already think of writing code as art. Your art should be beautiful, right? So why your code shouldn’t be? We often make the mistake of not following some standard protocols to make codes readable.
Choose variable names wisely. Your variable name should describe what kind of data it’s holding. For instance, I am fetching some students data from the database of a particular school using Laravel.
$a = Student::where('school_name', 'LIKE', 'ABC')
$students = Student::where('school_name', 'LIKE', 'ABC')->get();
Which variable name suits better for the data you are fetching? It’s $students, right? Same goes for function names, classes names and other files name.
Write documentation before each function. What parameter it receives, what the function does, what it returns, comment in some lines if needed. So that whenever another person reads the code, it’s readable for him. If your code is not readable, it’s complete trash.
Avoid duplicating codes. If you need specific functionality in different places, you shouldn’t write that code in different files every time. Just write it in some other file. And, call the function from where you need.
Follow MVC rules. Write the different type of codes in different files. Make separate folders for separate fill types.
Use spaces, comma, new line where necessary.
Another mistake we always do is not to follow along and write code while watching tutorials. It’s a good practice to watch and write code that helps you to understand better. That’s an excellent chance to practice what you are trying to learn.
Reading the documentation of a programming language is a must. Most of the time, we only focus on just watching tutorials. But, it’s always better to read the official documentation of the programming language you are trying to learn. It gives you the inside of that language also a better understanding of every features that language provides.
Most of the time, we focus just on the functionality without giving much thought about its performance, user input validation, security vulnerabilities We have the habit of assuming everything works. Every line of code should be bulletproof, that means 100% performance in any possible scenario.
We are human beings. It is a fact that we are not perfect & we don’t know everything. You always have something to learn. But, when you start to think that you know everything that will be your greatest mistake of all time because, when you lose the interest to learn anything new, and if you are not learning anything new, you won’t survive in this ever-growing IT industry. If someone finds out mistakes in you, appreciate them. Appreciate code reviewers. Take their suggestion into accounts.
It’s always good to ask for help if you are stuck somewhere for a long time. Talk with experts & discuss your issue, they might guide you for a solution Learn to search in google. There’s 99% possibility that the problem you stuck on right now someone else must have faced that too. They may have asked it on forums, and some others may have given some outstanding solutions. Learn to R&D, and the best way doing that is to Google it and find out the solution, you are looking for.
The number one mistake you can make as a beginner programmer is to think you’re not good enough, not smart enough and you’ll never get it. I believe that anyone can learn to program to at least a basic level if they stick with it.
Code may seem like an incomprehensible wall of alien language at first. That’s normal! But, bit-by-bit you learn what each part does, and it’s not scary anymore, and then you see it’s really all very logical when you know what it means.There’s an element of natural talent for programming and logical thinking, but it’s massively outweighed by hard work and hours spent plugging away at your code, reading tutorials and looking-up documentation.
Master your fear, or fear will be your master!
That’s all that came out of my head while writing this blog. Surely I’ll make many mistakes & learn from those in the future. And I will share those too. Till then keep on coding, make mistakes, learn from them, start improving your codes.
Want to receive a fortnightly round up of the latest tech updates? Subscribe to
our free newsletter. No spam, just insightful content covering design,
development, AI and much more.