4 ms·
Must OOP be shoved down everyone's throat at every turn and opportunity? One of the great things about Lisp is that it's a champion of functional programming, w
by Annatar 5y ago
Must OOP be shoved down everyone's throat at every turn and opportunity? One of the great things about Lisp is that it's a champion of functional programming, whereas OOP is extremely complicated and it produces truly horrible machine code which needs a lot of CPU cycles and even more memory, not to mention being unnecessarily difficult to understand and debug!
- dang 5y agoWe detached this subthread from https://news.ycombinator.com/item?id=29852508 https://news.ycombinator.com/item?id=29852508.
- Annatar 5y ago
- kaba0 5y agoCitation needed
- avodonosov 5y agoNot needed. Book about Common Lisp without CLOS does not make sense. BTW, in this book just 2 chapters out of 32 are devoted to OOP.
- Annatar 5y ago
- na85 5y agoIf you actually work on a project of significant size I don't see how one can reason about code that's not encapsulated via classes. I used to contribute to RunUO, an emulator for Ultima Online, and it's near the 1000000-SLOC level. There's too much going on, too much state, too many corner cases, to consider functional as an architecture. Not every OOP project is full of FactoryFactorys.
- deleted 5y ago[deleted]
- nesarkvechnep 5y agoDid you just generalize that every large project must be object-oriented?
- na85 5y agoI'm positing that any project of sufficient complexity is a good candidate for object oriented, yes. I don't see how a single developer can reason about an entire codebase of hundreds of thousands of LOC.
- jlg23 5y agoFunctional programmers argue that pure functions are easier to reason about than functions that drag in state (like methods in OOP tend to).
- na85 5y agoPlease list some real-world software of significant complexity that is 100% purely functional.
- jlg23 5y agoWhere does the "100% purely functional" requirement come from? By some strict definition, this is impossible, because you'd not have any means of communicating the result of your computation. In pure OOP speak: A "final static" method is easier to reason about than some non-static, non-final method. (But when a method is defined as "final" and "static", the providing class only serves as a namespace - where is the OOP in that?)
- toomanydoubts 5y agoHasura, Pandoc, XMonad?
- _ph_ 5y agoThe nice thing about Common Lisp is, you have the choice, which style of programming you use. There is a lot of good things to be said about functional programming, but for a lot of problems, OOP is the natural pattern. And with Common Lisp, you can use both in the same program, depending on which pattern fits the best for that part of the program. Mind you, I am not using OOP in that sense it has degenerated to in the Java universe. It is actually less the language itself but the culture of trying to express too much in object hierarchies and protocols. I try to keep my object models simple, avoiding too much inheritance and complex class hierarchies. But it is a wonderful method of decoupling routines from heterogeneous data, which is well expressed as object with their methods implementing the common behavior.