4 ms·
From my experience a lot of nested functions usually means spagetti code created from huge functions which were split on radnom points to small functions (which
by oselhn 10y ago
From my experience a lot of nested functions usually means spagetti code created from huge functions which were split on radnom points to small functions (which mixed abstraction levels and still do multiple things at once). If you properly design your data model there will be no huge functions and no deeply nested calls.
- purplerabbit 10y agoYou can definitely break up a function's contents into logical nested functions... Why are you saying "random points"? Nested functions can actually allow you to even out your abstraction levels... Just group lower-level operations in more deeply nested functions. It's sort of the functional equivalent of extracting a group of similarly-leveled concepts into a new object in the OO approach. Not sure if you were talking about C++, where my point probably doesn't apply... (Lack of nested function support, AFAIK)