Hacker News new | ask | show | jobs
by vonseel 2717 days ago
I understand your viewpoint, but aren't you assuming that the "guy advocating unit tests" has the option of choosing a type-safe language? In my experience, the programmers rarely have the power to choose the programming language. In fact, they were probably hired because of their expertise in the language already being used.

Just saying, if I'm writing Python and advocating unit-tests... even of TypeError exceptions and similar problems that would be avoided by using Golang... it's probably because I know these are common problems in Python/JS/non-type-safe languages, and I probably don't have the power to choose a different language than the one already being used by my company/development organization.

1 comments

For python you can use type annotations with an external type checker such as mypy or flow for js.

To implement type checking in js or python would add a layer of unparalleled safety for a fraction of the development time involved with unit tests.

Yet I would say 90% of developers are unaware of this contradiction and go on piping about the extreme importance of unit tests while completely ignoring type checking. They value safety but are too naive to know what safety means.