News for hackers. Stuff that matters.
Re:Functional Thinking after OO by ww520 on Tuesday March 15, 2011 @02:40PM (#2328799)
Can you just use a callchain?

  function getData() {
    return processData(validateData(fetchDataFromSource()));
  }
Re:Functional Thinking after OO by jerf on Tuesday March 15, 2011 @07:46PM (#2330007)
It's not quite equivalent due to differences in the semantics; a functional language can far more easily do loop fusion: http://en.wikipedia.org/wiki/Loop_fusion . An imperative language is likely to not even try in that situation, or in the case of a good C compiler, end up failing to do the optimization at the slightest hint of pointer use. In Haskell it's robust and can be composed many times.