Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why schools teach functional programming

Name: Anonymous 2015-11-10 21:22

Now how can we possibly manage to level the playing field between the Alan Kays and the Jackson Pollocks in class? The answer is simple. Use a programming language and a programming paradigm that is generally not used by high school students. I favor Haskell, Scheme or maybe ML or O'Caml. From what I have seen as a TA, high school programmers mostly write code in C, C++, Java, C#, some dialect of Basic or some dialect of Pascal. All of these languages are imperative languages while none of the suggested languages are imperative. Well, ML and O'Caml are kinda imperative but I'd focus on the functional parts of these languages.

Can you imagine what the results of teaching freshmen these languages are? Well, except the endless bitching and moaning of the students who have prior experience in languages like C++ and Java. "This is useless", "Why don't we learn C++", "That's not how it works back home", "Nobody outside of academia uses these languages", "These language are too slow". I know all the complaints already. But they're not important. What is important is to level the playing field between freshmen who believe they know everything already and freshmen who know that they don't know anything about programming. Of course we're not going to level the playing field perfectly. Prior programming experience means something, no matter in what language people programmed during high school. Consequently even the leveled playing field will not look like the Bonneville Salt Flats. It'll be more like the Low Countries but at least it's not the Himalayas anymore.

Name: Anonymous 2015-11-10 22:54

Good Sir, might I inquire about a citation for this matter?

Name: Mentifex 2015-11-11 2:58

http://dl.acm.org/citation.cfm?doid=307824.307853
/^^^^^^^^^^^^ InFerence compares new with old /^^^^^^^^^^^\
/ EYE & MEMORY\ CONCEPTS in SEMANTIC MEMORY / EAR & MEMORY\
| | | | | _________ | ________ |
| _______ | |w| | / "woman" \----|--/"women "\ |
| /old \ | |o| | / comparand \ | / "have" \ |
| / image \---|---|m| | \ concept / | \ "a child"/ |
| \ recog / | |e| | \_________/ | \________/ |
| \_______/ | |n| | _______ | _________ |
| | h| | | / input \ | /"Eve" \ |
| | a| | | / of "is" \ | / "is" \ |
| visual | v| | | \"a woman"/----|-\ "a woman" / |
| | e| | | \_______/ | \_________/ |
| memory | | |c| _________ | _________ |
| | | |h| / silent \ | /"Eve" \ |
| channel | | |i| / inference \---|-/ "have" \ |
| | | |l| \ is made / | \ "child?" / |
| | | |d| \_________/ | \_________/ |
| _______ | | | | __________ | __________ |
| /new \ | |_|_|_ / AskUser \ | /"Does Eve"\ |
| / percept \ | / Psi \ / requests \--|-/ "have" \|
| \ engram /---|-/concepts\ / confirmation \ | \ "a child?" /|
| \_______/ | \________/ \______________/ | \__________/ |

http://www.amazon.com/dp/B00FKJY1WY

Name: Anonymous 2015-11-11 3:32

http://reddit.com/r/programming
/^^^^^^^^^^^^ Danmaku 12 compares new with old /^^^^^^^^^^^\
/ EYE & MEMORY\ CONCEPTS in SEMANTIC MEMORY / EAR & MEMORY\
| | | | | _________ | ________ |
| _______ | |L| | / "prog" \----|--/"lisp" \ |
| /LAIN \ | |A| | / comparand \ | / "touhou" \ |
| / \---|---|I| | \ concept / | \ "JEWS" / |
| \ / | |N| | \_________/ | \________/ |
| \_______/ | | | | _______ | _________ |
| | N| | | / input \ | /"satori" \ |
| | A| | | / of "is" \ | / "nitori" \ |
| visual | V| | | \ "prog" /----|-\ "lambda" / |
| | I| | | \_______/ | \_________/ |
| memory | | |L| _________ | _________ |
| | | |A| / silent \ | /"have" \ |
| channel | | |I| / inference \---|-/ "read" \ |
| | | |N| \ is made / | \ "SICP?" / |
| | | | | \_________/ | \_________/ |
| _______ | | | | __________ | __________ |
| /new \ | |_|_|_ / AskUser \ | /"Have you"\ |
| / percept \ | / Psi \ / requests \--|-/ "read your"\|
| \ engram /---|-/concepts\ / confirmation \ | \ "SICP?" /|
| \_______/ | \________/ \______________/ | \__________/ |

Name: Anonymous 2015-11-11 6:49

