Functional Programming for Pragmatists • Richard Feldman • GOTO 2021

  Рет қаралды 254,375

GOTO Conferences

GOTO Conferences

Күн бұрын

This presentation was recorded at GOTO Copenhagen 2021. #GOTOcon #GOTOcph
gotocph.com
Richard Feldman - Functional Programming Language Expert & Author of “Elm in Action”
ABSTRACT
Do you care more about how well code works than how conceptually elegant it feels? Are you more interested in how effectively you can build and maintain software than how buzzword-compliant it is? Then this is the talk for you!
People like functional programming for different reasons. Some like it for the conceptual elegance, or the mathematical properties. Richard? He likes to build things. He likes it when the software he builds works well and is easy to maintain. For the past decade he's been using functional programming both professionally and as a hobbyist, and has found it has helped him ship higher quality software in less time than in the decade he spent writing object-oriented code before.
In this talk, he'll share the practical benefits he's enjoyed in FP, and the benefits other pragmatists [...]
TIMECODES
00:00 Intro
04:17 Outline
04:31 Scope: What is functional programming?
06:32 Performance
06:51 Scope: Pure functions
08:55 Performance: Caching
10:57 Performance: Precomputing
12:14 Performance: Parallelizing
15:00 Performance: Performance drawbacks
19:02 Development
19:32 Development: Testing
22:26 Development: Revising
25:49 Development: Debugging
31:18 Development: Development drawbacks
32:35 Ecosystem
38:09 Summary
40:15 Outro
Download slides and read the full abstract here:
gotocph.com/2021/sessions/197...
RECOMMENDED BOOKS
Richard Feldman • Elm in Action • amzn.to/387kujI
Jeremy Fairbank • Programming Elm • amzn.to/2WhZCE8
Wolfgang Loder • Web Applications with Elm • amzn.to/3jblQ3q
Cristian Salcescu • Functional Programming in JavaScript • amzn.to/3y75jBS
/ gotocon
/ goto-
/ gotoconferences
#FunctionalProgramming #FP #Elm #ElmInAction #Elmlang #Testing #Programming #ProgrammingLanguage #Immutability #PureFunctions #FunctionalLanguages #Debugging #Precomputing #Parallelizing #npm #JavaScript
Looking for a unique learning experience?
Attend the next GOTO conference near you! Get your ticket at gotopia.tech
SUBSCRIBE TO OUR CHANNEL - new videos posted almost daily.
kzbin.info...

