Comment by pmontra

1 day ago

Good luck using static typing to model many real world unit tests for the programming languages people use most. I start with an easy example: those records should be sorted by date of birth. We can move on to more complicated scenarios.

> "records should be sorted by date of birth."

What's wrong with C#'s:

    System.Collections.Generic.SortedList<DoBDateTime, PersonRecord>

?

The comment didn’t claim that types are a stand in for tests either! IMO, they are orthogonal.

  • The comment explicitly set out to refute the idea "...that unit testing is just as good as type checking" by describing the former as simply inferior.

    • No. They refuted the claim that "a static type check is just a stand-in for a unit test". That is a claim that you can just remove your type checks and replace them with unit tests at no loss. The comment stated that removing a type check just so you can replace it with a unit test is inferior. The prior state was already pre-supposed to have a type check/type checkable condition that you could replace.

      That is the literal converse of the claim in the response to that comment arguing that the comment stated that all unit tests can be replaced with type checks. Those are not at all the same claim.

      To make it even more clear the comment said: I saw a talk that said Type Check -> Unit Test. I said that is silly.

      Response said: Unit Test -> Type Check is not reasonable. So clearly your claim that Type Check -> Unit Test is silly is wrong.

No one claims that types are a stand in for all unit tests.

They stand in for the banal unit tests.