4 ms·
I mean yes it's either obviously wrong or hyperbole, I assume the second. But I think the idea is that by forcing each branch in a case to be an separate funct
by Avshalom 7y ago
I mean yes it's either obviously wrong or hyperbole, I assume the second.
But I think the idea is that by forcing each branch in a case to be an separate function they are forced to be unit testable.
- a-nikolaev 7y agoBut then any more or less complex code that involves conditions will be spread over multiple functions. Even if that makes it testable, it might become incomprehensible very quickly. Edit: If code needs certain number of conditions, they will be there in this or that form, that cannot be avoided. I would like to see real benefits of their choice in real non-trivial examples.