http://boards.4chan.org/pol/
/^^^^^^^^^^^^ J-DAR compares jew with goy /^^^^^^^^^^^\
/ EYE & MEMORY\ CONCEPTS in SEMITIC MEMORY / EAR & MEMORY\
| | | | | ___________ | ________ |
| _______ | |E| | / "nazi" \---|--/"six" \ |
| / \ | |V| | /concentration\ | / "million"\ |
| / OY \---|---|I| | \ camps / | \ "JEWS" / |
| \ VEY / | |L| | \___________/ | \________/ |
| \_______/ | | | | _______ | _________ |
| | N| | | / input \ | /"hitler" \ |
| | A| | | / of "gas"\ | / "goebbels"\ |
| visual | Z| | | \ "shower"/----|-\"holocaust"/ |
| | I| | | \_______/ | \_________/ |
| memory | | |A| _________ | _________ |
| | | |R| / silent \ | /"it's" \ |
| channel | | |Y| / inference \---|-/ "another" \ |
| | | |A| \ is made / | \ "SHOAH!" / |
| | | |N| \_________/ | \_________/ |
| _______ | | | | __________ | __________ |
| /ten \ | |_|_|_ / AskUser \ | /"Have you"\ |
| / percent \ | / $$$ \ / requests \--|-/ "paid your"\|
| \ off! /---|-/concepts\ / confirmation \ | \REPARATIONS?/|
| \_______/ | \________/ \______________/ | \__________/ |

-- Ben Garrison

Name: Anonymous 2015-11-11 8:30

oh my fucking god.

Name: Anonymous 2015-11-11 9:34

"Leveling the playing field" seems like a very marxist thing to do.

Name: Anonymous 2015-11-11 14:13

Communism is good.

Name: Anonymous 2015-11-11 14:49

No child gets ahead!

Name: Anonymous 2015-11-11 19:18

Name: Anonymous 2015-11-11 19:46

Why don't you read why a real CS teacher at CMU teaches kids FP instead of quoting bullshit?

https://existentialtype.wordpress.com/2012/08/17/intro-curriculum-update/

The most important decision was to emphasize functional programming right from the start, and to build on this foundation for teaching data structures and algorithms. Not only does FP provide a much more natural starting point for teaching programming, it is infinitely more amenable to rigorous verification, and provides a natural model for parallel computation. Every student comes to university knowing some algebra, and they are therefore familiar with the idea of computing by calculation (after all, the word algebra derives from the Arabic al jabr, meaning system of calculation). Functional programming is a generalization of algebra, with a richer variety of data structures and a richer set of primitives, so we can build on that foundation. It is critically important that variables in FP are, in fact, mathematical variables, and not some distorted facsimile thereof, so all of their mathematical intuitions are directly applicable. So we can immediately begin discussing verification as a natural part of programming, using principles such as mathematical induction and equational reasoning to guide their thinking. Moreover, there are natural concepts of sequential time complexity, given by the number of steps required to calculate an answer, and parallel time complexity, given by the data dependencies in a computation (often made manifest by the occurrences of variables). These central concepts are introduced in the first week, and amplified throughout the semester.

Name: Anonymous 2015-11-11 19:50

For the sake of those readers who may not be up to date on such topics, it seems important to emphasize that functional programming subsumes imperative programming. Every functional language is capable of expressing the old-fashioned sequential pointer-hacking implementation of data structures. You can even reproduce Tony Hoare’s self-described “billion dollar mistake” of the cursed “null pointer” if you’d like! But the whole point is that it is rarely useful, and almost never elegant, to work that way. (Curiously, the “monad mania” in the Haskell community stresses an imperative, sequential style of programming that is incompatible with parallelism, but this is not forced on you as it is in the imperative world.) From this point of view there no loss, and considerable gain, in teaching functional programming from the start. It puts a proper emphasis on mathematically sane programming methods, but allows for mutation-based programming where appropriate (for example, in engendering “side effects” on users).

Name: Anonymous 2015-11-12 8:18

>>11
It is critically important that variables in FP are, in fact, mathematical variables, and not some distorted facsimile thereof, so all of their mathematical intuitions are directly applicable.
Too bad they're not mathematical variables.

Name: Anonymous 2015-11-12 13:15

functional programmers are all talk no action

Name: Anonymous 2015-11-12 14:19

imperative programmers have no value

Name: Anonymous 2015-11-12 14:49

The type of useful ``functional'' programs is only inhabited by ⊥.

Name: Anonymous 2015-11-12 17:02

