Live data from Hacker News

Understanding UI Components in Elm

humio.com

1–10 of 44 posts

Re: Understanding UI Components in Elm

#3

By the way, can anyone suggest a good zero-to-Elm tutorial/course/book/whatever for people with no web frontend experience (coming from desktop GUI dev) to get on board with Elm web GUI apps development quickly?

Tangentially related, because it covers the F# port of Elm (called Elmish), but Zaid's Elmish Book is pretty good.

https://zaid-ajaj.github.io/the-elmish-book

Re: Understanding UI Components in Elm

#4

By the way, can anyone suggest a good zero-to-Elm tutorial/course/book/whatever for people with no web frontend experience (coming from desktop GUI dev) to get on board with Elm web GUI apps development quickly?

As a free resource then https://elmprogramming.com/ does a good job of going beyond the official Elm guide.

For far as books are concerned, Elm in Action by Richard Feldman and Programming Elm: Build Safe and Maintainable Front-End Applications by Jeremy Fairbank.

Best of luck on your journey!

Re: Understanding UI Components in Elm

#5
Can anyone more knowledgeable on Elm comment on the "statelessness" as there still is a state. There isn't an explicit type alias for the state nor is there an explicit update though. Maybe "implicit state" would be a more fitting name here.

Also, given that they write about web technologies, then their static site returns a blank page when js is not enabled..

Re: Understanding UI Components in Elm

#6

By the way, can anyone suggest a good zero-to-Elm tutorial/course/book/whatever for people with no web frontend experience (coming from desktop GUI dev) to get on board with Elm web GUI apps development quickly?

Your best bet would be the frontendmasters Elm workshop by Richard Feldman who is an awesome teacher: https://frontendmasters.com/courses/intro-elm/ (Don't worry, 2018 is still up to date. Elm moves slowly.)

Though absolutely no web frontend experience might prove difficult. I think you can get pretty far with just learning Elm but it is not a common case that is well supported by any learning material I am aware of.

For general Elm stuff this site helped my quite a lot: https://elmprogramming.com/

There isn't that much good learning material. It is important to get comfortable with the official docs. Especially the standard library that you find here: https://package.elm-lang.org/packages/elm/core/latest/ (Yeah, the standard library is the core package. This is where you find the fundamental building blocks. When I first learned Elm it took me way too much time until I figured it should look under packages.)

Re: Understanding UI Components in Elm

#7

By the way, can anyone suggest a good zero-to-Elm tutorial/course/book/whatever for people with no web frontend experience (coming from desktop GUI dev) to get on board with Elm web GUI apps development quickly?

Official Elm Guide itself will take you far, https://guide.elm-lang.org/. After that you can try https://www.udemy.com/course/elm-the-complete-guide/.

Re: Understanding UI Components in Elm

#8
post #5

Can anyone more knowledgeable on Elm comment on the "statelessness" as there still is a state. There isn't an explicit type alias for the state nor is there an explicit update though. Maybe "implicit state" would be a more fitting name here. Also, given that they write about web technologies, then their static site returns a blank page when js is not enabled..

For this post, stateful and stateless refers to how the component looks from the point of view of Elm.

It's true that the DOM is very stateful, even when we're writing "stateless" Elm code though. But this is something one needs to know regardless of what kind of components we write.

Re: Understanding UI Components in Elm

#9
post #5

Can anyone more knowledgeable on Elm comment on the "statelessness" as there still is a state. There isn't an explicit type alias for the state nor is there an explicit update though. Maybe "implicit state" would be a more fitting name here. Also, given that they write about web technologies, then their static site returns a blank page when js is not enabled..

There is state of course, but it is kept in the calling module not in the component itself. In other words, if component has a Model defined, it's a stateful component.

Re: Understanding UI Components in Elm

#10
post #5

Can anyone more knowledgeable on Elm comment on the "statelessness" as there still is a state. There isn't an explicit type alias for the state nor is there an explicit update though. Maybe "implicit state" would be a more fitting name here. Also, given that they write about web technologies, then their static site returns a blank page when js is not enabled..

The state is completely handled by the parent. So the component itself is indeed stateless.

Basically, the message is: Avoid having components with local state, especially if it needs to be synchronized with the parent. Instead have one central place to handle state. Which is generally good advice and not really that Elm specific.

Post reply on HN