In this article I will explain some recent thoughts about why learning new languages helps your understanding of how to tackle problems in every language you're coding in.
I've had a lot less time to do programming lastly, so I originally thought I'd focus on one project to at least see some progress. But in all the other time, I had lots of ideas what I should make and wanted to discover new ways to solve problems. Traditionally, like on this page, I use PHP for basic website-style projects that are not webapps. I know it can do it all, but I just never got comfortable with the big php frameworks, so I'm not really building APIs with PHP, just plain old websites. For those other instances, I use Node, which is very practical because of the similarity between client side and server side code. With webapps, you write lots of both and not having to think in different languages is a big benefit.
That sounds like I'm opposed to learning new stuff though, and I recently noticed that in fact I always was kind of reluctant to learn new stuff. I use mysql because I know SQL and don't really want to learn mongo's query language. I use Angular 1 not only because it's more production-ready than Angular 2, but also because I know it and know how to solve different problems. I use express as my Node framework and never really checked out the alternatives because it was the one I learned first.
learning new Frameworks
So, after realizing that I really didn't change anything about my workflow in the past 2 years, I decided that I'd have to try something different. First, I took a look at other Node frameworks. Loopback seemed very promising and I tried it out. I like it, although I haven't really understood the whole thing yet and their graphical API design tool called loopback arc seems to have weird bugs where I can only edit some models and others not. That probably is just me not understanding it though. I will definitely dig deeper into it because it seems to be able to solve problems way faster than a traditional express app once you know how to use it.
Without just randomly searching the internet for alternatives, I would have never discovered a better alternative and I'm glad I did. I can see it saving me tons of effort and time once I understand it better.
learning new Languages
Today I had another idea: I wanted a quick little REST-API on my raspberryPI that could turn on and off my home wifi. I thought about using Node, but then remembered that the pi comes with Python. And Python is a very serious language huge companies use to build their products. And on top of that it has very lightweight frameworks like flask and there are tons of super simple libraries to do all kinds of things I'd need in my project. So I started to learn Python today, and although I really don't know anything about how a bigger application would be designed in Python, I can see it benefitting the way I code in other languages because I don't just stick to the same old structures and patterns I'm used to.
That it also the reason why I eventually want to learn more C (my current level is pretty much reading and writing from/to the console or a file, that's it). And I think everyone should eventually learn some other languages, even if they're not useful for any real products one might think of. It not only helps understanding code that someone else wrote in their language, it also improves the quality of the own code because you don't just stick to what you always did.
Trying to change up my style without changing the language is hard for me because it is a transition that is not necessary. In the short term I'm always faster by just doing what I always did and thereby know best. But when a new language or framework forces me into new coding conventions, syntaxes or general rules, I might find out some better ways to solve problems and that in turn improves my code in languages I've known before. And thereby the product quality and development efficiency.