One major exception to the small function idea is switch cases. Sometimes it’s justifiable to have a large switch statement with many cases that end up being lines and lines of code. However, if the logic is sound, there is no need to make this function smaller.How Long Should Functions Be? How Do We Measure It?571Sara KhandakerMaximiliano ContieriAug 17, 2020·1 min readwhy would you use a switch ? generates lots of coupling and violates Open/Closed principle