← All blog posts

Opinion: Dynamic Languages vs Static Languages for Prototyping

May 28, 2023 · Programming

The last 5–7 years, I always stumble upon the same issue. You want to experiment with some ideas, or even a small microservice, which language are you going to choose? I am always fond of using a static language like golang to test my ideas, or put something performant in a production environment, but I usually end up with a solution in a dynamic language preferrable, Python or Javascript (node.js). Why this is happening?

Dynamic Problems

Usually, when you prototype, you haven’t made up your mind yet, so things change a lot. In static languages you have to meticulously write all data structures and their specifications, create new types and abstractions, continuously update method signatures etc. On the other hand on dynamic languages, are specifications are implicit, easier to change and try ideas. I think that it is a great feat when prototyping.

Maintainability

But, how about maintainability? Prototypes and MVPs are sometimes becoming production systems. Are systems that are engineered with the usage of dynamic languages, ones with low quality?

My personal opinion, is No. From my experience, you can build ultra-maintainable systems both in dynamic and static languages. But systems that change requirements a lot, common case when prototyping, tend to suffer more, when writing in a static language, due to the reason that you usually need to cut corners to deliver the desired end result. The constant stream of changes will eventually make any engineer to “hack” the language. When programming in a dynamic language, these changes are more easy to handle, thus you just need to be diligent.

Performance

Premature optimisation is the root of all evil.

I think this is the only argument that I need to quote regarding performance. My two cents, are; when you need to shape your idea, do it. If you then need to make it fast, then make it fast. Language, or stack or technology is not an excuse.

Battle with the Zealots

If you are not working in a startup, then you will find engineers in your team that will say lots of negative stuff about dynamic languages, mostly regarding performance. Sitting on the pedestal, talking about language superiority etc. Just ignore them, after all your job is to deliver the value to your customer.

Epilogue

Ok, maybe I seem biased regarding the paradigm of choice here. But I am not, it is just that every single time, if I have not a very-super-important reason to choose a static language, I will choose a dynamic one for prototyping and fast delivery. Even if I try to go with something else, I will go back and change my decision at some point. So, I will not waste time from here on!