Functional Thinking
Recorded at:
Always enjoying the OOP to FP presentations and books!
by
Aggelos Biboudis
Strange Loop
by
Alex Miller
Functional Programming Should be Taught First
by
Faisal Waris
Unfortunately, our minds get corrupted too early by imperative, OO thinking. And - as I found out - (re-)learning functional programming requires quite a bit of effort (to get those neurons re-wired). CS shools should teach FP first. Its gratifying to see CMU taking a lead.
A declarative way of thinking is a better basis for creating abstractions.
Very good introduction of Functional Programming
by
哲 永田
Re: Functional Programming Should be Taught First
by
Aggelos Biboudis
Funny how examples are always math
by
Leandro A
Slides
by
Gabriel Kastenbaum
Just to notice that what you see at 20:00 are not matching with the slides that are shown. Neil Ford talks about slide no 45, not 35 . And I did not find the lides about some clojure code. Maybe the version of the slides that is given here is not the right one?
Anyway, it's a minor problem. The presentation is just great so far :)
Re: Funny how examples are always math
by
Hermann Schmidt
Of course math examples are perfect for functional programming. Math is all about functions and recursive definitions after all.
I think, when data structures are able to execute code on behalf of the caller (with closures), and thus avoid the ubiquitous iteration loops, most work is done already. A mainstream enterprise Java program contains mostly copy operations and loops over structures. Sophisticated algorithms are not often needed.
The standard data structures Map, Set, List, Tree, Array should provide processing algorithms, which potentially can run in parallel. The so-called business logic as such has almost never anything to do in parallel, really. It's all in the data structures.
The "business" services very rarely have any state, they are basically data structure transformers between some user or external interfaces and persistent data storage, which carry the state.
One reason why I enjoy programming in Ruby: Almost no loops! Array, Hashes, Strings, Files, all have operations based on closures. A real pleasure to program.
As for Java, a decent closure syntax and a rewrite of the standard library would help a lot.
Re: Funny how examples are always math
by
Faisal Waris
Example: Word Count is the canonical ("Hello World" equivalent) demo problem in map-reduce. Following are F# serial and parallel versions of Word Count - which are strikingly similar:
let file = @"C:\Users\Fai\Downloads\War_and_Peace.txt"
let splitLine (l:string) = ...function to split a line into words...
//serial word count
file |> File.ReadLines
|> Seq.map splitLine
|> Seq.collect (fun xs -> xs)
|> Seq.map (fun w -> w.ToLower())
|> Seq.countBy (fun w -> w)
//parallel word count
file |> File.ReadLines
|> PSeq.map splitLine
|> PSeq.collect (fun xs -> xs)
|> PSeq.map (fun x -> x.ToLower())
|> PSeq.countBy (fun w -> w)
Props to the Camera Operator
by
William Pollock
Re: Functional Programming Should be Taught First
by
Damien Pollet
Re: Functional Programming Should be Taught First
by
Faisal Waris
Re: Functional Programming Should be Taught First
by
Daniel Gruszczyk




Hello stranger!
You need to Register an InfoQ account or Login to post comments. But there's so much more behind being registered.Get the most out of the InfoQ experience.
Tell us what you think