3 ms·
> - The language doesn't have component composition (like in React or Vue) and you end up having huge chunks of spaghetti code (but to be fair, it kind of works
by KurtMueller 7y ago
> - The language doesn't have component composition (like in React or Vue) and you end up having huge chunks of spaghetti code (but to be fair, it kind of works because of the compiler).
Um... yea it does. Elm makes functional composition very easy which which means it's very easy to compose "components" (which are just functions anyway).
> - Only pure functions in Elm, so doing API calls and generating random numbers are unnecessary hard.
I would say that Elm makes doing API calls and generating random #s appropriately hard. Elm strives to corral side effects into one part of the Elm architecture: "commands". By doing this, you're keeping all code that contains side effects at the fringes of the walled garden you're growing.
I think this explicitness/discipline is needed in more codebases.
> - It's complicated to implement routing and to build a Single Page Application.
I agree, it's no Ember, which comes with all the bells and whistles of a full router system, including page transitions, transition errors, data fetching, etc. Richard Feldman has an elm SPA example on github that shows how to create routes, pages, etc. The official Elm Guide also has sections on routing, etc.
> So in the end, Elm is an interesting beast, but I think it's too academical and not really practical for serious projects.
Too "academical"? Tell it to these devs: https://blogg.bekk.no/using-elm-at-vy-e028b11179eb https://blogg.bekk.no/using-elm-at-vy-e028b11179eb.
- foldr 7y ago>Um... yea it does. Elm makes functional composition very easy which which means it's very easy to compose "components" (which are just functions anyway). It's actually not that easy to write composable components in Elm, and attempting to do this has always been officially discouraged.
- henryscala 7y agoI personally think it depends on how we define components. ELM does not have components like Vue or ReactJs. ELM's components are just functions. For the example described in the below article, I think channelPanel and chatPanel can be looked as components. https://korban.net/posts/elm/2018-11-17-elm-ui-introduction/ https://korban.net/posts/elm/2018-11-17-elm-ui-introduction/