No video

FP vs OOP: Choose Two by Brian Goetz

  Рет қаралды 31,479

Devoxx

Devoxx

Күн бұрын

Subscribe to Devoxx on KZfaq @ bit.ly/devoxx-...
Like Devoxx on Facebook @ / devoxxcom
Follow Devoxx on Twitter @ / devoxx
This talk is about the fictitious divisions we invent, and how they harm the progress of our industry. In particular, we'll look at the supposed tension between Functional Programming and Object-Oriented Programming, and hopefully see that the tension is all in our heads.

Пікірлер: 53
@slazter274
@slazter274 5 жыл бұрын
Very enlightening, as a CS student whose first course was in Haskell, and now doing OOP in Java, this really broadened my understanding of the problem domains to apply FP to, and where to Apply OOP.
@joshhoover1202
@joshhoover1202 4 жыл бұрын
Which university teaches haskell as their first programming course?
@cinialvespow1054
@cinialvespow1054 3 жыл бұрын
@@joshhoover1202 sounds like a cool one
@cevxj
@cevxj Жыл бұрын
@@joshhoover1202 good question
@caesarbala
@caesarbala 5 жыл бұрын
Use object oriented on boundaries use functional programming with in boundries saved your time 30 mins
@osman3404
@osman3404 5 жыл бұрын
caesar bala that’s EXACTLY what I was thinking and I am so glad to hear it from such distinguished expert
@dudespoon4852
@dudespoon4852 5 жыл бұрын
whats "boundaries"
@pnadmin7927
@pnadmin7927 5 жыл бұрын
@@dudespoon4852 I think he is saying un-boundaries
@hellowill
@hellowill 5 жыл бұрын
procedural -> fp -> oop
@yu-shenghunag5222
@yu-shenghunag5222 5 жыл бұрын
Do the boundaries mean i/o control or else?
@michaeljuliano8839
@michaeljuliano8839 4 жыл бұрын
Encapsulation is definitely misunderstood and misapplied, but it's definitely not that it's used in all sorts of inappropriate places. It's that people somehow conflated encapsulation with getters and setters which were a peculiar feature of Java Beans. Proper encapsulation is essentially the black box principle. The users of objects should not care about the implementation details of the objects in question. FYI, getters and setters actually break encapsulation by allowing the users of objects to monkey around with internal state and are pretty much always bad practice, especially when compared to proper block box encapsulation.
@reachnira
@reachnira 5 жыл бұрын
Very nicely said. I use both and feel it is not about one over the other but it is about where & when to use what.
@martinschrodt5797
@martinschrodt5797 5 жыл бұрын
Thank you, Mr Goetz, for this talk that tries to tear down borders. I am a guy that grew up on the imperative side of things, and remember having big aversion (what the F should I use this for) to the functional side when it was introduced with Java 8. In the time since then, I really embraced it, and I have to say, it's very powerful. But still, mutable state is something you cannot just declare away (as in pretend to be evil and not be useful), so I agree with the talk: Just leverage both!
@TobiasVetterTV
@TobiasVetterTV 5 жыл бұрын
Isn't the whole idea behind languages like Scala and OCaml to combine the power of functional and object oriented programming? Clojure, too has some neat ideas how to at least use the good parts of object oriented programming in a functional language. Not to mention that a lot of object oriented languages have adopted some functional programming stuff by now.
@SiddharthKulkarniN
@SiddharthKulkarniN 5 жыл бұрын
Also Rust
@MikeEnRegalia
@MikeEnRegalia 2 жыл бұрын
Just use what works best for the given task. Some problems have very beautiful functional solutions. In the real world, problems often are more complex. If the actual problem is best represented as a system of communicating objects, OO doesn't seem like such a bad idea.
@cjnickel
@cjnickel 5 жыл бұрын
IO monad is that separation between your pure, functional core and side-effectful / imperative code that is being proposed, except it's also enforced via the type system. If you don't like the enforced separation then something like F# (or OCaml) take a more "ideal" approach with functional first, OO when necessary (if at all), and no enforced separation between pure/impure code.
@orlovskyconsultinggbr2849
@orlovskyconsultinggbr2849 4 жыл бұрын
In my opinion we should always think how easy to read the code in fp, if the readability is bad i dont care if it fp or oop , its would be bad and painfull to refactor.
@nitinagrawal6637
@nitinagrawal6637 4 жыл бұрын
OOP or FP both are ways to look at the problem & solve, so both are good/bad in their own ways. But people take their differences to make their own money, rather concentrating to understand the issues properly as none is a silver bullet like people try to advertise their favorite language. So such people are like who pull the others down to rise.
@chinmaydas4053
@chinmaydas4053 2 жыл бұрын
You are saying the actual truth here 👍👍
@avimehenwal
@avimehenwal 2 жыл бұрын
can someone please help me with the link to talk he recommends at 26:40. I could not find that that with name 'Boundaries'
@Laggie74
@Laggie74 3 жыл бұрын
Wisdom is knowing there's no one size fits all solution to everything. The real world is complicated. Even first principles of physics don't have a unified theory. Wave or particle, it could be both.
@elliotbarlas
@elliotbarlas 3 жыл бұрын
Brian keeps repeating the there is no encapsulation with procedural C programs, but aren't symbols with internal linkage exactly that? C programs are composed of many individual translation units and each one can be mostly sealed with well-defined interfaces that have external linkage.
@drdzdd
@drdzdd Жыл бұрын
21:04 : this quote, I will never forget
@mustafa1991n
@mustafa1991n 5 жыл бұрын
What about Logic and constraint programming, where one writes Relations instead of Functions ... your program can run forward and backwards ... reuse is exponentially better than in OOP or FP ... people should learn more about Logic programming too.
@aorusaki
@aorusaki 4 жыл бұрын
Still need control
@aorusaki
@aorusaki 4 жыл бұрын
Of low level stuff
@ducnguyen123
@ducnguyen123 5 жыл бұрын
Dont be a FP or an OOP programmer, be a better programmer.
@SujayNarsale
@SujayNarsale 5 жыл бұрын
So... git gud?
@kitkarson4226
@kitkarson4226 2 жыл бұрын
please show some code in the presentation. sigh!!
@tangdexian3323
@tangdexian3323 5 жыл бұрын
love this talk
@nitinagrawal6637
@nitinagrawal6637 4 жыл бұрын
He could have created slides to show the highlights of his talk.
@wowTasteThis
@wowTasteThis 2 жыл бұрын
Microservices feels a lot like OO.
@wowTasteThis
@wowTasteThis 2 жыл бұрын
I wrote this before I got to 29:00 :)
@sandman7155
@sandman7155 5 жыл бұрын
Big parts of the presentation have blank slides.
@clarkd1955
@clarkd1955 5 жыл бұрын
Object oriented programming is about encapsulated data surrounded by functions that work on that data called methods. Functional programming wants to ignore or play hot potato with data as data is considered a smell. Programming is obviously about code and data so useful functional code has to use a totally not functional database to hold all it’s smelly parts. These approaches are not equivalent. If there really is a good idea that is objectively better than existing techniques then let’s use that technique in the situations where it is useful. To this I totally agree. Functional programming, at it’s core, is about pure functions that according to the functional religion, can’t include random numbers, today’s date, input/output or files. What kind of language would be useful without data we can change, files or IO? I can’t predict the future but such a flawed concept isn’t it. It might be PC to give everything respect and the same level on the platform to all programming approaches but that is obviously not helpful or correct. Software development is not Math. Logic is not just the province of Math. Many great ideas and useful techniques have been made and used in CS that is not Math. A function in Math is a statement of fact not a machine for changing one kind of data into another. That is what happens in computers. Math is about infinity and rules that are true all the time but programming is mostly about the exceptions rather than the rule. I love Math and have used it in all my 40 plus year career but I am not a Mathematician any more than a Chemist or Economist who uses Math all the time. Let’s actually talk about the distraction called Functional programming and take what ideas have merit and discard the rest without feeling we need to apologize for pointing out the obvious flaws in FP.
@quangtung2912
@quangtung2912 5 жыл бұрын
I will not consider functional programming is about pure function. It's much more broad than that. I consider functional programming is about features like: - pure functions, total functions - currying, partial application - lambda - algebraic data types - pattern matching - higher order functions - parametric polymorphism - ad hoc polymorphism / type classes ...
@quangtung2912
@quangtung2912 5 жыл бұрын
Development of Theory of Computation leads to development of computer. Development in Language Theory lead to Development of High level programming languages. Relational Database Theory lead to Popularity of RDMS. Development of Concurrency Control Theory lead to Development of Transaction Based Systems. As you can see. Most of powerful technologies in computer science have mathematical theory behind it. It help build higher abstraction without breaking things. Functional Programming based from very good theory too: Lambda calculus and Type Theory. But OOP have none.
@quangtung2912
@quangtung2912 5 жыл бұрын
Also you should search "type class" in Haskell vs "class" in OOP on Quora.
@quangtung2912
@quangtung2912 4 жыл бұрын
@MrManiak I dont know why you think like that
@hellowill
@hellowill 5 жыл бұрын
procedural -> fp -> oop
@michaeljuliano8839
@michaeljuliano8839 4 жыл бұрын
What an obnoxious intro sting!
@julesivanic3533
@julesivanic3533 5 жыл бұрын
So, the conclusion of this talk is... to use Scala ! Because Java is not the middle language described in this talk. It's almost impossible to do FP with Java. Java is exclusively an OO PL. Java 8 streams are not FP.
@USONOFAV
@USONOFAV 4 жыл бұрын
You obviously haven't coded Java using lambdas and streams (especially reactive stream). ....pfft.
@nikhilbharadwaj181
@nikhilbharadwaj181 4 жыл бұрын
Not really to the point. This 45 min video can be cut down to 15 min to the point video
@bjornkihlberg2103
@bjornkihlberg2103 5 жыл бұрын
The argument between OO and FP is NOT like the argument between tabs or editors. I've just worked for over a day on a damn subtle bug where a field was read before it was set. OO is like playing with fire which is useful in extremely rare cases but you shouldn't give your junior developers and 99.999999% of "senior" developers access to it.
@gzozulin
@gzozulin 5 жыл бұрын
You should try programming something efficient and really fast in functional style ;) The bug which you just described can be solved by placing two breakpoints
@ImaginaryNumb3r
@ImaginaryNumb3r 5 жыл бұрын
sounds like somebody didn't understand the principle of encapsulation. Ouch.
@briangoetz7591
@briangoetz7591 Жыл бұрын
In theory, it shouldn't be. But in practice, it usually is.
@vasudk2009
@vasudk2009 3 жыл бұрын
The talk is complete bullshit with no real examples only full of his own opinion, although I agree with his point that there is no single complete programming model that solves all. Just scroll to 42:18 and you get what he is trying to say
@133289ify
@133289ify 5 жыл бұрын
didn't get it. fp rulz! lol
Exploring reactive programming in Java by Miro Cupak
44:14
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 16 МЛН
CHOCKY MILK.. 🤣 #shorts
00:20
Savage Vlogs
Рет қаралды 26 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 50 МЛН
Java 22 ... and beyond | Brian Goetz (Oracle)
43:05
JAX TV
Рет қаралды 5 М.
Does this sound illusion fool you?
24:55
Veritasium
Рет қаралды 685 М.
Brian Goetz Answers Your Java Questions
33:08
Java
Рет қаралды 16 М.
Let's Talk About Functional Programming
1:47:07
Tsoding Daily
Рет қаралды 69 М.
Object Oriented Programming vs Functional Programming
18:55
Continuous Delivery
Рет қаралды 751 М.
Know your Java? By Venkat Subramaniam
2:39:20
Devoxx
Рет қаралды 28 М.
Functional Programming in 40 Minutes • Russ Olsen • GOTO 2018
41:35
GOTO Conferences
Рет қаралды 809 М.
Schoolboy - Часть 2
00:12
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 16 МЛН