Linked by Thom Holwerda on Mon 14th Jan 2013 23:15 UTC, submitted by MOS6510
Thread beginning with comment 548935
To view parent comment, click here.
To read all comments associated with this story, please click here.
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[2]: Comment by RareBreed
by ndrw on Thu 17th Jan 2013 00:47
in reply to "RE: Comment by RareBreed"
I get out of bed, I take a shower, I brush my teeh, I comb my hair, ...
If that was how OO programs are written the world would be better. Most programs (and toolkits) look more like this:
"[You,] get out of bed! Take shower! Brush teeth! Comb your hair!"
or even:
"take a comb, raise your hand, do {stroke your hair} until (enough)".
Calling other object's "doSomething" or "setSomething" methods is modern equivalent of calling "goto". A single setter may look innocent but try to sequence a number of them and you will have to deal with all the complexity (structure, sequencing, side effects) that leaked out from the object. That's because the control is no longer inside the object but in a caller of the method.




Member since:
2006-07-04
I love functional programming.
But imperative programming more matches the way that people actually think. People think in concrete, step-by-step terms: I get out of bed, I take a shower, I brush my teeh, I comb my hair, I get dressed, I eat breakfast, I leave the house, I go to work, I park my car, I walk into the office, I etc, etc, etc. In order to achieve a particular goal, people do each step in a particular order.
Functional (and logic) programming, is more atuned to abstract/mathematical thinking (and the more declarative the programming is, the more it becomes like math). Most people are not adept at that.