DEV Community

Discussion on: Writing Beautiful Code

Collapse
 
itsdarrylnorris profile image
Darryl Norris

An interesting point of keeping the function small it's that you might be able to reuse that function later on. On another hand, I have experience that the complexity of the code sometimes increases by writing small functions, because of similar processing needs to happen on different functions that they are isolated from each other.

I think in the end there has to be a trade-off between performance vs. keeping the functions small.

Collapse
 
restoreddev profile image
Andrew Davis

There’s always a trade off, but I think in general coders are more inclined to make functions too big than to make too many functions.