SJS wrote:
Everywhere, there's a tradeoff.

I think you're correct -- there's a sweet spot. Probably involving more
than just length, but also complexity, and levels of abstraction.

I find it's usually how interdependent the part you want to pull out is. Which is approximately modeled by how many local variables are shared/passed between different chunks of the function.

Sure, I *could* pull out that bit, but then I'd be passing in five "in" variables and four "out" variables, along with a status saying whether I should return early with an error, so it probably shouldn't be a separate function just for the sake of being a separate function.

Of course, if you can reuse it elsewhere, then sure.

--
  Darren New / San Diego, CA, USA (PST)
    It's not feature creep if you put it
    at the end and adjust the release date.

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to