Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Pretty low-quality article, mostly just a bunch of links to other opinions. I'm used to better commentary from pivotal.

I don't really understand why functional programmers bash on OOP so much. If you code up a bunch of immutable objects with methods that return changed versions, you're now a functional object-oriented programmer. It's a pretty nice paradigm! It beats the hell out of "everything is a list" and car/cdr is your hammer.

Yeah, a lot of Java programmers fail to grok immutability and irritate us with wordy half-measures like builder patterns. On the other hand, the stream api allows you to write code that looks reasonably close to the clojure-equivalent -- perhaps a bit more verbose, but at least it's typesafe. If you want more concise there's Varvr. This is more of a culture problem than a language problem.



My avoidance of OOP predates my use of FP like most people I know.. As imperative C programmers of old, we often had to deal with people trying to add C++ on top and then needing help.. Their projects were often months of work and a total failure because they had fractally encoded their model into how their code, data and model operate. Inevitably a few of their ideas of that model were wrong or needed to change for unexpected reasons and are encoded across all sorts of things via inheritance and method parameters.

Essentially they have invested in huge blocks of take it or leave it nonsense similar to the banana quote in the article.

I get the same general feeling from FP OO as normal classical OO. There seems to be a need for a hierarchy in parts of base type systems and other standard library pieces, but once some framework layer declares a class to be extended you just have bug after bug that all relate to an imaginary hierarchies invented because everyone needed to provide a nail for the OO hammer.

Personally, I'm much happier with interfaces that rely on a duck style to implicitly define types with implementors. I find it sad that some older languages are reimplementing classes when it seems like newer ones have correctly moved on to no unique relationship hierarchies in general code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: