[elm-discuss] main : Program Never Model Msg -- What does it mean?

2017-07-20 Thread Eeek
I am beginner in Elm, and going through elm-tutorial.org. I have problem in understanding the declaration of main function in https://www.elm-tutorial.org/en/02-elm-arch/02-structure.html. It says main : Program Never Model Msg What does it represent? I read under functions tutorial that,

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

2017-07-20 Thread Alex Barry
Here's my take. In C++ (Or Java, what-have-you), you could have something like this: class Square { private float size; Square(float size) { this.size = size; } void size(float size) { this.size = size; } float size(void) { return this.size; } float

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

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

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

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

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 >

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

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

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

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

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

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

[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