3 ms·
"hold in your head" == minimizing complexity by minimizing the state space. "Mathematical" == stateless, pure functions. If the states are fewer, the code is s
by dons 14y ago
"hold in your head" == minimizing complexity by minimizing the state space. "Mathematical" == stateless, pure functions.
If the states are fewer, the code is simpler. I can only hold simple things in my head :)
I think everyone's basically saying the same thing.
- qznc 14y agoFunctional programming is not "minimizing" state. The point is that it makes state "explicit". The minimization is done by the programmer because she is lazy and longs for conciseness.
- dons 14y agoMaybe you write FP code differently to me, but I'm constantly trying to minimize the complexity of the code, so that it only contains the essential complexity. I gave a talk on how FP approaches force you to minimize accidental complexity recently, capturing this view, http://code.haskell.org/~dons/talks/padl-keynote-2012-01-24.pdf http://code.haskell.org/~dons/talks/padl-keynote-2012-01-24....
- jerf 14y agoFunctional programming has a lot of state minimization in it, at least in the stronger forms. A function in Haskell of Int -> Int can only be affected by the input Int. A function in C of int function(int) can be affected by arbitrary state from throughout the system; it may decrement or increment depending on global variables. It may write files. It may open connections to remote servers and read stuff off the internet. It has a vastly huger potential state space in theory and often vastly huger state spaces in practice. I go into this more explicitly in http://www.jerf.org/iri/post/2908 http://www.jerf.org/iri/post/2908 .
- batista 14y agoI find this statement outrageously offending. Why do you assume the programmer is a "she"? It might as well be a "he". Or it might as well not want to be associated with any gender (consider a transexual, asexual, or an alien from Mars). I think s/h/it is the correct pronoun to use to cover all those cases. (yes, it's /s. When I see "she" used to imply the author is oh, so progressive and non-sexist, I resort to sarcasm).
- blacksmythe 14y ago>> The minimization is done by the programmer because >> she is lazy and longs for conciseness. I view longing for conciseness to be the sign of a good programmer, not a lazy one. http://www.folklore.org/StoryView.py?project=Macintosh&story=Negative_2000_Lines_Of_Code.txt http://www.folklore.org/StoryView.py?project=Macintosh&s... "He thought his goal was to write as small and fast a program as possible, and that the lines of code metric only encouraged writing sloppy, bloated, broken code.' http://c2.com/cgi/wiki?LinesOfCode http://c2.com/cgi/wiki?LinesOfCode "Measuring software productivity by lines of code is like measuring progress on an airplane by how much it weighs."- Bill Gates
- lucian1900 14y agoA good programmer is a lazy programmer.