Robert C Martin - Functional Programming; What? Why? When?

  Рет қаралды 325,837

gnbitcom

gnbitcom

Күн бұрын

Functional Programming

Пікірлер: 290
@AlexandriaRohn
@AlexandriaRohn 8 жыл бұрын
4:07 "Functional Programming: What? When? Why?" -or- "The Failure of State" 5:10 Rich Hickey is the author of Clojure. Listen to his talks. 5:40 What is state? Variables. 11:15 Structure and Interpretation of Computer Programs. This is a fascinating book. For the first 250 pages, the book uses no assignment statements. 14:15 Here's how SICP's model of computing worked before they introduced an assignment statement. Simply replace a function call with its implementation. 15:58 Once you introduce assignment. You can no longer replace a function call with its implementation. Why? Because the state of the system may have changed. An assignment statement introduces the concept of time. 18:04 Side effect: an assignment statement. If there's no assignment, there's no side effect. 20:22 What "hack" have we done to protect us from memory leaks? Garbage collection. 31:46 Functional programming was invented in 1957 before OO and structured. But memory was too expensive to make it practical. But memory is cheap now. 32:53 Should we change how we program? We should because: 1) Functional programs are simpler - which makes them easier to write and maintain 2) There's no temporal coupling - no worrying if some function was called before another function. 3) Fewer concurrency issues. In a purely functional program, there's no concurrency because there is no state. 4) No asking, "What's the state?" 38:38 We're using multicore CPU's now because we can't increase clock rate anymore. And hardware makers are doing bizarre tradeoffs. They're making individual processors slower but putting more processors in. So individual cores slow down but the chip throughput goes up *if* you can take advantage of all the cores. 42:00 How are you going to work with an abundance of cores? Maybe we need to walk away from the assignment statement. 49:49 OO = procedure + state. OO is exposed procedure but hidden state (encapsulation). It's possible to write functional programs using an OO style. All of the objects become immutable.
@mephasor
@mephasor 8 жыл бұрын
+Andrew Rohn Thank you :) Especially the first one was very helpful.
@joshuachen4600
@joshuachen4600 8 жыл бұрын
+Andrew Rohn ,it's really very useful. Thank you.
@dummyaccount7296
@dummyaccount7296 7 жыл бұрын
thanks a lot!
@Kinos141
@Kinos141 7 жыл бұрын
Thank you, man!!
@Bergerons_Review
@Bergerons_Review 7 жыл бұрын
Thank's mate. I love Uncle as much as the next guy, but I just like efficiency more.
@bugs1yb1ins
@bugs1yb1ins 3 жыл бұрын
6 years later, KZbin recommends this to me and functional programming still hasn't taken off. Mainstream languages are simply taking from fp what they like.
@EnergeticWaves
@EnergeticWaves 3 жыл бұрын
how would you have done it
@seekknowledge8034
@seekknowledge8034 3 жыл бұрын
I'm watched over 10 videos about FP. Not a single of them has shown practical real world examples. Programmers are difficult to adhere because you need to practically demonstrate. Why not side by side demonstration?
@shinsawai1
@shinsawai1 2 жыл бұрын
Well they are not taking what they like but they are taking what will improve their mainstream language. Java is getting more functional programming features, C# had them for a while Ruby had them for a while. Functional programming languages such as Closure, Scala, Rust and Elixir are really taking off. Javascript was initially going to be a functional programming language if Java was not hyped at the moment Javascript was created. If Javascript would have been a fully functional programming language functional programming would have been mainstream at this moment.
@recompile
@recompile Жыл бұрын
@@shinsawai1 I wouldn't say that. JavaScript has, from day one, fully supported functional programming. The only feature that was missing was tail call optimization, but that isn't necessary as it is trivial to convert a tail recursive function into an iterative one. There are any number of reasons I could offer you for why no one programs in a functional style in JavaScript. The most obvious being that most JavaScript programmers don't really know anything about the language. Less obvious are the same reasons functional programming never really took off -- the dirty little secret that Lispers and Schemers won't tell you -- functional programs, that do useful work, are harder to read and harder to write than their imperative equivalents. The way forward is to just take some of the more useful concepts from functional programming. First class functions and closures are at the top of the list, of course, as those two things alone completely eliminate the "need" for most of the design patterns that have plagued software for the last 20 years. When Greenspun quipped "Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Common Lisp" He had no idea that the GoF book was going to make that the industry standard!
@tricky778
@tricky778 Жыл бұрын
@@recompile Haskell is easy to read and write if you care to make it so but it is hard to make it fast and use constantly little memory, and all the libraries keep changing and becoming incompatible with each other, and the complexity diagnostics break, and no one seems to know what's breaking, broken, about to break, etc. And all the modules have conflicting names, yet it's obvious that any expert in the language could have defined a self compatible and fuller suite of typeclasses. There are plenty of experts. So it looks like Haskell is a problem ON PURPOSE! I just don't know whose purpose.
@PeterBanka
@PeterBanka 9 жыл бұрын
Now I understand the need for functions programming. Thanks Uncle Bob.
@FlashManinSpace
@FlashManinSpace 9 жыл бұрын
That was the best talk on programming I've ever heard!
@PeterHeard
@PeterHeard 8 жыл бұрын
+Flash Man yeah i said that a lot with ubm
@BryonLape
@BryonLape 3 жыл бұрын
6 years on, at least from posting, and ThreadRipper is up to 64 cores.
@horowitzhill6480
@horowitzhill6480 3 жыл бұрын
rome has even more but those are multi-die processors from what i remember at least, the 3990x has 8 dies, 8 cores each, plus one die for IO so 8 cores per die is still how many we can cram in there. transistor size can not easily go much lower, because atom dimensions chip dimensions can not easily go much larger because electric signal propagation velocity transistor count can not easily go down because boolean arithmetic it will be interesting
@sergeibatiuk3468
@sergeibatiuk3468 4 жыл бұрын
It took me half a year to fully understand this video (and make learn Scala as well) :)
@dmytrosokhach2598
@dmytrosokhach2598 8 жыл бұрын
At the half of the video - and love it! So much fun! :-D I wish all the educational videos were that way. The topic is really good for OO-guys who doesn't yet understand the value of immutability and pure functions.
@jphedley
@jphedley 8 жыл бұрын
The presentation I wish I seen first, when I was transitioning from stateful OOP to Functional.
@ShaunPatterson
@ShaunPatterson 7 жыл бұрын
Structure and Interpretation of Computer Programs... geez. I remember that book. 10 years ago, CS1301
@JinnyjinnyJin
@JinnyjinnyJin 7 жыл бұрын
Very nice. Thank you, Uncle
@oniaiki
@oniaiki 8 жыл бұрын
It's a grea talk! I think a lot of people is missing a point here. And you should watch other of his talks on KZbin. Besides of alll knowledge he can convey on his chats there is a Historical Big Picture point of view he wants to transmit. We tend to think there are many "new" things on programming, but we may have a short memory. Then someone like him let us find out that somebody already did it 40 years ago, with less resources. Why movie industry keep doing remakes and a mix up of other old times proposals. Because new generations will see those as "New". That way make sense to reinvent the wheel every iteration with more bells and whistles. The better and actual it looks, you get more ROI. I heard his talks, he has no problem working with other languages. But always tells the programmer keep your eyes open. Don't get caught inside a mindset. Remember what you have now has evolved from the past.
@0pt618
@0pt618 6 жыл бұрын
The bowling example here is the bedrock of the motivation of using functional programming, but it could be much improved. For example, the `roll` serves completely different purposes in the functional approach and its imperative counterpart.
@robertgeofroy5419
@robertgeofroy5419 7 жыл бұрын
Excellent!
@garychap8384
@garychap8384 6 жыл бұрын
There are these beautiful moments where Robert sounds so much like George Carlin : )
@edwardmason119
@edwardmason119 Жыл бұрын
He sounds more like a cross between Patton Oswald and Lewis Black to me.
@EricTViking
@EricTViking 5 жыл бұрын
"As the tests get more specific, the code gets more generic..." - "As the tests get more specific, the code gets more generic..." - gotta love Uncle Bob!
@hatter1290
@hatter1290 5 жыл бұрын
Richard Moore The fp world has a similar statement, “the more the generic the types, the more specific the implementation.”
@XAngelsLifeX
@XAngelsLifeX 8 жыл бұрын
Спасибо за видео
@Aki-to
@Aki-to 3 жыл бұрын
Loving the scientific introduction.
@joshuajurgensmeier4534
@joshuajurgensmeier4534 8 жыл бұрын
Considerably better at 1.5x speed.
@user-rl9ko7gj5f
@user-rl9ko7gj5f 8 жыл бұрын
+Joshua Jurgensmeier can't agree more LOL
@user-rl9ko7gj5f
@user-rl9ko7gj5f 8 жыл бұрын
+Joshua Jurgensmeier can't agree more LOL
@jbweimar
@jbweimar 6 жыл бұрын
I turned it up to 2x speed. Amazing that at even then his speech sounds like 1x speed sometimes...
@TheRedbeardster
@TheRedbeardster 9 жыл бұрын
Uncle Bob rocks. Thank you.
@douglasmckinley-sr1507
@douglasmckinley-sr1507 3 жыл бұрын
Always fun to watch an older KZbin video and have the benefit of hindsight. Moore's Laws -- 2014 -- 8/16 Gb Thumb Drive - 2021-- 1 Tb Memory Stick ($36) - TRUE FUNCTIONAL PROGRAMMING - Is the future?? Guess that is still TRUE as it has not happened yet.
@laurelsporter4569
@laurelsporter4569 2 жыл бұрын
And with AMD about to give us 64/128MB L3 in mere months, with a mere 16 max desktop cores...what was that about removing cache for more cores? 😆 LISP will always be the future. Been that way since 1958.
@charliesimar7541
@charliesimar7541 7 жыл бұрын
Wow! I haven't seen some of those components in 40 years! I learned programming on Hollerith cards. Fun question: Why are Hollerith cards sized the way they are?
@RoelPompen
@RoelPompen 4 жыл бұрын
The size of the original Dollar bill was used, because the banking business already used tabulating machines for those :)
@thomasmarshall4472
@thomasmarshall4472 6 жыл бұрын
Bob, with every conversation we've had over IM/email/usenet back in the day, I've always just instantly connected with the *why* of what you had to say. VERY good job. Just wish you had more time.
@MrPDTaylor
@MrPDTaylor Жыл бұрын
Do you know uncle Bob?
@calebb831
@calebb831 4 жыл бұрын
Since when were they supposed to be getting rid of speculative execution and pipelining? AFAIK Meltdown and Spectre are still active issues solutions have not been found to yet.
@enesayalp9707
@enesayalp9707 4 жыл бұрын
Hi Uncle Bob, Regarding 9:10 I prefer: private static void printSquares(int n) { if(n > 0) { int square = n*n; System.out.format("%d, \t%d ", n, square); printSquares(n-1); } } Why: The functions first intention is to calculate the square then print that square before handling the next lower number.
@jackblack4246
@jackblack4246 4 жыл бұрын
That is not equivalent to the stateful example. Your program will print the square of 20 first instead of last. His example was correct.
@therealmicksa
@therealmicksa 8 жыл бұрын
What a disappointment - not _once_ did he say "Inconceivable!".
@_skyyskater
@_skyyskater 3 жыл бұрын
hahaha yeah he really does sound like Vizzini
@unfa00
@unfa00 7 жыл бұрын
It's early 2017, AMD's 8-core Ryzen 7 processors have hit the market.
@alexbuhl1316
@alexbuhl1316 4 жыл бұрын
It is now mid-2019, AMD has left Intel in the dust.
@salilsurendran
@salilsurendran 7 жыл бұрын
When Robert C Martin says assignment statement introduces the concept of time. Does he mean assignment to a variable within a function or assignment to a variable contained within an object. How is the assignment of a variable within a function like in a for loop dangerous? When the function completes running I don't care about any local variables that the function used but I will care about any external variables I modified? Similarly why will f(x) ever be not equal to f(x) if the function f never uses any external variables? I guess in the example of Bowling he explains it with an example of assignment to variables within the function and calls it quasi functional. Is that bad? I can clearly see how the example of Bowling with state can be problematic and break the AssertEquals(f(x), f(x)) rule
@Nellak2011
@Nellak2011 8 ай бұрын
What was the point of the oxygen tangent at the start?
@brianskog9947
@brianskog9947 7 жыл бұрын
Anybody know if he presented the event sourcing section (the end that he skipped) in another presentation somewhere?
@avalon2199
@avalon2199 6 жыл бұрын
I like the intro
@0xCAFEF00D
@0xCAFEF00D 8 жыл бұрын
I like the preaching style. Yeah it's nice to have pure functions. Shame you also have to run code on computers where regardless of how 'free' memory is (it isn't really when you have lots of data to work with) it still takes time to access it.
@byllgrim6045
@byllgrim6045 7 жыл бұрын
He sounds like a mad preacher! Sound pretty good.
@lunardust201
@lunardust201 8 жыл бұрын
that squares I think isn't the greatest example anyway, because local variables are not the problem functional is meant to solve, it is more to allow escape from external variables being changed by a function directly (side effects) data within the function, all bets are off
@benaloney
@benaloney 8 жыл бұрын
He sounds like the T-Rex from toy story
@lujonghao
@lujonghao 6 жыл бұрын
LOL
@realwizardry834
@realwizardry834 6 жыл бұрын
If the T-Rex was speaking at half his normal speed
@SolarPlayer
@SolarPlayer 4 жыл бұрын
lol i never saw toy story so I checked it and the trex does sound like uncle bob
@tobyhinloopen5541
@tobyhinloopen5541 8 жыл бұрын
I'm living the Rails bubble :D
@davidmcdonald7506
@davidmcdonald7506 5 жыл бұрын
still livin it
@Machin396
@Machin396 3 жыл бұрын
@@davidmcdonald7506 Nah it broke years ago.
@MaheshMoodley
@MaheshMoodley 6 жыл бұрын
side effects are like the sith...always two there are....that killed me
@mikael642
@mikael642 7 жыл бұрын
What did he mean when he said future processors won't have caches? Where can i find something that supports this? Sounds crazy.
@fabdlnltc
@fabdlnltc 7 жыл бұрын
I dont know if i understood, but, If you have 64 parallel processors, the cost of knowing which data is better to be executed by one of those processors (1 cache per processor), would be nearly higher than the benefits of using cache (Or going to that road at least). However, you could have a common cache for all processors or groups, yeah. But that could dissapear too if RAM becomes so fucking small (physically) and cheap just to put it inside a microprocessor chip.
@Yetipfote
@Yetipfote 8 жыл бұрын
21:47 imho the roll()-method pushes an element to the rolls-Array, changes its length thereby and therefore is not pure. However it is true that no elements are mutated. But the whole list is beeing mutated. Another more general point I thought about: making value assignments to named identifiers mustn't be avoided at all costs. It has the purpose to add meaning to a value which you can comprehend when you read the code! This can significantly reduce complexity. But you should avoid globals and use local variables only in very close scopes. In JavaScript e.g. there is the new let-keywod which lets you define a variable only for the current block and not the child block. This is imho great!
@Vectorh
@Vectorh 8 жыл бұрын
+Lorz Ronz I think there might be some confusion about declaration vs. assignment. Declaring values is ok in functional languages. Lisp has a let function too. You can do (let ((x 3) (y 4)) (+ x y))). The problem comes when you re-assign a new value to an existing value. So in a non-functional language, doing `int a = 10` is not violating immutability, but then doing `a = a + 2` is. Thus, you can have your descriptive value names.
@Yetipfote
@Yetipfote 8 жыл бұрын
+Vectorh I think you cannot _declare_ a value. You can only declare an identifier which holds no value yet, like 'int NumberOfCoffeBreaks;' You declare the variable's type and its identifier so the compiler can work with it. After that you may assign/define a value to the variable like 'NumberOfCoffeBreaks = 30'. But using variables at all is forbidden in strict functional programming. You just work with return values of functions. That is what I got so far and it is imho a bit over the top...
@Vectorh
@Vectorh 8 жыл бұрын
What I'm trying to say is your fears are unfounded. You can use named values in functional languages. But in non-functional ones, the closest you can get is using assignment *in the declaration* but not after. In such cases this must be acceptable in order to approximate functionalism. So to be clear, in Java it is ok to do 'int x = 10;' and your code can still be considered functional as long as you never modify the value of x after the *first* assignment. In fact, you should use 'final' to assert that cannot happen (and thus why 'final' is everywhere nowadays).
@Yetipfote
@Yetipfote 8 жыл бұрын
+Vectorh ah! Now I see that you only mean reassignment!
@Vectorh
@Vectorh 8 жыл бұрын
+Lorz Ronz Yes. And I think that's what Martin must mean too.
@tricky778
@tricky778 Жыл бұрын
Hardware caches are going away but we'll still have software caches? What is a software cache as an alternative to a hardware cache?
@2002budokan
@2002budokan 8 жыл бұрын
Very informative for Functional Programming. You can follow the new trend with the same enthusiasm. if you can look at the world with the blinders. But do you know how many programming paradigms exist? en.wikipedia.org/wiki/Programming_paradigm So how can we choose a panacea? We should think pragmatic.
@MrGoatflakes
@MrGoatflakes 4 жыл бұрын
The slides skipped through at 55:12 make me think the best parts of this talk were skipped over ._.
@janjanusz8271
@janjanusz8271 4 жыл бұрын
Yeah... functional programming is great for web back-end, while this is not the entire programming scope. I work in gamedev and here objects are pretty suitable. There are certain areas where keeping the state is quite important and having objects is helpfull.
@EvanZamir
@EvanZamir 9 жыл бұрын
Wondering about the statement "Only assignments have side effects." What about writing to a database? That is a side effect obviously, but doesn't necessarily involve any assignment or state *inside* the program. It's state *external* to the program, I suppose.
@JeremyAndersonBoise
@JeremyAndersonBoise 8 жыл бұрын
+Evan Zamir Ultimately we have to have some side effects, a truly pure functional language would be useless, we need i/o at the least, writing to a db would be considered i/o generally.
@ChristopherCabanneWork
@ChristopherCabanneWork 8 жыл бұрын
+Evan Zamir Yes, make it external with I/O monads: en.wikipedia.org/wiki/Monad_(functional_programming)#The_I.2FO_monad
@shipper66
@shipper66 8 жыл бұрын
+Christopher Cabanne Or just embrace pragmatism and learn Clojure ;)
@stevenkjames
@stevenkjames 5 жыл бұрын
Cool
@clarkd1955
@clarkd1955 3 жыл бұрын
News flash: A statement in most computer languages is not a statement of fact like it would be in Math. x=x+1 says add 1 to the value at location “x”. Or you could say, calc the value of x+1 and then store the value to the location labelled “x”. A statement might look like a Mathematical formula (a statement of truth) but it is actually a calculation and then the storing of the answer so you can use it later. There is no problem with this computer interpretation of this syntax and it has worked for the last 70 years. The misunderstanding is that only Math notation is useful when provably that is not true.
@RoyRope
@RoyRope 5 жыл бұрын
Structure and Interpretation of Computer Programs stil relevant and worth reading today?
@RoelPompen
@RoelPompen 4 жыл бұрын
Yes, absolutely. Especially if you'll be in the business for the coming decade(s). It will take a couple of years for the world to acknowledge this, but we're moving to functional languages built on top of Object Oriented VMs that provide smart composite data structures. One of those languages is the virtually syntax free Clojure. I've had many debates about the merits of Clojure when I was an employee, but no one ever wanted to challenge me in practice. Probably because I threw together parallel systems in minutes while I was talking. :) SICP is a great basis for learing to think functionally, which will help with languages of the future like Julia and Clojure(script).
@cwildsblog
@cwildsblog 5 жыл бұрын
they should add a spoiler alert for the book he mentioned at 11:20
@user-cq6ip3be2t
@user-cq6ip3be2t 7 жыл бұрын
int x = 1; means x is a variable. and as name implies value of variable could be changed.
@garychap8384
@garychap8384 6 жыл бұрын
Except where 'x=1' defines a constant ... y'know... because maybe you're using a functional declarative language, which *has no fucking variables or assignments!* BTW. Did you know that there is an hour long video associated with this comments section! No, really! You should try watching it. : ) You're welcome XD
@chovuse
@chovuse Жыл бұрын
Its too bad time ran out ! I was enjoying !
@amigalemming
@amigalemming 8 жыл бұрын
Unfortunately, the number of cores in laptops don't seem to go up for 5 years now, too.
@alexusanin1632
@alexusanin1632 7 жыл бұрын
Laptop is laptop, number of cores on servers where the "properly written software" is much needed can be quite different from your laptop.
@reflechant
@reflechant 5 жыл бұрын
Today is 2019. We have Intel Core i9 (18 cores @ 4.4 GHz max) and AMD Ryzen Threadripper (32 cores @ 4.2 GHz max) . As for laptops the most powerful have 6 cores because it looks like you don't need more for laptop tasks.
@porky1118
@porky1118 5 жыл бұрын
The language I'm using also does the function substitution thing in some cases depending on the constness of arguments. It also has no garbage collection. Even with functional programming, one could do compile time optimizations, so it won't even consume more memory. About the parenthesis number in lisp langauges: It's sometimes a bit more. Examples: Multiple parentheses at once (for example in CL `let` statement `(let ((x 1) (y 2) ...)`) or Simple math (`(+ (* fac a) (* (- 1 fac) b)`) But at least it uses less commas and semicolons. (The language I'm using also is a lisp, but with indention based syntax (like python), so it even has less parentheses than lisp and less syntax than python or c in general. (just a few predefined macros and read macros to simplify langauge) Also in some cases, state is almost required, for example for simulation of moving objects (like in most games). Making a copy for every acceleration may be pretty inefficient. And I even like to use other "bad" practices (at least function pointers rather than some complicated OO stuff, closures are fine, but are practically just like function pointers), or sometimes even goto is better than a loop (at least the c-loops, named let is also a powerful loop technique, similar to goto, and you have better control than with c-loops)
@patrolin
@patrolin Жыл бұрын
which language is that?
@jope2
@jope2 6 жыл бұрын
At 21:30 he mentions how languages have introduced the hack of garbage collection to deal with side effects relating to memory. And here I'm programming in C++ with destructors to automatically deal with every kind of side-effect he mentioned, and no garbage collection ('cause C++ programmers don't write garbage).
@AlexeyIovchuk
@AlexeyIovchuk 5 жыл бұрын
First examples change state of an output.
@MehulKumar_m3huL
@MehulKumar_m3huL 8 жыл бұрын
I'm convinced.. sort of ..
@BryonLape
@BryonLape 4 жыл бұрын
It is 5 years later and Intel processors still have cache in them. Maybe he's talking about AMD.
@csmusic6505
@csmusic6505 4 жыл бұрын
Yeah and we hit faster speeds than 2.5Ghz, seems sort of poorly informed. Pipelining hasn't gone away either.
@RancidPolecat2
@RancidPolecat2 8 жыл бұрын
Close your eyes and imagine Patton Oswalt delivering this presentation. You will never be able to un-hear it.
@JeremyAndersonBoise
@JeremyAndersonBoise 8 жыл бұрын
+Trevor Exley You just ruined and/or improved Uncle Bob talks for me forever.
@codinginflow
@codinginflow 3 жыл бұрын
Why does he always start his talks with these unrelated interesting topics? I'm not complaining, just wondering, because they don't seem to be connected to the talk at all.
@justinkendall5647
@justinkendall5647 3 жыл бұрын
I'd imagine it's to grab the audience's interest and engage them before getting them into the meat of the talk. If the audience is already primed to receive information, then they'll be able to follow the talk a lot better because they'll absorb the information immediately instead of having to play catch-up as their brain warms up. (Might be good to give stragglers a few minutes to get settled too.)
@codinginflow
@codinginflow 3 жыл бұрын
@@justinkendall5647 makes sense I guess
@avimehenwal
@avimehenwal 3 жыл бұрын
He generally does that in other videos I saw as well. Maybe its to grab the interest. Glad he does that. Gets to learn 2 topics in a single video :)
@DanielNyong
@DanielNyong 3 жыл бұрын
It’s hilarious, my favorite part of his talk
@TimTeatro
@TimTeatro 7 жыл бұрын
Actually, the answer to the both questions on the origin of Nitrogen and Oxygen is simply that they came about as fusion products during sopernova explosions. :P
@scottnoel-hemming6750
@scottnoel-hemming6750 8 жыл бұрын
Good luck running your app on disk memory and not in RAM. Maybe he assumes we'll all be using SSD's soon. Sure they're cheaper these days, but not ubiquitous. I'm not saying he's wrong, but he is transitioning between RAM and "Hard" disk storage as if they are the same and they're not.
@zelphirkaltstahl461
@zelphirkaltstahl461 7 жыл бұрын
I think he is more about the "in principle" side of things, once some of the kinks like "slow I/O" are gone. He puts it in perspective at the beginning of the talk, naming it a train racing towards us, threatening to roll over us, if we don't adapt to these changes, for example by using the right tools for the job.
@romsthe
@romsthe 8 жыл бұрын
Memory is cheap and fast to use when you have a very expensive PC or high-end ARM processor. When you use small microcontrollers, small amounts of internal memory are not that cheap, and external memory access are too slow to be really efficient. Computers and phones are not the only programmed devices we live with, they're even far from being the majority and it would be stupidly expensive to run everything on an ARM+Linux. This lecture's got the usual bias of PC only devs. The industry still needs programming languages with small memory imprint.
@bighands69
@bighands69 8 жыл бұрын
+romsthe You are referring to embedded system. More powerful systems will eventually be pushing towards functional programming where memory is not important. Even laptops are getting to point were all the excess memory is not required unless running higher performance tasks. Some day embedded systems and micro controllers will be using high-end memory like lap tops today.
@romsthe
@romsthe 8 жыл бұрын
+bighands69 If the 4-cores + 4G RAM ARMs processors ever get into the 1-2$ price range maybe. Otherwise, not gonna happen.
@eNSWE
@eNSWE 8 жыл бұрын
I'm pretty sure you won't find anyone advocating using F# for programming microcontrollers. You're mixing oranges and apples here really. No one is claiming that low-level languages are dead or dying.
@romsthe
@romsthe 8 жыл бұрын
Well I'm glad to hear, or read, though the lecture considers functional programming for any kind of fruit. I guess my real concern is I'd like to see more efforts in proposing new languages/concepts for embedded. I'd love to see a language with java/C# look, very loosely object (like function pointers in the struct for modifiable methods only), with minimal memory impact and NO freaking header files. But on that last point, I'm pretty sure many would agree.
@amigalemming
@amigalemming 8 жыл бұрын
I'd be glad to see microprocessors that are tailored to the functional paradigm, like the Reduceron project.
@UberOcelot
@UberOcelot 5 жыл бұрын
Great talk, but what is all this nonsense about hardware cache being ripped out? I've seen no evidence that it's going anywhere. I see no evidence that ISA's are now changing away from a load/store or register/memory architecture towards something that operates directly on memory with no intermediary cache. We'll still need a whole layer of hardware logic for memory virtualization anyways for our modern concurrent processes environments. Seemed like some hot air to me.
@williamdavidwallace3904
@williamdavidwallace3904 7 жыл бұрын
I understand the issue of doing assignments to file or global static (class) variables but what is the issue for an assignment for a variable that is allocated in the stack frame?
@rkcst6503
@rkcst6503 7 жыл бұрын
"Side effects are like the Sith; Always two, there are." Oh my God that made my day hahahahahaha thank you. Excellent lecture. I don't care what all the complainers and whiners say, nor do I care to read people's comments about how one language is better than the other (come on guys, stfu lol), this is still an excellent lecture, functional programming is still a beautiful thing, and it will in no way make you understand LESS about computation. If it isn't useful to you, don't use it. :) It is useful to me because it is really deepening my understanding of computer systems and data representation/computation in general, which is why I say it is such a beautiful thing. And he made an awesome Star Wars reference which makes me happy.
@PvblivsAelivs
@PvblivsAelivs 5 жыл бұрын
"I don't care what all the complainers and whiners say" You cared about what one complainer and whiner said.
@skepticmoderate5790
@skepticmoderate5790 5 жыл бұрын
But how does anyone change anything in the real world (i.e. Writing to disk or outputting to the screen) without changing state? Maybe I just don't understand the concepts.
@dubiouslycrisp
@dubiouslycrisp 3 жыл бұрын
Functional programs isolate the nonfunctional stuff to a small area. Instead of having lots of areas in your code writing to disk/network/etc, you design the vast majority of your code to return data structures or values. A different chunk of code, the impure part, will take that data and send it out to the system.
@hineko_
@hineko_ 5 жыл бұрын
Intel i7-8700K has 12M of cache
@victornascimento8358
@victornascimento8358 4 жыл бұрын
1.25x speed sounds disturbingly normal
@georgeshopov8504
@georgeshopov8504 6 жыл бұрын
Memory may be cheap... access to memory however is not!
@romanscharkov
@romanscharkov 5 жыл бұрын
so..?
@trampflips101
@trampflips101 3 жыл бұрын
I was always told print statements can be side effects as well?
@AvindraGoolcharan
@AvindraGoolcharan 3 жыл бұрын
I've heard that any I/O is considered a side effect
@trocchiettoski
@trocchiettoski 3 жыл бұрын
not an expert but i guess this happens in c and not in java. just guessing
@trampflips101
@trampflips101 3 жыл бұрын
@@trocchiettoski why would the language matter?
@trocchiettoski
@trocchiettoski 3 жыл бұрын
@@trampflips101 a side effect comes out an assignment and in C you can use an assignment expression as a value
@trampflips101
@trampflips101 3 жыл бұрын
@@trocchiettoski I still don't know what you mean. I was saying that a print statement inside a function is considered a side effect, regardless of which language you're using.
@RaaynML
@RaaynML 8 жыл бұрын
When he says memory, he means storage?
@bpenda94
@bpenda94 8 жыл бұрын
+ShadowMassacr13 I think the implication there is that storage and RAM are quickly converging
@daniellindforsbernholm3682
@daniellindforsbernholm3682 7 жыл бұрын
was going to post a long response about virtual memory. then I saw your response. lol
@Lpapadop
@Lpapadop 7 жыл бұрын
there is volatile memory (RAM) and persistant memory (ROM). When a program runs the processor reads and writes to memory . It doesnt matter where this ends up wether is it ROM or RAM. ROM can become RAM through paging
@JonathanRossRogers
@JonathanRossRogers 7 жыл бұрын
Maybe you can explain the difference between memory and storage? en.wikipedia.org/wiki/Computer_data_storage explains it pretty well.
@gorgolyt
@gorgolyt 7 жыл бұрын
What's the difference? Both RAM and storage store information, that's all. For practical reasons they tend to be used to store different things, but fundamentally there is no difference.
@ClaymorePT
@ClaymorePT 9 жыл бұрын
Processors manufactureres are removing cache?? That's a new... Last time I checked, it was increasing and number of cores are stagnant... in fact, the newest 5th gen intel CPU's for laptopts, only have 2 cores... Cache is not reducing... it is increasing. Also, if you only have 2 or 4 cores, why creating lots of parallel jobs? Why increase the memory usage, when memory is so sloowww when compared to cache memory? Most programs don't even have multicore requirements because well.... they don't simply need it!
@ClaymorePT
@ClaymorePT 9 жыл бұрын
***** I Agree. I have seen other talks which are much better.
@FreeScience
@FreeScience 9 жыл бұрын
***** I don't completely agree that he "mixes" them up. In computation theory there isn't really a distinction between them, but he could have clarified that. In practice there's quite a difference of course, not many computers pushes 100GB of memory.
@CPSPD
@CPSPD 4 жыл бұрын
how do you feel 5 years on haha
@rictr7421
@rictr7421 3 жыл бұрын
Ryzen and M1 in 2021? Intel is no longer holding us back.
@VeejayRampay
@VeejayRampay 5 ай бұрын
1.25 speed is a must here
@TheRedstoneTaco
@TheRedstoneTaco 6 жыл бұрын
But would functional program work for something like AI?
@RoelPompen
@RoelPompen 4 жыл бұрын
The guy who coined the term Artificial Intelligence and set up the first AI labs at Stanford and MIT also invented the first functional programming language. I consider it a prerequisite.
@ECRandomBits
@ECRandomBits 3 жыл бұрын
Amazing how I got strong cult vibes by 21:00
@Neverrisen
@Neverrisen Жыл бұрын
Mere humans should be allowed to change local variables.
@byllgrim6045
@byllgrim6045 7 жыл бұрын
The state is still there, it's just moved into function parameters?
@nodetransit4277
@nodetransit4277 4 жыл бұрын
17:05 nunit users are crippled Japanese DO NOT unit test, I think you need to redefine what you mean by 'crippled.'
@friederichhuepfenstolz4011
@friederichhuepfenstolz4011 7 жыл бұрын
Lol, the oxygen released during photosynthesis comes from water not carbon dioxide. It's been shown using isotope markers.
@rickdeckard1075
@rickdeckard1075 7 жыл бұрын
Why is there 'error'? wtf he talkin about
@MrBatraaf
@MrBatraaf Жыл бұрын
The first couple of seconds I feared that I had mistakenly clicked on a Jordan Peterson link, but it turned out to be well worth my time.
@askarkalykov
@askarkalykov 3 жыл бұрын
Came back here in 6 years. Macs have 6 cores. Maybe they will have 8 in 6 more years :/
@phocks64
@phocks64 9 ай бұрын
Hardware caches will go away lol
@bocckoka
@bocckoka 7 жыл бұрын
memory is cheap, unless you want to manufacture 20 million microcontrollers.
@rewtnode
@rewtnode 7 жыл бұрын
It's interesting and sometimes funny, yet i wonder if this is a cult?
@MrGoatflakes
@MrGoatflakes 4 жыл бұрын
That's not really much different from every other camp in computing or anything else for that matter. Pretending to be the answer to every problem or question is rife. If you aren't going to be swept up and be taken for a ride that might cost you have to dispassionately separate the wild hyperbole from the actual costs and benefits of the new discipline that is being imposed and think long and hard about where such an approach will benefit you. Building an easily replaceable tool, small utility or short backburner project is as always a good way to get your feet wet and see if it might be something you could commit more resources to.
@HMijailAntonQuiles
@HMijailAntonQuiles 4 жыл бұрын
Only, "the new discipline that is being imposed" is actually the old discipline from the 60s that keeps being brought back because all the alternative shortcuts we have been trying since then keep failing on us.
@crabsynth3480
@crabsynth3480 4 жыл бұрын
A cult asks you to believe in things without providing any logic or evidence... uncle bob lectures never ask you to take anything on faith... he provides reasoning and justification for everything.
@justincharette6151
@justincharette6151 8 жыл бұрын
Functional Programming? Inconceivable!
@tiozz
@tiozz 8 жыл бұрын
Oh no! a spoiler about the book hahaha
@colinrickels201
@colinrickels201 Жыл бұрын
Only a functional dev would claim a recursive function is more safe than a for loop
@jaimesangcap7227
@jaimesangcap7227 6 жыл бұрын
interesting talk. too bad he wasn't able to finish it.
@junpeiiori4720
@junpeiiori4720 7 жыл бұрын
what am i doing here
@zelphirkaltstahl461
@zelphirkaltstahl461 7 жыл бұрын
Getting educated : )
@n8style
@n8style 8 жыл бұрын
He sounds so much like the Grand Nagus lol
@Darkrumors
@Darkrumors 8 жыл бұрын
+n Mixed with a bit of Lewis Black, I can see it.
@atlantis_expedition_member4747
@atlantis_expedition_member4747 8 жыл бұрын
+n Oh my god that is so true. I cannot unhear it now :)
@_skyyskater
@_skyyskater 3 жыл бұрын
hahahhaah omg he does.... Trex from Toy Story mixed with Vizzini from Princess Bride, mixed with George Carlin, mixed with Grand Nagus from DS9... lmao
@zdravost
@zdravost 6 жыл бұрын
I have read the same book. They discuss assignment as the very first thing in the book. Namely, the discuss statements like (define *pi* 3.14). If that is not an assignment statement, then I am not sure what is. Or perhaps R. Martin is being disingenuous.
@strictnonconformist7369
@strictnonconformist7369 5 жыл бұрын
Read the first word of that statement and ponder the literal definition of "define"
@VladaJanosevic
@VladaJanosevic 9 жыл бұрын
Rich Hickey videos: kzbin.info?search_query=Rich+Hickey
@shipper66
@shipper66 8 жыл бұрын
+Vlada Janošević People should first watch all of the Hickey videos indeed !
@sara-hc7wb
@sara-hc7wb 7 жыл бұрын
I kinda feel like this doesn't at all show FP. it glosses over a few of the points of it but doesn't show any. the bolwing program is built using 100 % imperative constructs like for-loops and assignments, making a "function" that is not composable and hides state inside an object. it's like the antithesis of FP. the only difference between that and the statemachine is that the statemachine is kinda overengineered, although it could very well be the right approach if you need more functionality. I just don't think you can show the actual advantages or indeed the very basics of FP using small programs that just process a list and outputs something. just how you can't show the ideas and points of OOP by making a Dog class and calling "bark()"
@sleepingeye
@sleepingeye 7 жыл бұрын
I don't get this guy, what is wrong with GC? I kinda like it. Try making an actually useful and functional program in functional programming language, i don't think anything substantial has ever been done in those languages.
@mikael642
@mikael642 7 жыл бұрын
lol. dude thats just stupid. of course there has been. Do you think that all these functional languages are just some hobby projects? Facebook uses Haskell for spam checking. Ericsson developed the Erlang language for telephone switches. There are alot of examples. Usually when people write a desctop application they use a mainstream language, but thats mostly because it's the way it's always been. Not because it wouldn't be a good idea to make one in a functional language.
@zelphirkaltstahl461
@zelphirkaltstahl461 7 жыл бұрын
I once read about a program on a satellite being debugged from earth using a LISP REPL. Not sure where I read that though. It is used for space exploration then.
@juansebastianpolaniaramire4530
@juansebastianpolaniaramire4530 7 жыл бұрын
If you got a hammer, everything looks like a nail. Functional programming is useful for some tasks and imperative or OO programming is useful for others. Whatsapp uses Erlang for their server side tasks, and twitter and LinkedIn used Scala, a programming language aimed to combine FP and OOP.
@sara-hc7wb
@sara-hc7wb 7 жыл бұрын
I've never with my own eyes seen anyone using portuguese to convey any useful idea whatsoever, so I must assume that portuguese is a useless language that has no real-world applications. obviously it couldn't possibly be because I don't know any people from portugal or brazil or wherever.
@titanarmy4116
@titanarmy4116 7 жыл бұрын
Why bother with pure functional programming when mathematics is there? In reality, state is unavoidable. You dont have to wait for the multi cored future, we have had parallel programming for a long time. API's like opencl allow you to use the gpu as though it were are very multi cored cpu. The host program deals with state like the user interface, stored data from databases files etc and then you push functions to the gpu. The reality is a mixture of paradigms. OOP and procedural for host and functional for parallelism.
@kaktotak8267
@kaktotak8267 7 жыл бұрын
Once again I see that the proponents of functional programming are ideologues who don't deal with real programming much.
@Suamere
@Suamere 7 жыл бұрын
Do you see that? Please point out particular people, because you surely aren't talking about the video. I'd like to see where your comment is going.
@theschinkelfamily
@theschinkelfamily 4 жыл бұрын
don't forget to watch The S.O.L.I.D. Principles of OO and Agile Design - by Uncle Bob Martin kzbin.info/www/bejne/qmmZp2aEabSmnrM
@buzzybuzz2906
@buzzybuzz2906 6 жыл бұрын
Why doesn't he ever mention Erlang or Elixir?
@shoqed
@shoqed 6 жыл бұрын
he did mention erlang tho
@cbrnerd
@cbrnerd 6 жыл бұрын
And Elixir
@labcrowd
@labcrowd 7 жыл бұрын
He sounds little bit like young Samuel L Jackson
@llothar68
@llothar68 8 жыл бұрын
Unfortunately the world is functional. Functional programming is still not offering enough value in real life programs over imperative programming. What we need to boost programs are PCIe connected 16TB disks and 10GBit Ethernet on cheap hardware and 128GB RAM. Not more cores and functional shit
@midqualitygaming3498
@midqualitygaming3498 3 жыл бұрын
STOP ASKING SO MANY QUESTIONS MR SPEAKER, WE KNOW YOU KNOW THE ANSWERS STOP TAUNTING EVERYONE!
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
"Uncle" Bob Martin - "The Future of Programming"
1:18:21
Paul Stringer's Mobile Tech
Рет қаралды 1,7 МЛН
одни дома // EVA mash @TweetvilleCartoon
01:00
EVA mash
Рет қаралды 6 МЛН
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 35 МЛН
The magical amulet of the cross! #clown #小丑 #shorts
00:54
好人小丑
Рет қаралды 24 МЛН
Ауылға қайт! | АСАУ | 2 серия
33:16
Qarapaıym Qanal
Рет қаралды 1,1 МЛН
Functional Programming in 40 Minutes • Russ Olsen • GOTO 2018
41:35
GOTO Conferences
Рет қаралды 802 М.
Stop Recommending Clean Code
27:05
ThePrimeTime
Рет қаралды 429 М.
What is Clean Code? with "Uncle Bob" Robert C. Martin
12:07
The Data Science Channel
Рет қаралды 9 М.
Rust and RAII Memory Management - Computerphile
24:22
Computerphile
Рет қаралды 211 М.
Uncle Bob LOVES Functional Programming | Prime Reacts
22:59
ThePrimeTime
Рет қаралды 109 М.
Functional programming design patterns by Scott Wlaschin
1:05:44
Ivan Plyusnin
Рет қаралды 190 М.
Functional Programming for Pragmatists • Richard Feldman • GOTO 2021
40:30
The Scribe's Oath • Robert "Uncle Bob" Martin • GOTO 2017
59:15
GOTO Conferences
Рет қаралды 161 М.
Functional Programming & Haskell - Computerphile
9:19
Computerphile
Рет қаралды 655 М.
одни дома // EVA mash @TweetvilleCartoon
01:00
EVA mash
Рет қаралды 6 МЛН