Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-25 Thread Peter Damoc
On Tue, Jul 25, 2017 at 3:32 AM, Erik Simmler wrote: > That said, what if we flip the question around? Given that we have > facilities for encapsulation (unexposed types), what would we gain by > adding a new set of concepts around mixing data/logic and syntactic sugar > in the form of "this"? Wh

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-24 Thread Peter Damoc
On Mon, Jul 24, 2017 at 8:50 PM, Dave Ford wrote: > A lot of my early work was centered around UIs which made heavy use of >> inheritance and mutation. >> > I really don't think this is related to the original question. The > original question was not about inheritance or mutation or even about O

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-24 Thread Marcus Roberts
Dave Perhaps I'm being bit oversensitive, but this does seem to be a rather argumentative approach.I know you said you learn by arguing, but this seems to be turning into a dogmatic crossing of swords, rather like walking into a British pub and declaring the local football team a load of rubbi

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-24 Thread Kasey Speakman
Submit a PR for a documentation change. GL On Monday, July 24, 2017 at 12:50:12 PM UTC-5, Dave Ford wrote: > > A lot of my early work was centered around UIs which made heavy use of >> inheritance and mutation. >> > I really don't think this is related to the original question. The > original q

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-24 Thread David Andrews
As far as I'm concerned, this is just syntactic sugar. I've noticed that elm has a convention to use the last parameter in a function where an OO programmer would use this. Using this convention, code winds up being very similar when used. OO version: model .getSomeProperty .withDefault(

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-24 Thread Dave Ford
> > A lot of my early work was centered around UIs which made heavy use of > inheritance and mutation. > I really don't think this is related to the original question. The original question was not about inheritance or mutation or even about OO. It was about "this" and "combining data with logic".

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-22 Thread Peter Damoc
On Sun, Jul 23, 2017 at 1:39 AM, Dave Ford wrote: > > It's not that OOP is bad, but it encourages mutation >> > OOP does not encourage nor discourage mutation. Java, Kotlin, Scala and > OCAML all *allow* mutation. Kotlin, an OO language that I use a lot, > actually *discourages* mutation. But rega

Re: [elm-discuss] Re: Systemic problem in Object Oriented languages

2017-07-22 Thread Dave Ford
First of all, I apologize in advance if I sound argumentative. It's just how main brain learns. Alex, thanks for your thoughtful reply. Below is how I would do your Square example in Java and Kotlin. Both examples combine data and logic and both examples are fully *immutable*. *Java* public clas