Question: Give one piece of advice that forever changed the way that you code?
The best tip that completely changed the game for me as a programmer was –
“You should only require one weekend to master a programming language that’s new to you”.
Did this sound unreasonable to me? Yes, it did at the time when I first heard it from a professor. Now looking back on the experience, it makes total sense to me.
Similar to most people when new to coding, I used to quantify my skills in coding according to how many programming languages I knew. I also spent a lot of time trying to pack in online courses about new programming languages into my brain. Despite having tons of languages on my resume, I was still a bad at programming.
The focus of coding is not about knowing a ton of programming languages. The point is all about understanding how to tackle a larger problem, divide the problem into smaller challenges, and then solve each smaller challenge one at a time until you reach the ultimate solution.
Yes, coding is a form of art. As an art form, coding is something that can never completely be mastered. Regardless of how good you view your code, there’s always somebody who’ll recommend an approach/heuristic/practice that improves upon what was done yet implements the very same end result. In fact, even after I review old code that I wrote months ago, I will instantly begin to spot pieces of code that I could improve. The more and more you program, the more you understand and learn something new. There’s no end to it (an infinite loop, lol)!
The main takeaway here is that learning tons of programming languages by cramming them into your brain is useless. If your goal is to become phenomenal at programming, (1) try to understand the fundamentals correctly first. (2) Then, try to solve tons of online problems and challenges. Write a bunch of programs in any software language. Attempt a problem and see what the different smaller problems are that you must also solve. Once you understand a problem, see how each sub-problem can fit within different programming functions.
What can serve as the different modules of the problem? Are you required to write custom classes for your program? If the answer is yes, then go ahead and implement those custom classes. Finding a solution to a problem doesn’t simply mean “coming to the solution”. If you want to excel at programming, then you the best thing to do would be to always try to find an “optimal solution” to the task/problem while also ensuring a flexible, highly modular, and understandable code. Anyone who is willing to modify and/or understand the code that you wrote needs to be able to do so without needing to spend tons of time reading the code to understand what “ridiculous” things you have wrote.
Once you develop these habits with any programming language, learning (in fact, mastering) a new programming language will turn into a weekend task for you.