Why you shouldn’t stick to only one programming language?

May 15, 2021

A test image

During the freshman year of my university, I had a lot of curiosity about learning a new programming language and I always enquired others which one to get started with, then many of my seniors, acquaintances, and other experienced developers advised me to start learning one programming language and stick to it until the very end, that is probably the best choice you could make if you want to end up as a good and efficient coder.

The day came when I was exploring most of the languages, watching tons of YouTube videos, confused and frustrated, by the end of the day, I chose “C++”.

I had the thought of “sticking to one programming language till the very end” embedded very powerfully on the back of my mind and because of that, I did not even look at other languages. That definitely narrowed down a lot of things for me. Probably the worst mistake to commit at that time. Why? Let me get there in a second.

Since I chose C++, I could write literally all kinds of codes using it, from solving Data Structure and Algorithm (DSA) problems to implementing different kinds of algorithms in the stack development processes. I felt satisfied and happy that I learned one language and kind of got good at it until I faced a real problem. I was working on a project and came across an issue where I had to parse a large number of data files, I was so keen on writing the parser using C++ that I didn’t even think of doing it in another language, that would’ve made the work much easier.

I finished coding the parser after 2 days and everything was written in C++, when implemented the parser failed and crashed awfully without parsing any of the given data files. Googling for hours and scrolling through StackOverflow did not work at all. Then I contacted a good friend of mine who is a skilled developer in this field and all he did was, wrote a single line of a bash script, and BOOM! All the data files were parsed successfully without any error. It was faster than usual and much efficient than I ever would’ve made it.

I realized something that day, that my mind was thinking only through a single perspective which cut down a lot of plausible ideas, and was so keen on learning a single kind of language, that I didn’t explore other stuff that would’ve made the problem-solving much easier. There are many similar examples that say the same thing, especially the typical debate over java and python. I’m not saying sticking to one language is bad, it’s just that, if you could broader your sources of learning and learn different kinds of techniques to approach any problem then you probably will be much more efficient than someone who knows a single skill.

As a programmer, I’m expected to solve real-world problems not to write a code in a particular language. If all I know is writing codes in C++ then some of my solutions are going to be a massive waste of time and money either for myself or for anyone I'm working for.

So rather than mastering one programming language, master problem solving and how to solve any kind of problem efficiently and with a broader perspective.

Let me know what’s your favourite part of problem-solving or any incident that brings you to the same state I was in back then.