4 ms·
I disagree. Obsessiveness with small methods means less opportunity to keep your transient state in local variables, meaning you are going to make it object sta
by ntoshev 18y ago
I disagree. Obsessiveness with small methods means less opportunity to keep your transient state in local variables, meaning you are going to make it object state (use object fields), which would actually increase your side effects.
Edit: It occurred to me that there is a case when you need to move state out of the stack to global or instance variables: programming async IO. It is notoriously inconvenient for exactly this reason.
- LogicHoleFlaw 18y agoMethod arguments are a decent place to keep transient data as well. Local variables and object fields are not the only options for scoping your data.
- darkxanthos 18y agoExactly.. lol. I guess some people's field of vision is about this big |<--->|
- ntoshev 18y agoYou are correct, as long as you don't get too many arguments.
- LogicHoleFlaw 18y agoThen start using closures :)