3 ms·
This code is not written for production, it's just written to make you understand how the basic of this technology works. So I would say the unit tests have th
by cdancette 8y ago
This code is not written for production, it's just written to make you understand how the basic of this technology works.
So I would say the unit tests have the exact same purpose: make the reader understand what the functions are doing (and not a real unit testing).
Since you speak of value, the value Peter Norvig is trying to provide is making readers understand the principles, he's not trying to provide some monetary value. So I don't think your criticisms apply here, those tests fit the purpose very well.
- dmurray 8y agoThe value he is trying to provide is also showing people by example how to write readable, idiomatic, functional Python code. From that perspective, I agree the tightly coupled unit tests are a bit grating. Though they would not look out of place as doctests.
- falsedan 8y ago> the value Peter Norvig is trying to provide is making readers understand the principles, he's not trying to provide some monetary value I think he's trying to show how to approach solving this kind of problem. Juniors will copy it, and will then write tests in a business-logic environment which have dubious value. The code shows how to solve the problem very well. The tests do not.