464 karma · joined August 12, 2018
There may be a complex function of many variables which is not simplified by splitting into multiple functions.
Most often though, the code in a function has several logical parts which have their own temporary variables and are good candidates for splitting into separate functions.
Generally it makes sense to split code up so that it can be encapsulated at different levels. For example if you have a validation routine for a record, it may make sense to have different functions to test different properties, so that you can see which validations are being performed at a high level and then zoom in when you need to.
Encapsulation should be done to manage scope of temporary variables, and to make the code easier to read and to test. But there’s no hard and fast rule, really.
Nutritionally, pizza is the last thing that an office worker needs. Free pizza at an event is another salad / gym session that the worker needs to organise on their own time. Or not.
It’s funny how we talk of information “not being lost” since it’s emitted as radiation... would we be able to decypher anything? If not, it’s still lost.