Have you ever been stuck or gone blank trying to solve a problem related to something that you just learned from YouTube or Google tutorials? You seem to understand every line of the code, but without the tutorial, you find yourself in a difficult position. If you have looked at problem-solving in HackerRank or LeetCode, you can relate to how an aspiring programmer feels seeing those challenges for the first time. Everything seems out of the box! Being unable to apply what you learned from a tutorial might make you doubt your knowledge and abilities as you begin to understand the basics of the programming language you're learning.
Putting programming tutorials into practice
Should you start back at the beginning? If you do that, you may soon find that you've covered those topics more than enough times. Starting from scratch is not necessarily a waste, but how can you be more efficient?
Memorization is simply not the solution in programming. Having said that, you cannot neglect the importance of getting used to syntaxes. There is a significant difference between memorizing and making a habit. The latter is difficult to break. Make a habit of playing around with the programming language's regular syntaxes, functions, methods, patterns, paradigms, and constructs to ace it. Acing a programming language involves a lot of creativity and practice. It is essential to practice syntaxes until they flow as smoothly in your brain as the blood runs through your veins.
How problem-solving works
How you approach solutions depends on many factors. These factors could be anything from technical constraints to user needs. The world has innumerable problems and there are many ways of solving each. Deciding on the best way involves extensive problem-solving skills.
Here is a simple example. You need to achieve a result of 6 by adding two numbers. You can accomplish this several ways:
3+3=6 or 4+2=6 or 5+1=6
Similarly, say you need to achieve a result of 6 by using two numbers and either subtraction, division, or multiplication. You have many options, including:
8-2=6 or 12/2=6 or 3*2=6
Each solution may have a different constraint. You must consider all of these when developing effective real-world solutions. Is the solution feasible? Accessible? Interoperable? Scalable? Minimizing the constraint and developing an optimal solution depends on the business need and type of problem.
The goal of programming is much more than problem-solving. Understanding how the code functions from an engineering perspective is always an advantage. That's where code reviews come into play at an enterprise level. The bare minimum requirement in programming is to have basic coding knowledge, including the language's syntaxes, functions, and methods. At the end of the day, coding is what you do, so practicing always helps improve your skills. Fluency in writing and developing complex solutions comes with consistent practice and learning.
Learning to code
My goal for writing and sharing this article is to encourage new programmers to seek the great problem solver in themselves. Please don't stop believing in yourself.
There are many habits to nurture for successful coding. Here are my ways of staying effective while learning to code:
- A cheat sheet of syntaxes, methods, and functions can come in handy.
- Break problems into smaller parts to make them easier to follow.
- Try to understand the core concept of how code functions.
- Try to improvise with your solutions but always stick to the basics in the beginning.
- Create as many applications and components as possible while practicing.
- Never copy/paste code from open platforms like stack overflow/exchange, especially without understanding the context.
- After following the tutorial, try to build everything from scratch. If you manage to accomplish half of it by yourself, that's still an achievement.
Good luck to all of us.