News for hackers. Stuff that matters.
Re:Can Programming Be Liberated from the von Neumann Style? ... by hood_syntax on Monday December 19, 2016 @09:32AM (#13211576)
You're right that it's closer to how people are taught, but there's no reason we can't teach from the FP perspective.

Consider the imperative

  cup_of_water get_water (cup_loc, water_loc) {
      cup = get_cup(cup_loc);
      return fill_cup(cup, water_loc);
  }
or something like that, versus

  getWater :: CupLoc -> WaterLoc -> Cup Water
  getWater cupLoc waterLoc = fillCup (getCup cupLoc) waterLoc
It's just a slightly different way of thinking about things.
Re:Can Programming Be Liberated from the von Neumann Style? ... by hyperpape on Monday December 19, 2016 @09:49AM (#13211698)
There's nothing in either example that is intrinsically functional or imperative, they're just different syntax.
Re:Can Programming Be Liberated from the von Neumann Style? ... by taeric on Monday December 19, 2016 @10:01AM (#13211769)
This is dodging things by all being symbolic. Which is well after the point my kids are at in these examples. I'm taking about my one year old.

It is amazing how they can understand well before they can say words. Or read and write them. Sign language can be taught really early. Not sure what data that adds here.

But, I believe that imperative makes sense because so much in life is imperative. Especially directions we give each other.

For things that can be done symbolically, declarative can be a big boon. But it does seem to be the minority.

Re:Can Programming Be Liberated from the von Neumann Style? ... by pjc50 on Monday December 19, 2016 @10:54AM (#13212138)
Now audit each cup-filling in a database.

(Easy in an imperative system, painful in a functional one where you have to start passing monads around and caring how many times the cup is constructed rather than how many cups you end up with.)