Hacker News new | ask | show | jobs
by syndicatedjelly 502 days ago
I have this pet theory that a well-written dynamically-typed program will have fewer bugs than the typical statically-typed program.

Static typing doesn't reduce bugs. It just changes when they appear, from runtime to compile time. Further more, types are largely about communicating information about how a client should use a piece of code. A compiler for a statically-typed language just happens to help automate this exchange of information and reduce the likelihood that the code is used incorrectly.

It's kinda similar to precision vs accuracy; to be precise means to throw a bunch of darts at the same spot on a dartboard, and to be accurate means to actually hit the bullseye. A lot of typed programs are precise, but end up solving the wrong problem.