>>16
Your verb-anus relation does not meet /prog/ standards (unless that's supposed to be a Yakov Smirnoff joke.)

Name: Anonymous 2015-11-14 10:42

>>13
In what way, faggot?

Name: Anonymous 2015-11-14 10:47

FP is a meme.

Name: Anonymous 2015-11-14 11:08

>>19
FP is the future.

Name: Anonymous 2015-11-14 11:37

>>20
The future is a meme. By the time it comes round to it, it's already past.

Name: Anonymous 2015-11-14 11:41

>>21
Check these dubs, muh Zenon.

Name: Anonymous 2015-11-14 16:52

>>18
= in mathematics is a symmetric relation. x and y in x² + y² = 1 are not the same as what functional languages call variables.

Name: Anonymous 2015-11-14 17:38

>>23
Wrong! It is a symmetric relation in FP, just with the constraint that you have to write it in a form where it looks like imperative assignment. Much like in mathematics, where you have will have to solve for x and y before being able to use whatever values they have.

That is, = in an FP language (rather, a language with semantics equivalent to term rewriting) is really =def, i.e. x = y actually allows you to subsequently substitute x for y with no consequences.

As an aside, in any FP language (and, I believe, Prolog) you can actually write x² + y² = 1 (or its syntactic equivalent) after suitably restricting the domains of x and y, by using the amb operator (or Prolog's built-in solver).

Name: Anonymous 2015-11-14 17:46

>>24
Much like in mathematics, where you have will have to solve for x and y before being able to use whatever values they have.
FP nerds don't understand mathematics, as usual.

Name: Anonymous 2015-11-14 17:48

>>24
that only applies to pure functions, eg not necessarily all ML/lisp/ghc haskell functions

Name: Anonymous 2015-11-14 18:23

>>23
Um, it is a symmetric relation in FP, too. If a = b, then, thanks to immutability, b == a will evaluate to truth (if defined) at any point in time.
If you follow the following simple redefinition table, you will find Haskell equality corresponds exactly to mathematical equality:

Math | Haskell
≜ =
= ==

Name: Anonymous 2015-11-14 18:45

>>25
Go on then, how would you tell me the possible values of x from that formula?

>>26
An edge-case detail irrelevant to the point. Just because some functional languages have imperative features to appease idiots like you, it doesn't mean the rest of us who use and understand the semantics of a pure subset of the language can't benefit from the aids-to-reasoning FP provides.

Name: Anonymous 2015-11-14 18:52

>>28

I think that >>25 has meant that in mathematics you do not have to solve for x or y before being able to use them. I.e. it is possible and often necessary to abstract from what values they have and use them without knowing those values.

FP variables are still mathematical variables bar computer memory size limitation, of course.

Name: Anonymous 2015-11-14 19:33

>>29
So yes, just like FP variables.

Name: Anonymous 2015-11-14 19:57

f True = True
f x = False


by the second equation setting x = True we have f True = False

Name: Anonymous 2015-11-14 20:06

>>31
Pattern matching has nothing to do with variables.

>>30
Memory limitations don't change the fact that FP variables are much closer to math variables than the imperative non-variables (which are mutable and thus not a variable).

Calling imperative mutable assignables "variables" is like saying that in x2 + x - 2 = 0 the second x might be different from the first x. Which is fucking nonsense and ridiculous, yet imperative apes still believe that their languages have "variables".

Name: Anonymous 2015-11-14 20:15

>>32
Let's give the imperative apes some credit. Imperative "variables" are still deserving of the name, as they can vary over time. A bit of a hamfaced literal interpretation of the word, but valid in its own perverted way nonetheless.

Name: Anonymous 2015-11-14 21:33

>>24
Wrong! It is a symmetric relation in FP, just with the constraint that you have to write it in a form where it looks like imperative assignment.
It is not a symmetric relation. Part of the definition is in the word ``symmetric'': it means the same thing if the left and right sides are flipped around.
It doesn't look like imperative assignment at all. It declares a new identifier for a constant.

>>29-30
``FP'' languages have neither mathematical variables nor mathematical functions.

Name: Anonymous 2015-11-14 22:29

>>34
it means the same thing if the left and right sides are flipped around.
Wow, hot jesus. I didn't realise you were only arguing about the syntax of the thing. Sorry, I assumed you were trying to have a worthwhile discussion.

Consider: When I see x = y in, say, a proof, I can mentally substitute x for y and y for x everywhere else in that proof. Nothing changes if I do so. Are you trying to say that symmetric `=' means something other than that?
>>24
x = y actually allows you to [subsequently] substitute x for y with no consequences.

It doesn't look like imperative assignment at all.
Pulled from Page Random of the internet: http://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Assignment-Operators
Sure looks similar to me.

Name: Anonymous 2015-11-14 22:37

"Pattern matching has nothing to do with variables."

that feel when haskell coders are on /prog/ and post......

how did things get so awful?

remember when /prog/ was good? (and free of haskell scum)

Name: Anonymous 2015-11-14 22:46

protip: IF YOU USE HASKELL YOU ARE PROBABLY TOO STUPID TO POST HERE. YOUR CONTRIBUTIONS WOULD BE WELCOME ON REDDIT R/HASKELL

Name: Anonymous 2015-11-14 22:46

>>36
how did things get so awful?
that feel
gee yeah I wonder how

Name: Anonymous 2015-11-15 1:04

>>38
ooh are you quoting

Name: Anonymous 2015-11-15 9:15

>>35
In imperative crap you can substitute x for y but their values may be different. In Haskell if you substitute x for y, you know their values are the same. And if you update a value, you give it a new name like in math.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List