Live data from Hacker News

Object-Oriented Programming is Bad (2016) [video]

m.youtube.com

101–110 of 133 posts

Re: Object-Oriented Programming is Bad (2016) [video]

#101
post #14

The problem for me in regards to OOP is the complexity related to the management of state. OOP encourages mutability and understanding the state of an object as its methods are called can be confusing when additional internal (and often times, private) methods are called. In functional programming, state is something acted upon by functions. It is as simple as f(x) = y. Reasoning in functional programming is much clo…

Yes, but I/O is impure and sequentially dependent, unlike mathematics. Maybe the "impedance mismatch" between pure-fp and I/O is too great, with the IO monad being the "leaky abstraction" of the FP world. Then OO is not a bad solution to an irrelevant problem, but a pretty-good solution to a bad relevant problem. EDIT: To clarify: The "problem" is change. Imperative programming relates sequential device-change over t…

Why is the IO monad a leaky abstraction? Any function that returns an IO computation in Haskell, is still a pure function.

Re: Object-Oriented Programming is Bad (2016) [video]

#102
post #95

Earlier quoted context omitted.

Oop is slower than functional in many cases. The highly optimized java stack isn’t that fast and still uses oodles of memory. And then there’s languages like ruby which are practically slower than writing shell scripts.

Functional generates tons of garbage and requires a very good concurrent generational tracing GC, more so than OOP languages. Only thanks to researchers like Simon Peyton Jones[1], did functional language compilers improved their code quality. [1] - https://www.microsoft.com/en-us/research/publication/the-imp...

It's actually harder to write a GC for a language like Java with both rampant mutation and plenty of garbage!

Re: Object-Oriented Programming is Bad (2016) [video]

#103

I really liked the first half - he provides some insightful thoughts on both why OOP doesn't quite deliver on the promise, and why it continues to be popular anyway. I am also becoming increasingly enamored of procedural programming as a default approach. Functional is also good - it's one of my first loves - but I find that it can be similarly prone to encouraging premature abstraction. Like OOP, that problem isn't…

Ruby and Swift (and other languages I'm pretty sure) allow you to have named functions nested in functions

What the video specifically suggested was not any old nested function, it was nested functions that do not capture upvalues from their context.

Re: Object-Oriented Programming is Bad (2016) [video]

#104

Earlier quoted context omitted.

In theory this sounds great but in reality every major application, game, operating system and even website is written in an OOP style. Why is that? People should first answer that question. Yeah, real existing software has flaws like every other thing in reality but at least it exists unlike a significant piece of fp style software. I like fp and I think it has a lot to teach but I think it's a bit presumptuous to a…

http://paulgraham.com/avg.html

But Lisp's object system is kind of famous. Where are the people beating the averages in pure fp languages? There should be a lot of really amazing software if fp is as good as it's made out to be and employed exclusively by elite non-blub programmers. There really isn't though, except maybe in finance where F# is doing quite well. And that's great but even F# is multi paradigm.

Re: Object-Oriented Programming is Bad (2016) [video]

#105

Earlier quoted context omitted.

In theory this sounds great but in reality every major application, game, operating system and even website is written in an OOP style. Why is that? People should first answer that question. Yeah, real existing software has flaws like every other thing in reality but at least it exists unlike a significant piece of fp style software. I like fp and I think it has a lot to teach but I think it's a bit presumptuous to a…

A fair bit of that can be easily explained as cargo cult - a fair number of developers simply believe, because it's how they've been taught and what's been stated as fact over and over and over, that OOP is just 'how you write code'.

is it really cargo cult if it works though?

Re: Object-Oriented Programming is Bad (2016) [video]

#106
post #14

The problem for me in regards to OOP is the complexity related to the management of state. OOP encourages mutability and understanding the state of an object as its methods are called can be confusing when additional internal (and often times, private) methods are called. In functional programming, state is something acted upon by functions. It is as simple as f(x) = y. Reasoning in functional programming is much clo…

In theory this sounds great but in reality every major application, game, operating system and even website is written in an OOP style. Why is that? People should first answer that question. Yeah, real existing software has flaws like every other thing in reality but at least it exists unlike a significant piece of fp style software. I like fp and I think it has a lot to teach but I think it's a bit presumptuous to a…

[deleted]

Re: Object-Oriented Programming is Bad (2016) [video]

#107

Earlier quoted context omitted.

http://paulgraham.com/avg.html

But Lisp's object system is kind of famous. Where are the people beating the averages in pure fp languages? There should be a lot of really amazing software if fp is as good as it's made out to be and employed exclusively by elite non-blub programmers. There really isn't though, except maybe in finance where F# is doing quite well. And that's great but even F# is multi paradigm.

My home-grown accounting system, written in a language with great support for functional programming, is based on objects. accounts, transactions, transaction deltas, ledgers, are all objects. Starting from a blank slate, a file is loaded which defines the ledger entries. These definitions are processed one by one, using mutable updates to the object framework. What is left is then the state of the ledger with all those entries and that can be subject to various queries and reports.

Re: Object-Oriented Programming is Bad (2016) [video]

#108
post #91

The irony of the anti-OOP bashers is that all successful GUI frameworks are OOP based, even those written in non-OOP languages like C. Likewise all the functional programming languages that get used as example, are also not pure FP, rather multi-paradigm, also supporting concepts from OOP. "FP vs OOP: Choose Two by Brian Goetz" https://www.youtube.com/watch?v=HSk5fdKbd3o

GUI frameworks have always been OOP-based because everybody was copying Xerox Parc. But even the most successful were not always easy to use (composition and control-flow/concurrency being particularly awkward). Modern GUIs are all based on HTML/CSS these days anyway and certainly not always OOP, as demonstrated by frameworks such as react.

I think that is a bit like saying Xerox parc guis were all pixels which certainly isn't oop. Modern guis are mostly OO code that targets the Dom or generates HTML on the server

Re: Object-Oriented Programming is Bad (2016) [video]

#109

Could we please stop this kind of useless statements? Aren't we developers supposed to be scientific-minded? There is not such thing as "bad" or "good" in absolute. There are paradigmes that work better in certain contexts - and I use the word "context" in very general way here - and some that work worse. If my consulting experience has taught me something, is that "it depends" is a valid comment most of the time. By…

This conversation would be improved by responding or refuting to the specific points made in the video instead of generalized comments

Re: Object-Oriented Programming is Bad (2016) [video]

#110

I really liked the first half - he provides some insightful thoughts on both why OOP doesn't quite deliver on the promise, and why it continues to be popular anyway. I am also becoming increasingly enamored of procedural programming as a default approach. Functional is also good - it's one of my first loves - but I find that it can be similarly prone to encouraging premature abstraction. Like OOP, that problem isn't…

His style perscriptions can be directly attributed to Jonathan Blow (which they match) who he also mentions in that section.

Also I think the mention of golang is telling which I think is an implicit bias in his preferred style reccomendations.

Post reply on HN