3 ms·
Tests are a very poor and verbose duct-tapey replacement for succinct and powerful static type information. Static types massively make it easier to understand
by winter_blue 6y ago
Tests are a very poor and verbose duct-tapey replacement for succinct and powerful static type information.
Static types massively make it easier to understand new code. I can actually see the structure of the data that's getting passed around, with types.
- joelbluminator 6y agoHuh? tests are there to make sure your code behaves correctly, e.g it works. Don't you do that in static land?
- winter_blue 6y agoYou write tests for things that actually matter ... like you know, testing functionality. You don't waste time writing tests that simply check if all the arguments received the right type. This is taken care of by the type checker. Besides, the biggest benefit of types is readability.
- joelbluminator 6y agoI don't see tests as you describe in dynamic languages much. E.G this is how you would test Rails controllers https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/controllers/search_controller_spec.rb https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/cont... . I don't think its that different than java world.