TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Where FP meets OO

39 pointsby stefanobaghinoover 10 years ago

11 comments

ameliusover 10 years ago
I&#x27;m not sure that OO-ness is a desired property.<p>Alexander Stepanov, original creator of the STL:<p>&quot;I find OOP technically unsound. It attempts to decompose the world in terms of interfaces that vary on a single type. To deal with the real problems you need multisorted algebras - families of interfaces that span multiple types. I find OOP philosophically unsound. It claims that everything is an object. Even if it is true it is not very interesting - saying that everything is an object is saying nothing at all. I find OOP methodologically wrong. It starts with classes. It is as if mathematicians would start with axioms. You do not start with axioms - you start with proofs. Only when you have found a bunch of related proofs, can you come up with axioms. You end with axioms. The same thing is true in programming: you have to start with interesting algorithms. Only when you understand them well, can you come up with an interface that will let them work.&quot;<p>More discussion:<p><a href="http://www.quora.com/Was-object-oriented-programming-a-failure" rel="nofollow">http:&#x2F;&#x2F;www.quora.com&#x2F;Was-object-oriented-programming-a-failu...</a>
评论 #8810014 未加载
评论 #8809693 未加载
评论 #8810224 未加载
otasover 10 years ago
Alan Kay was inspired by the real world, mostly biology back when psychotropic substances were rather popular. That&#x27;s were the problems start. The real world systems are: 1) unpredictable - except for those who can forecast the future. 2) Unreliable 3) Slow 4) Uncoordinated - except if you believe someone runs the world. 5) Unmaintainable - just ask someone on human maintenance (drug research etc). 6) Naturally autonomous<p>Point 6 is very critical, because in von-neumann architectures you will end up having a shared memory and trying to give an autonomous memory to each agent, will end up very suboptimal, and no zipper, COW of any other FP trick can change that.<p>You just cannot afford to write your software like the real world, and you don&#x27;t even have intelligent agents of human ability as building blocks...
评论 #8810962 未加载
Pxtlover 10 years ago
Am I the only one who finds the goalposts gave moved for FP? it used to be lambdas&#x2F;lexical closures that were the big must-have FP feature, then it was immutability. Now that we&#x27;re seeing traditionally-OO languages sport a raft of immutable types and good support for lexical closures, now it&#x27;s all about higher-kinded-types.<p>For a while, the big feature was homoiconicity and tail-call-optimization until lisp fell out of favour with language geeks.<p>Does FP just mean &quot;has features of my favorite self-proclaimed-functional-language&quot;?
评论 #8809928 未加载
评论 #8810087 未加载
评论 #8810264 未加载
mariusmgover 10 years ago
&quot;Scala is the only language that I know of that marries the world of FP and OO&quot;<p>You can do that in C#&#x2F;F# too. There&#x27;s nothing special about Scala from this point of view.
评论 #8809565 未加载
评论 #8809547 未加载
评论 #8814166 未加载
telover 10 years ago
While I&#x27;m reasonably open-minded about using some parts of OO at higher levels of organization (or at least just genuine modules), I&#x27;m not sure Akka is the right place to land there. Functions which are just typed as `a -&gt; ()` have lost (or hidden) all their interesting structure.
评论 #8810024 未加载
评论 #8809849 未加载
josephlordover 10 years ago
<i>Scala is the only language that I know of that marries the world of FP and OO and thus does not need to “throw the baby out with the bathwater”.</i><p>Have you had chance to try Swift yet. It could do with Tail Call Optimisation but I do think it can already be used for functional programming.
评论 #8809786 未加载
评论 #8814171 未加载
Denommusover 10 years ago
OCaml also has both, and its object system is probably more powerful.
评论 #8814173 未加载
hawleyalover 10 years ago
Ruby is pretty FP&#x2F;OO friendly.
mlawlerauover 10 years ago
Interesting article Chris.
dschiptsovover 10 years ago
In CLOS.
评论 #8809735 未加载
theszover 10 years ago
<a href="https://parleys.com/play/51c1994ae4b0d38b54f4621b/chapter33/about" rel="nofollow">https:&#x2F;&#x2F;parleys.com&#x2F;play&#x2F;51c1994ae4b0d38b54f4621b&#x2F;chapter33&#x2F;...</a><p>After about 53-th minute Odersky gets lost in side effects in a very simple code.<p>This is why there&#x27;s nothing elegant about Scala.
评论 #8809533 未加载