Why Learning Other Languages Is a Must

Identicon Expanding your language toolbox is a topic promoted all over the coder channels. I believe it’s common knowledge that it’s beneficial, but in my experience, many don’t bother. I encounter resistance frequently in the JVM world, so much so that I should say the Java world because I have encountered steadfast resistance to new languages first hand. Even such a small step of moving to Groovy, a JVM language that will tolerate java syntax without complaint.

Seriously, can you imagine joining a team and starting the development of a new micro-service and you write it in Groovy? It goes live and works perfectly. I leave the team later to start a different project, only to hear a couple months later that they rewrote the service in Java simply because the other developers didn’t want to figure out the differences from Groovy. I heard the new service had serious issue in production... probably because they rushed to rewrite something that was already fully tested. That is a lesson for you, I guess!

Why being a Polyglot dev is important

What good does knowing another language do me if I proficiently code in X language? Aside from the more esoteric explanations of how it makes you a well-rounded developer with different perspectives on how to accomplish things various tasks, how about a practical example?I am writing a service that will call another service. Nothing to see here but wait, the other service doesn’t exist yet. Well, I have to finish my code now! So since I already helped define our messaging, I know what the response will be when I make the request. I just need a server to test out integration as mocking can only do so much for me.

The Solution Example

I solved this problem far faster than it took me to write this blog post. I am learning Node these days so I have NPM installed. I built a sample server in less than 5 minutes and that included me looking at a tutorial on how to use express. It went like this:

  • mkdir apitest
  • npx express-generator

  • Edit the index.js to add a new route that returns a nice test data set.

  • DEBUG=* npm start
  • Use Postman to test the End Point

Done, I’m back to work on the project. Next time it will take me 30 seconds to set up another end point. What’s helpful is Node allowed me to do this ad-hock. And faster than if I were trying to do this in Java or even Groovy, as all the things said about the difficulty in getting started in Java, apply to every new project.

Of course, there are 10 different ways to do this just as quickly in Rust, Go, Python, but I know those very well yet. It doesn’t matter, if another language helps em get work done quicker.. report me to the code purity police if you must. I’ll be done with my work and back to hacking on my own projects. (Yes, likely in a language other than my primary language.)

Tag Cloud

links

social