What did functional programming ever do for us (software engineers)? A tutorial with code in Scala

Veröffentlicht am: 20 September 2020
auf dem Kanal: Sergei Winitzki
1,184
41

What are the advantages of functional programming for practical work in software engineering? Why are functional programming features being added to many programming languages today, and what exactly are these features?

The exact meaning of "functional programming" is debatable. I adopt an extreme pragmatic and un-academic approach and ask the question from a software engineer's point of view: what specific advantages does FP provide? I focus not on the theoretical advantages that help computer scientists publish more papers, but on practical features that drive the industry adoption of FP by helping programmers write better code. I describe four main FP idioms that pervade the industrial FP usage today: loop-free iteration, type parameters, disjunctive types, and effect chaining. Programmers who master these features and idioms will become more productive in any language.

There are four main features (or idioms) that define what "functional programming" means in today's practice of software engineering:

1) loop-free iteration (programming in "map/filter/reduce" style)
2) ability to write code with type parameters
3) user-defined disjunctive types (also known as "tagged unions", "variant types", "sum types") and pattern matching
4) special syntax for chains of effectful computations, known as "for/yield" blocks in Scala, "do notation" in Haskell, and "computation expressions" in F#

I give examples illustrating why these idioms give decisive advantages to programmers in any language. I also indicate what features of the programming language are necessary to support these idioms of functional programming.

Slides:
https://github.com/winitzki/sofp/blob...


Auf dieser Seite können Sie das Online-Video What did functional programming ever do for us (software engineers)? A tutorial with code in Scala mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Sergei Winitzki 20 September 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,184 Mal angesehen und es wurde von 41 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!