4 ms·
I would love to meet this mythical being who understands functional programming but has no clue how to write an imperative program.
by balloot 13y ago
I would love to meet this mythical being who understands functional programming but has no clue how to write an imperative program.
- wwweston 13y agoWhile going through a Math undergrad program in the mid-90s, I noticed that some number of my fellow students had a distaste for programming. As someone who'd done reasonably well with both and had thought of them as heavily overlapping areas, I thought this was interesting, so I tried to poke at this a bit. One of the concepts I got back from a talented classmate was basically a complaint about mutable variables -- that in an algebraic description of relationships for a given system what we call "variables" are less variable and more "unknowns" which represent fixed if unidentified quantities. Others similarly noted there was something absurd about writing out equations like "x = x + 2".
- tripzilch 13y agoI can see why they think that, but the important thing is that "x = x + 2" is not an equation. It's just an arguably poorly chosen operator (Pascal gets this right and uses ":=" for assignment). The trick is to stop reading that line (in your head) as "x is equal to x plus two", but instead "x is assigned the value of x plus two".
- wwweston 13y ago> It's just an arguably poorly chosen operator (Pascal gets this right and uses ":=" for assignment). That's one potential takeaway, but when I turned over the complaint in my mind, this was arguably another way of complaining about mutability. Also, given the timing, it's pretty likely that one of the languages they'd learned was Pascal: that was the language of the first few CS classes at my school in the 90s, it was also the language of any high school curriculum that led to the AP exam, and Borland's Pascal products were still pretty popular PC dev environments. They could've also been unlucky and received their first exposure by choosing to do a numerical analysis class in Fortran or C, of course. :/
- Shorel 13y agoMost students of pure mathematics get functional programming much faster than imperative programming if they have never programed before. Source: all my classmates.
- ParahSailin 13y agoPeople who exclusively use Excel spreadsheets to program is a good example. Most people who use spreadsheets never use functions in a cell whose effect is to change the function or value in another cell.