3 ms·
TDD: For people who've never used a decent type system. Writing a Solidity test to add two integers today really drove home the point.
by dreamdu5t 9y ago
TDD: For people who've never used a decent type system.
Writing a Solidity test to add two integers today really drove home the point.
- eropple 9y agoThe language I've been most effective with when using TDD is Scala.
- dreamdu5t 9y agoThat's great. In my experience, most TDD has looked like "We're going to need a function or class to do this, so let's write a test that calls all those methods first." Which is absolutely ridiculous when we could just be using languages that have concise semantics to describe what they actually do. For example, the last HTTP API I wrote in Haskell has no tests. The proper request/response is ensured by the types alone. I've had multiple jobs where I spent weeks writing tests to do the equivalent thing with a nodejs API (the body should contain this, the headers should look like that, etc.)