Hacker News new | ask | show | jobs
by pydry 718 days ago
The reason to write a test first is so you have automated validation that the expected behavior matches the spec. This is valuable when writing the code.

Types in a strongly typed language will not validate high level expected behavior. Types attack the problem from the bottom up instead of the top down and work by constraining the number of possible states a program can be in. You can always make types stronger and tests more comprehensive but you will be subjected to the law of diminishing returns for both the more they encroach on each others' territory.

>TDD strikes me as a practice that slows you down a fair amount

This is like saying that lunch is a practice that costs you money. Everything that validates program behavior comes with an associated cost.