Will statically typed languages ​​be replaced by dynamically typed languages?

Original author: Robert C. Martin
  • Transfer
I have been a fan of statically typed languages ​​for many years. I learned the lesson from my own hard experience using C. Too many systems broke due to stupid typing errors. When C ++ came out, I was an avid devotee and a fierce adherent of strong typing. I taunted smalltalkers who were whining about losing flexibility. Reliability, after all, was far more important than flexibility. And besides, we could keep our software flexible AND statically typed if we just followed good dependency management principles.

Four years ago, he joined XP (Extreme Programming Methodology). I loved the emphasis on practicality that she added to software development. I also liked the emphasis on testing. Since then I have been infected with the idea of ​​testing. I can no longer imagine creating code without using TDD (test driven development). I can’t even imagine, so as not to have full test coverage, so that my designs are safe.

About two years ago, I noticed something. I became less and less dependent on typing in terms of reliability. My unit tests prevented me from making typing errors. The more I depended on unit tests, the less I depended on reliability based on typing in Java or C ++ (my languages).

I thought the experiment was a success. So, I tried to write some applications in Python, and then in Ruby (a very famous dynamically typed language). I was not very surprised when I discovered that typing errors just never occurred. My unit tests allowed me to keep my code strict and not deviating from the rules. I just didn't need the static typing that I had depended on for so many years.

I also realized that the flexibility of dynamically typed languages ​​makes writing code much easier. Modules are easier to write and easier to change. There are no assembly issues. Life in the world of dynamic typing is fundamentally simpler.

Now I again program in Java, then that the projects I'm working on are asking for it. But I cannot but admit that I feel the craving of dynamically typed languages. I would like to program in Ruby or Python, or even Smalltalk.

Does anyone else feel something like this? As more and more people use TDD (which I think is inevitable), will they feel the same way I do? Will we all be programming in dynamically typed languages ​​by 2010?

April 26, 2003
Robert Martin, an outstanding software developer,
Author of the Agile manifest, author of the SOLID principles,
He is fluent in C ++ and Java :)

Also popular now: