News for hackers. Stuff that matters.
Re:Tips for naming variables by mojuba on Wednesday May 13, 2009 @11:32AM (#607018)
In the example you showed I'd probably do the same, true, but I think there is no evil in passing widget as an argument.

In general, there's nothing wrong with functions that take everything they use as arguments. This is kind of functional programming (or a good part of it): every function is as independent as possible, which makes them easier to debug, easier to understand, and safer in terms of bugs. Functions that deal with data from outer scopes risk being less readable and less reliable.

There are no comments on this comment yet.