Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I will never understand how people can say that dynamic typing makes them more productive:

"Have you ever changed the type of a function argument and then had to find all usages and change them? Have you ever changed a class and then had to recompile, and redeploy, all the classes that used that class? These are just three of the issues that don't occur nearly as often in dynamically typed languages."

If you change the type of an argument you OF COURSE want/need to change all usages of that function in both static and dynamic languages - how in the world did you expect sqrt(struct Person) to behave? - but static typing helps you quickly find all those instances so you're more productive in making that refactor.



Likewise, if you program C, you better be full of self-doubt, precise and disciplined. My mantra is

  "Programmers thinking that dynamic typing is better should never use a dynamically typed language, whereas programmers thinking that static typing is the only sane choice may use a dynamically typed language in special cases."


People that don´t see dangers take more risks, but they are also the least likely to understand your advice. People that don't understand how types help to adapt and grow software are the least likely to refactor when needed to.

That is why I think it is fine to use a type-brittle programming language for quick scripts, but not for building applications that have to change over time and need to be maintained by multiple people.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: