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

2017-07-20 Thread Christophe de Vienne


Le 20/07/2017 à 12:15, Peter Damoc a écrit :
> 
> 
> On Thu, Jul 20, 2017 at 12:49 PM, Christophe de Vienne
> > wrote:
> 
> 
> Well, it is more an intuition after more than 20 years of coding that an
> elaborated opinion.
> 
> But the first thing that comes to my mind is the resulting complexity,
> and often confusion. I find that having a clean separation between data
> & logic makes things a lot cleaner, easier to understand and maintain.
> 
> I do realize I would need to elaborate a little more to be convincing on
> this, but so far it is all I got :-)
> 
> 
> Out of curiosity, are you keeping your Model, update and view in
> separate modules?  

At first no, then depending on how much of the module I want to reuse, I
separate them.

In the end, I have reusable models as submodules of a "Data" module, a
few model+update modules (mainly for the session data, which has no
global view), and the rest are single modules with model+update+view
(for pages mainly, and a few subcomponents).

It is in great part inspired by the SPA example from Richard Feldman:
https://github.com/rtfeldman/elm-spa-example

-- 
Christophe de Vienne

-- 
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.


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

2017-07-20 Thread Peter Damoc
On Thu, Jul 20, 2017 at 12:49 PM, Christophe de Vienne <
christo...@cdevienne.info> wrote:

>
> Well, it is more an intuition after more than 20 years of coding that an
> elaborated opinion.
>
> But the first thing that comes to my mind is the resulting complexity,
> and often confusion. I find that having a clean separation between data
> & logic makes things a lot cleaner, easier to understand and maintain.
>
> I do realize I would need to elaborate a little more to be convincing on
> this, but so far it is all I got :-)
>
>
Out of curiosity, are you keeping your Model, update and view in separate
modules?


-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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.


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

2017-07-20 Thread Christophe de Vienne


Le 20/07/2017 à 11:12, Dave Ford a écrit :
> Now, is it actually a systemic problem ? My intuition is that it is the
> root of many difficulties OO languages can have, even though it does not
> seem like a problem at first.
> 
> 
> Can you give an example? Specifically, without confusing the unrelated
> issue of immutability?
> 

Well, it is more an intuition after more than 20 years of coding that an
elaborated opinion.

But the first thing that comes to my mind is the resulting complexity,
and often confusion. I find that having a clean separation between data
& logic makes things a lot cleaner, easier to understand and maintain.

I do realize I would need to elaborate a little more to be convincing on
this, but so far it is all I got :-)

-- 
Christophe de Vienne

-- 
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.


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

2017-07-20 Thread Dave Ford
>
> Now, is it actually a systemic problem ? My intuition is that it is the
> root of many difficulties OO languages can have, even though it does not
> seem like a problem at first.


Can you give an example? Specifically, without confusing the unrelated
issue of immutability?

-- 
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.


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

2017-07-20 Thread Peter Damoc
On Thu, Jul 20, 2017 at 11:52 AM, Dave Ford  wrote:

> On Thu, Jul 20, 2017 at 4:14 AM, Peter Damoc  wrote:
>
>> "this" is associated with mutation. Elm is an immutable language.
>>
>
> I don't think that's true. I might be wrong, but I'm pretty sure that
> "this" has nothing specifically to do with mutation. I write immutable
> objects all day long in java and kotlin making use of "this" and mixing
> data and logic.
>

I'm not saying that "this" implies mutation only that it is associated with
mutating the current object.

Of course one can write immutable objects using "this" but in OO languages
you can also use it to mutate the state of the object.

-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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.


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

2017-07-20 Thread Christophe de Vienne
Regardless of immutability, saying "this" imply a bound between the data
and the function, which is the very thing Elm wants to avoid.

So I think the systemic problem referred to here is "separation of data
and logic", and its incarnation (sort of) is the ability to say "this".

Now, is it actually a systemic problem ? My intuition is that it is the
root of many difficulties OO languages can have, even though it does not
seem like a problem at first.

Le 20/07/2017 à 09:55, Dave Ford a écrit :
> There is a line from the docs that I am trying to understand: "Elm
> encourages a strict separation of data and logic, and the ability to
> say |this| is primarily used to break this separation. This is a
> systemic problem in Object Oriented languages that Elm is purposely
> avoiding."
> 
> What is the systemic problem being reference? Is it the [lack of]
> "separation of data and logic" or "the ability to say this"?
> 
> I have been programming in Java (an OO language) for a long time. I can
> name dozens of systemic problems in the language. But the ability to say
> "this" is not one of them. Nor is it the commingling of data and logic. 
> 
> Please help me to understand what the author is talking about.
> 
> Thanks.
> 
> Side note: "this" /is/ a problem in JavaScript. But not in OO generally.
> 
> -- 
> 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.

-- 
Christophe de Vienne

-- 
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.


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

2017-07-20 Thread John Orford
I have minimised (almost 0% now) my use of this in JS, by using arrow
functions. Perhaps 'this' is a bad example, they're an arcane artifact...