Пікірлер: 73
@michaelwatson4218
@michaelwatson4218 2 жыл бұрын
Richard Feldman is an excellent teacher. I always learn something from him. It's a good feeling when the light bulb lights up.
@emanuelerabino3909
@emanuelerabino3909 2 жыл бұрын
Inspiring talk. In my opinion the whole industry needs this kind of pragmatic and moderated approach in explaining the value and benefits of FP, instead of fideistic battles.
@gabrielalejandrobernalpere3018
@gabrielalejandrobernalpere3018 5 ай бұрын
The point is that, in general, people don't want to get out of their comfort zone and embrace OOP with blind faith. Many don't even care about improving. It's a matter of attitude towards continuous improvement.
@elliotbarlas
@elliotbarlas 2 жыл бұрын
Excellent summary of the merits of functional programming for the pragmatist. I wish this wisdom replaced the conventional wisdom of Uncle Bob's Clean Code, which is filled with counterexamples. That text seems to revel in solving a problem with the most mutations.
@mortenbrodersen8664
@mortenbrodersen8664 2 жыл бұрын
Another excellent talk from Richard Feldman!
@SimGunther
@SimGunther 2 жыл бұрын
This is a great nuance knowing you have functional AND imperative stuff in your toolbox as you'd default to functional programming for the very reasons he discussed. Nice talk!
@nadeemansari1514
@nadeemansari1514 2 жыл бұрын
MementosJhgjbyb
@DomainObject
@DomainObject 2 жыл бұрын
Fantastic talk! Hear, hear. 👏
@dawid_dahl
@dawid_dahl 2 жыл бұрын
Excellent talk!
@codingedgar4878
@codingedgar4878 2 жыл бұрын
Richard Feldman is the best
@savkelita
@savkelita 2 жыл бұрын
Great video and speech! Thank you Richard.
@shahidkhan0219
@shahidkhan0219 2 жыл бұрын
he really convinced me about functional programming
@imadetheuniverse4fun
@imadetheuniverse4fun Жыл бұрын
18:00 "It's just the thing that would be coming out of the look-up table is a task". That's eye-opening for me, thank you.
@bwfrieds
@bwfrieds 2 жыл бұрын
37:30 is the main point. Limitation is power. Great talk.
@bwfrieds
@bwfrieds 2 жыл бұрын
@@peach_of_justus Ultimate power ultimately corrupts.
@diavolokelevra4795
@diavolokelevra4795 7 ай бұрын
Love the fact that the most replayed sections are about the drawbacks
@lockbert99
@lockbert99 6 ай бұрын
How do you see which sections are played the most?
@ruiw4263
@ruiw4263 2 жыл бұрын
is managed effect just like a thunk (wrapper fn) scheduled by main function? At 21:48, when Richard talked about simulation, it sounds like a stubbing in oop.
@andihofacker
@andihofacker 2 жыл бұрын
A very good talk, thank you! Concise presentation, clearly laid out thoughts.
@Pedritox0953
@Pedritox0953 2 жыл бұрын
Good video !
@MarkusBurrer
@MarkusBurrer 2 жыл бұрын
I love to listen to this guy. But I should start coding
@jaymanx4life
@jaymanx4life 2 жыл бұрын
Elm sounds too good to be true. Will def. pick this up over the weekend.
@austinnar4494
@austinnar4494 2 жыл бұрын
One benefit that I would love to see a language add: In pure functional languages you can automatically skip computations that do not lead to any effect. You can treat the entire program as a directed graph where the function calls are nodes and the edges are values. Any node that does not have path to a task (something that produces user-visible output) can be removed from the graph without affecting the program
@thiagomiranda3
@thiagomiranda3 5 ай бұрын
This already exist, it's called lazy evaluation
@bicatu
@bicatu 2 жыл бұрын
how about integration tests? unless your program does not interact with any external dependency they will still be flaky as it depends on the actual behavior of other things outside your function, right?
@atrucktive
@atrucktive 7 ай бұрын
Great talk and proving specially if you are a JS dev 34:40
@Dannnneh
@Dannnneh 7 ай бұрын
About global variables, it's only accessible to functions in files that are linked to the file containing the global variable, not all functions in the program.
@hughoxford8735
@hughoxford8735 3 ай бұрын
I choose functional techniques out of fear
@gdargdar91
@gdargdar91 2 жыл бұрын
What this guy does would definitely be the next big thing for the evolution of the developer society if they listen. Sadly, today's developers are more attracted to all those shiny new JS frameworks that are garbage in reality.
@michaelwatson4218
@michaelwatson4218 2 жыл бұрын
I think it's hard for an imperative programmer like me to get their head around it. For example, the discussion of promises in JavaScript vs tasks in Elm. With JS you're telling the computer what to do, with Elm you're describing what you want done and the computer figures out how to do it later. I had to sleep on it before I understood what he was saying. It's a shift busy developers don't have time to make, but I agree, they should take the time to understand it.
@gimlam5909
@gimlam5909 2 жыл бұрын
Conversely, the shiniest, newest framework might actually be the only suckless js framework so far - Svelte.
@MeNumber47
@MeNumber47 Жыл бұрын
@@gimlam5909 Svelte is a framework that compiles to JS in order to gain performance and a more comfortable syntax. Elm has already been doing that for years. If you put some time on it, i promise you it'll be worth it
@pengain4
@pengain4 Жыл бұрын
​@@MeNumber47Elm is great but it has a steeper learning curve, unusual syntax and requires accepting mental paradigm shift. Who was "compiling to JS first" is not a settling point at all. ;)
@cozyrain410
@cozyrain410 2 жыл бұрын
so avoid side effects and mutations makes it fp style?
@cozyrain410
@cozyrain410 2 жыл бұрын
@@peach_of_justus thanks
@theazharul
@theazharul 2 жыл бұрын
Is it safe to use Elm as it is not stable yet?
@razzeeee
@razzeeee 2 жыл бұрын
It is, the version number doesn't reflect it. But at this point it hasn't changed significantly for some years and won't according to the author.
@pipi3105
@pipi3105 2 жыл бұрын
It's the most stable language I know and a delight to work on. You'll love yourself for chosing Elm today in 10 years when you'll want/need to refactor your app. The fact that it hasn't had an update in 3 years is just how stable it is. There have been no updates, because the language just doesn't need it.
@jartownboy
@jartownboy 2 жыл бұрын
Nice
@Cookipolation
@Cookipolation 2 жыл бұрын
Memoization and parallelization can't quite be simultaneous features of thread safe pure functions :)
@brendanhansknecht4650
@brendanhansknecht4650 2 жыл бұрын
I don't think that is accurate. You can always memoize per thread or have a thread safe map that is depended on for memoization. It should just a be a question of how it is supported/implemented by the language.
@Cookipolation
@Cookipolation 2 жыл бұрын
@@brendanhansknecht4650 you're proposing impure solutions
@brendanhansknecht4650
@brendanhansknecht4650 2 жыл бұрын
@@Cookipolation memoization is essentially always impure. For it to be used in a pure functional language, it generally requires language level support.
@Cookipolation
@Cookipolation 2 жыл бұрын
@@brendanhansknecht4650 exactly
@brendanhansknecht4650
@brendanhansknecht4650 2 жыл бұрын
That doesn't add any value to comment on. All pure languages eventually compile to impure constructs. Modern hardware is innately impure.
@jackgenewtf
@jackgenewtf Жыл бұрын
I think you know this, Richard, and probably just want to avoid introducing too much terminology into the talk. But I just wanted to point out that at 28:49, technically, if the function has side effects, it isn't "pure", it is "idempotent" though, which I believe is what you meant.
@humble_integrity
@humble_integrity 6 ай бұрын
it depends on what you do... try doing woodworking with a screw driver
@gofudgeyourselves9024
@gofudgeyourselves9024 2 жыл бұрын
ok
@tamask
@tamask Жыл бұрын
Cool, but then how to write to or read from a database? These principles work as long as your code is isolated from the outside world, but such code is useless. How to use this style for real world applications where database access is required too?
@terragame5836
@terragame5836 9 ай бұрын
I believe the "IO monad" is what is used for overall side effects of the program in pure FP. Essentially, your main function gets an instance of this IO monad and must return it at the end. Every impure operation is then modeled as a function that takes it as one of its arguments and return its replacement at the end. Essentially, it represents the state of the universe. An impure operation consumes it, and returns the new state, which is different, so using the returned value again cannot just use the previous cached result. All sorts of input-output tasks, including database interactions, must thus be implemented over the IO monad in a pure functional language
@JameyKirby
@JameyKirby 2 жыл бұрын
const int global1;
@erlangparasu6339
@erlangparasu6339 2 жыл бұрын
actually all skrew drivers are object 😁
@SteffenGluckselig
@SteffenGluckselig 2 жыл бұрын
Everything that happens is via function-calls. 😁
@ikbo
@ikbo 2 жыл бұрын
What's up with Elm? Is it dead?
@MeNumber47
@MeNumber47 Жыл бұрын
More Stable than ever. Still widely used. Give it shot if you get a chance. The more time you put into it, the more it gives back
@kamertonaudiophileplayer847
@kamertonaudiophileplayer847 2 жыл бұрын
It is too bad, no way to generate a unique id using a pure function.
@SteffenGluckselig
@SteffenGluckselig 2 жыл бұрын
Incorrect. You could, e.g. make the seed of the PRNG a parameter to the generator-function.
@TankorSmash
@TankorSmash 2 жыл бұрын
The way RNG is used in pure langs is you pass a seed in and get the result and new seed to use next time back.
@kamertonaudiophileplayer847
@kamertonaudiophileplayer847 2 жыл бұрын
@@SteffenGluckselig So a pure function can return a different result for the same request parameter, you need somehow to deliver that to not very smart viewers.
@brendanhansknecht4650
@brendanhansknecht4650 2 жыл бұрын
@@kamertonaudiophileplayer847 it just takes an extra loop of tasks. First run a task to get the seed(time or whatever) from that point on, anything that needs randomness just depends on that initial input and what is derived from it. So it is pure, but an input is random, leading to random outputs.
@TankorSmash
@TankorSmash 2 жыл бұрын
@@kamertonaudiophileplayer847 the same seed will always return the same value in a pure language.
@anasouardini
@anasouardini 8 ай бұрын
Even the title is FALSE: pragmatic programmer would rather use a combination of tools not just FP. There is no such program that would prefer to be written in one paradigm.
@VeejayRampay
@VeejayRampay 4 ай бұрын
chill
@anasouardini
@anasouardini 4 ай бұрын
@@VeejayRampay aight, aight.
@Nellak2011
@Nellak2011 3 ай бұрын
Richard Feldman even admits that FP is not appropriate for all domains. He said that FP is good when you are far away from bare metal and you are't super concerned with performance (unless you use Roc or some other high performance FP). He said that if you do low level, then it is more fitting to be imperative because the CPU is super imperative. So no, you don't know what the fuck you are talking about with your comment. Actually watch Richard Feldman's videos before spewing this toxicity.
@anasouardini
@anasouardini 3 ай бұрын
@@Nellak2011 Content: fine Title: wrong; clickbaity capiche!
@coldsteel9420
@coldsteel9420 3 ай бұрын
That makes as much sense as saying that a pragmatic programmer would sometimes prefer Assembly.
@mrCetus
@mrCetus 2 жыл бұрын
Great video and speech! Thank you Richard.
Why Static Typing Came Back • Richard Feldman • GOTO 2022
52:01
GOTO Conferences
Рет қаралды 148 М.
Functional Programming in 40 Minutes • Russ Olsen • GOTO 2018
41:35
GOTO Conferences
Рет қаралды 801 М.
Useful Gadget for Smart Parents 🌟
00:29
Meow-some! Reacts
Рет қаралды 8 МЛН
ВИРУСНЫЕ ВИДЕО / Мусорка 😂
00:34
Светлый Voice
Рет қаралды 9 МЛН
FOOTBALL WITH PLAY BUTTONS ▶️ #roadto100million
00:24
Celine Dept
Рет қаралды 159 МЛН
Virtual BSB Software Tour (Ohio)
31:29
Beauty School Boss
Рет қаралды 37
Dear Functional Bros | Prime Reacts
26:03
ThePrimeTime
Рет қаралды 168 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
"Outperforming Imperative with Pure Functional Languages" by Richard Feldman
34:55
Strange Loop Conference
Рет қаралды 85 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Programming's Greatest Mistakes • Mark Rendle • GOTO 2023
51:24
GOTO Conferences
Рет қаралды 66 М.
Object Oriented Programming vs Functional Programming
18:55
Continuous Delivery
Рет қаралды 742 М.
Phone charger explosion
0:43
_vector_
Рет қаралды 38 МЛН
🤏 САМЫЙ ТОНКИЙ гаджет #Apple! 🍏
0:29
Яблочный Маньяк
Рет қаралды 189 М.
Что еще за обходная зарядка?
0:30
Не шарю!
Рет қаралды 322 М.
С Какой Высоты Разобьётся NOKIA3310 ?!😳
0:43
КУПИЛ SAMSUNG GALAXY S24 ULTRA ЗА 88000 РУБЛЕЙ!
27:29
Samsung mobile phone waterproof display. samsung mobile phone digital s23ultra  #shorts
0:15