3 ms·
“Put ifs were they minimize the net total Cyclomatic complexity” This is exactly what the factory design pattern is trying to achieve. Figure out the type of o
by jackblemming 3y ago
“Put ifs were they minimize the net total Cyclomatic complexity”
This is exactly what the factory design pattern is trying to achieve. Figure out the type of object to create and then use it everywhere vs a million different switch statements scattered around.
Also don’t create batch functions unless you need to. Functions that work on a single item compose better with map-reduce.