Re:OO Side Effect Free Programming
by LogicHoleFlaw on Wednesday February 11, 2009 @12:09PM
(#477238)
Method 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.
You are correct, as long as you don't get too many arguments.
Re:OO Side Effect Free Programming
by LogicHoleFlaw on Wednesday February 11, 2009 @01:24PM
(#477352)
Then start using closures :)
Re:OO Side Effect Free Programming
by darkxanthos on Wednesday February 11, 2009 @12:41PM
(#477279)
Exactly.. lol. I guess some people's field of vision is about this big |<--->|
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.