News for hackers. Stuff that matters.
Re:Object-Oriented Programming: A Disaster Story by alkonaut on Wednesday January 20, 2016 @05:25AM (#10937131)
> Thin wrappers that slightly change functionality are often a business requirement

I doubt that a business requirement stipulates how something is implemented, but thin extensions are often an apparently convenient way of quickly getting the slightly different behavior of the business requirement. Whether or not it's a good idea just because it is quick and convenient I think isn't clear. From a business perspective this is one of the false benefits -- if the problem is apparently solved quickly, but the maintenance is harder afterwards, it may not be the best idea. I'd bet sum types + common pure functionality accomplishes the same thing with lower maintenance cost.

> Having data associated directly with the corresponding state can make exploratory programming easier

I agree that many functional languages have definite drawbacks in terms of exploratory and self documenting programming. "Methods" on types are to me a definite requirement also for an FP language because of autocomplete/documentation/ergonomics. To , me writing v2 = Vector.normalize(v1) is vastly inferior to v2 = v1.normalize(). This is syntactic sugar of course, but important sugar. Neither is "OO" though: associating methods as postfix can be done regardless.

Re:Object-Oriented Programming: A Disaster Story by lmm on Wednesday January 20, 2016 @05:42AM (#10937190)
> I'd bet sum types + common pure functionality accomplishes the same thing with lower maintenance cost.

Not my experience - most functional languages make it much harder than it should be to say "this is exactly an X except that it prints differently".

> I agree that many functional languages have definite drawbacks in terms of exploratory and self documenting programming. "Methods" on types are to me a definite requirement also for an FP language because of autocomplete/documentation/ergonomics. To , me writing v2 = Vector.normalize(v1) is vastly inferior to v2 = v1.normalize(). This is syntactic sugar of course, but important sugar. Neither is "OO" though: associating methods as postfix can be done regardless.

Well, if a feature is present in all mainstream "OO" languages and not in any mainstream "functional" languages then I'll call it "OO". I'd be very interested to see a functional language with good support for this kind of thing though.

Re:Object-Oriented Programming: A Disaster Story by alkonaut on Wednesday January 20, 2016 @05:55AM (#10937234)
> Not my experience - most functional languages make it much harder than it should be to say "this is exactly an X except that it prints differently".

yes, FP usually makes it harder. The question is whether the extra effort is worth it over a 10 year period or not, i.e. does the FP solution maintain more easily than the OO one? I'm not saying it does, just saying the answer isn't clear after the implementation, only much later.

> I'd be very interested to see a functional language with good support for this kind of thing though.

F# is a good example.

Re:Object-Oriented Programming: A Disaster Story by catnaroek on Wednesday January 20, 2016 @03:31PM (#10941108)
> Not my experience - most functional languages make it much harder than it should be to say "this is exactly an X except that it prints differently"

That's because this is the wrong thing to say in the first place - it dilutes the very meaning of “type”. You should factor out the common parts, and only then say X prints this way, Y prints that other way.

Re:Object-Oriented Programming: A Disaster Story by lmm on Thursday January 21, 2016 @05:12AM (#10944317)
The overhead of adding another type is nontrivial (which maybe is a problem in itself; nevertheless, here we are). For business-critical distinctions it's worthwhile. For differences that only matter in one or two places, or for less-critical functionality (e.g. GUI tweaks) it may not be.