2 ms·
unit test is overrated because most of the problems can be solved via correct by construction methods. Like, do you really need to check if this "kind" variable
by anon-3988 3y ago
unit test is overrated because most of the problems can be solved via correct by construction methods. Like, do you really need to check if this "kind" variable is equal to "Veg"? This could have easily been solved by using Enum. Similarly, global or not can be solved by using classes/structs that don't have any constructors or something like that.
Functions should exist at the level of concepts:
1. arr | flat | map | collect as HashMap makes sense.
2. CreateFlattenMappedHashMapFromArr does not.
- xmcqdpt2 3y agoAgree. Furthermore if you are going to split it, you want to make sure no one boxes a raw pizza because they added a bad switch statement or something, as that would be clearly bad. So if you want a split version than you should use types to mark the transitions between states. boxPizza should take a CookedPizza, and BakePizza should take a RawPizza and return a CookedPizza etc.