Basically you're right, the guide isn't clear at best, wrong at worst : )

On Thu, 20 Jul 2017 at 10:52 Dave Ford  wrote:

> On Thu, Jul 20, 2017 at 4:14 AM, Peter Damoc  wrote:
>
>> "this" is associated with mutation. Elm is an immutable language.
>>
>
> I don't think that's true. I might be wrong, but I'm pretty sure that
> "this" has nothing specifically to do with mutation. I write immutable
> objects all day long in java and kotlin making use of "this" and mixing
> data and logic.
>
> --
> 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.


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

2017-07-20 Thread Dave Ford
On Thu, Jul 20, 2017 at 4:24 AM, John Orford  wrote:

> It's ambiguous
>
It's not. In Java it's very clearly and deterministically defined.

this.x = 123
>
Immutability is a different issue.  "this" has nothing specifically to do
with mutability. The use of "this" is orthogonal to mutability.

-- 
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.


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

2017-07-20 Thread Dave Ford
On Thu, Jul 20, 2017 at 4:14 AM, Peter Damoc  wrote:

> "this" is associated with mutation. Elm is an immutable language.
>

I don't think that's true. I might be wrong, but I'm pretty sure that
"this" has nothing specifically to do with mutation. I write immutable
objects all day long in java and kotlin making use of "this" and mixing
data and logic.

-- 
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.


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

2017-07-20 Thread John Orford
It's ambiguous, I also imagine it means avoiding:

this.x = 123

But then again, why do you need 'this' in the first place? In Elm you can
access anything in scope in the module.

I suppose this is useful for accessing class stuff which isn't in your
immediate method scope... which again leads you down something like ideas
around local (object) mutable state...

Good question!

On Thu, 20 Jul 2017 at 10:15 Peter Damoc  wrote:

> "this" is associated with mutation. Elm is an immutable language.
>
> In theory, one could have immutable objects where data and logic are
> grouped together.
> The best expression I've seen so far is the FauxO system in Gary
> Bernhardt's Boundaries talk.
>
> Something like this would constitute a non-trivial expansion of the
> language and, as far as I can understand it, there are other priorities.
>
>
> On Thu, Jul 20, 2017 at 10:55 AM, Dave Ford  wrote:
>
>> There is a line from the docs that I am trying to understand: "Elm
>> encourages a strict separation of data and logic, and the ability to say
>> this is primarily used to break this separation. This is a systemic
>> problem in Object Oriented languages that Elm is purposely avoiding."
>>
>> What is the systemic problem being reference? Is it the [lack of] "separation
>> of data and logic" or "the ability to say this"?
>>
>> I have been programming in Java (an OO language) for a long time. I can
>> name dozens of systemic problems in the language. But the ability to say
>> "this" is not one of them. Nor is it the commingling of data and logic.
>>
>> Please help me to understand what the author is talking about.
>>
>> Thanks.
>>
>> Side note: "this" *is* a problem in JavaScript. But not in OO generally.
>>
>> --
>> 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.
>>
>
>
>
> --
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>
> --
> 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.


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

2017-07-20 Thread Peter Damoc
"this" is associated with mutation. Elm is an immutable language.

In theory, one could have immutable objects where data and logic are
grouped together.
The best expression I've seen so far is the FauxO system in Gary
Bernhardt's Boundaries talk.

Something like this would constitute a non-trivial expansion of the
language and, as far as I can understand it, there are other priorities.


On Thu, Jul 20, 2017 at 10:55 AM, Dave Ford  wrote:

> There is a line from the docs that I am trying to understand: "Elm
> encourages a strict separation of data and logic, and the ability to say
> this is primarily used to break this separation. This is a systemic
> problem in Object Oriented languages that Elm is purposely avoiding."
>
> What is the systemic problem being reference? Is it the [lack of] "separation
> of data and logic" or "the ability to say this"?
>
> I have been programming in Java (an OO language) for a long time. I can
> name dozens of systemic problems in the language. But the ability to say
> "this" is not one of them. Nor is it the commingling of data and logic.
>
> Please help me to understand what the author is talking about.
>
> Thanks.
>
> Side note: "this" *is* a problem in JavaScript. But not in OO generally.
>
> --
> 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.
>



-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
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.


[elm-discuss] Systemic problem in Object Oriented languages

2017-07-20 Thread Dave Ford
There is a line from the docs that I am trying to understand: "Elm 
encourages a strict separation of data and logic, and the ability to say 
this is primarily used to break this separation. This is a systemic problem 
in Object Oriented languages that Elm is purposely avoiding."

What is the systemic problem being reference? Is it the [lack of] "separation 
of data and logic" or "the ability to say this"?

I have been programming in Java (an OO language) for a long time. I can 
name dozens of systemic problems in the language. But the ability to say 
"this" is not one of them. Nor is it the commingling of data and logic. 

Please help me to understand what the author is talking about.

Thanks.

Side note: "this" *is* a problem in JavaScript. But not in OO generally.

-- 
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.