← Back to context

Comment by chollida1

5 hours ago

> What would be a good example of the kinds of things a 100 line function would be doing?

For me i see it alto in older video game engines with a switch statement that has 100s of possible states that need to be taken into account.

That kind of code is less common these days but its nice to be able to see all the possible states in a single switch statements vs them all being abstracted away in multiple classes that handle a subset of each state transition.

This is one case where having a super long function makes readability far better than abstracting away the states into multiple classes that all need to be read to understand the state of the world.