DEV Community

Discussion on: Teaching Functional Programming: Two Big Picture Approaches

Collapse
 
antonrich profile image
Anton • Edited

Then I guess you need an example with the same language? Because I personally cannot give you an example in the same language.

Also I won't give you an example from my experience because I'm a novice. But I've been watching some Elm courses where instructor gave some examples and said that the opposite JS code will actually end up biting you in the ass.

I also want to say that a lot of things end up biting in JS are the lack of types whereas Elm has a strong type system. You probably need an example that demonstrated exactly the difference between two styles rather than the difference between having strong type system and a week one.

Thread Thread
 
avalander profile image
Avalander

It's worth saying that those examples are hand picked to show the strengths of Elm.

I've used both, Javascript and Elm (a lot more js than Elm, to be honest) and in many cases Elm's types helped me a lot, but there have been instances where I had to fight Elm to do things that would have been straightforward in Javascript.