The Case Against Dynamic Typing

9    27 Jan 2016 17:25 by u/vvega

4 comments

2

For convenience, here is the blog this article sourced from, which it also linked to at the bottom.

2

After years of using dynamically typed languages I'm a strong static-typing convert. Sure, you have easy up-front flexibility with dynamically typed languages. Sure, this may lend itself to rapid prototyping. But I've personally found that trying to write a program of any significant size with a dynamically-typed becomes a giant cluster-fuck. I might hit the ground running on a project, but I often find myself bogged down and having to backtrack and re-write significant amounts code if I don't enforce a stringent type-system in my program to begin with. Using a dynamic language and manually enforcing a type system doesn't make much sense to me when I can get the language to assist me with it.

In my opinion, dynamic languages are great for scripting or writing small chunks of code of maybe a few hundred lines. Little tasks where it's easier to mess around until you hit a solution and re-write as much code as needed (or even the whole program for that matter).

1

This post is so short, the case against dynamic typing is basically "Because it is bad." Surely someone could present a specific case showing the problems of dynamic typing where static typing is the clear winner.

0

With some modern languages, you have a third way: gradual typing, in which you use type annotations where you want them, instead of the language requiring them as most statically typed languages are designed.