logoalt Hacker News

choegertoday at 6:00 AM2 repliesview on HN

Dynamic typing is no typing.

The point of types is to prove the absence of errors. Dynamic typing just has these errors well-structured and early, but they're still errors.


Replies

cardanometoday at 10:58 AM

> The point of types is to prove the absence of errors

Maybe for you. Originally static typing was to make the job of the compiler easier. Dynamic typing was seen as a feature that allows for faster prototyping.

And no, dynamic typing does not mean untyped. It just means type errors are checked at runtime instead of compile time.

You can have strongly typed dynamic languages. Common Lisp is a very good example.

Weak typing is a design mistake. Dynamic typing has its place as it allows you to have types that are impossible to express in most static type systems while avoiding the bureaucratic overhead of having to prematurely declare your types.

The best languages allow for gradual typing. Prototype first then add types once the general shape of your program becomes clear.

Pay08today at 7:05 AM

Errors that you can recover from. I simply appreciate the added flexibility. Have you ever tried making a container of arbitrary types in C++?

show 2 replies