[elm-discuss] 80% of my coding is doing this (or why templates are dead)

2017-07-27 Thread Dave Ford
I have given this spiel in recent meetups and no one tried to kill me, so I thought I would make blog post. It mentions Elm as one of the communities happily generating HTML without templates. Sorry for the overly click bait-ish title.

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

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

[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

Re: [elm-discuss] Re: Creating an API to be consumed by JS developers

2016-10-08 Thread Dave Ford
nterface for data to transfer over so everything on the Elm side can be > 'safe' and any unsafe access happens only through know access points. > > > On Saturday, October 8, 2016 at 12:22:12 PM UTC-6, Dave Ford wrote: >> >> My experience with compile-to-js languages include: GWT, Da

[elm-discuss] Creating an API to be consumed by JS developers

2016-10-08 Thread Dave Ford
My experience with compile-to-js languages include: GWT, Dart and TypeScript. GWT was very good at *calling* JS libraries. Almost zero friction. But not so, in the other direction. Creating API's to be consumed by JS was so ugly that I can confidently say that it was not worth it. Unless you

[elm-discuss] In

2016-10-08 Thread Dave Ford
What does the in keyword do? -- 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

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-07 Thread Dave Ford
On Fri, Oct 7, 2016 at 11:10 AM, Peter Damoc wrote: > > If you can come up with a practical scenario where you would have an > exception, I or someone else around here could tell you what would happen > in Elm in that context. > Yes. The example I gave when I started the thread

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Dave Ford
similar to throw/raise? On Oct 6, 2016 8:07 PM, "Duane Johnson" <duane.john...@gmail.com> wrote: > > On Thu, Oct 6, 2016 at 8:13 PM, Dave Ford <df...@smart-soft.com> wrote: > >> 2. *Runtime Exception. *Like a NullPointerException or an >> IllegalArgumentEx

Re: [elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Dave Ford
Thanks Joey. > you will handle the error case, and either come up with a sensible > default, or tell your program to display some error message, or do > something else to properly handle the error. > You mean, do exactly like I showed in the java newbie example? What would be considered an

[elm-discuss] No Runtime Exceptions - Still not computing

2016-10-06 Thread Dave Ford
I have listened to a number of podcasts where Richard Feldman boasts about never getting a runtime exception. I am having a hard time grasping the concept. I think I look at runtime exceptions a bit differently. I look at them as a *positive*. A programmers tool. A debugging tool. A way to

Re: [elm-discuss] Re: Elm Runtime Exceptions

2016-09-08 Thread Dave Ford
UTC-7, Joey Eremondi wrote: > > @Dave Ford: that's literally what Maybe.andThen and Result.andThen are > for. See also Maybe.map, and Result.map. > > They let you chain together several computations that may throw an > exception. You can take a computation which t

Re: [elm-discuss] Re: Elm Runtime Exceptions

2016-09-08 Thread Dave Ford
On Wednesday, September 7, 2016 at 6:26:58 PM UTC-7, Max Goldstein wrote: > > Maybe is not an exception, as has been pointed out. *Maybe is a data > structure.* It just so happens that it's a data structure that can hold > at most one element. > Again, I completely understand that Maybe is a

Re: [elm-discuss] Re: Elm Runtime Exceptions

2016-09-08 Thread Dave Ford
The analogous part is the fact you end with "exception handling" code interspersed throughout your main logic flow. That part seems very much like C to me. On Wednesday, September 7, 2016 at 1:23:24 PM UTC-7, Nick H wrote: > > I don't think the comparison to C is accurate at all. Error codes in

[elm-discuss] Re: Elm Runtime Exceptions

2016-09-08 Thread Dave Ford
On Wednesday, September 7, 2016 at 12:49:23 PM UTC-7, Charlie Koster wrote: > > Your description of Maybe isn't correct. When a function returns a Maybe > it's not throwing an exception. Maybe is a separate type (like String) so > when a function returns a Maybe String that is the type of the

[elm-discuss] Elm Runtime Exceptions

2016-09-07 Thread Dave Ford
One of Elm’s most interesting features is "No Runtime Exceptions". But I would argue that Elm does in fact have Runtime Exceptions, even if you don't call it that. I explain my reasoning in this blog post: https://medium.com/@daveford/my-take-on-elm-runtime-exceptions-b3c5156887c9#.p1mrtcr2m