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(3)

Elm version:
model
    |> getSomeProperty
    |> Maybe.withDefault 3



On Mon, Jul 24, 2017 at 1:50 PM Dave Ford <df...@smart-soft.com> 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 OO.
> It was about "this" and "combining data with logic". Which were described
> as a "systemic problem".
>
> No one (yet) has convinced me that they are even remotely a problem. No
> one has provided an example. Or any logic to support the claim.
>
> They have mentioned all sorts of other things that *are* problematic,
> like inheritance and mutation. But I already knew those were problematic. I
> also already knew that most OO languages also support mutation (although
> mutation is discouraged in Kotlin). But this is not what the question was.
>
> Sure, you could start naming off a dozen other things that are problematic
> (like inheritance and mutation). But that has nothing to do with the
> question.
>
>
>> In OO, mutation is very easy to do because of `this`.
>>
> No. As mentioned earlier, "this" has nothing to do with immutability.
> "this" is just an object variable like any other object variable.
>
> | Perhaps your experience with OO programming is atypical?
> The fact that "this" has nothing to do with immutability is unrelated to
> my experience.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to