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

Erlang really helps you understand these, because it's dynamically typed, but the dialyzer will produce errors as a form of static optional typing.

I wrote some code a few days ago that looked like it worked. A few days later I ran the dialyzer, and it pointed out a certain code path could never be reached, because there was a comparison of an atom to an integer.

I would never have recognised that bug otherwise, because even my unit test just called that function with an integer, instead of the atom it was being called with.

Dynamic typing runs deep in what PHP/Ruby/Python offer - build it and get it running fast. Not thinking about complex types is a good thing in small projects.

But at a codebase of a certain size, static typing really helps minimise subtle bugs.



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

Search: