Where can I find a mentor?

How can I get better at the finer details of building programs with Elm?

Hope this post isn’t too long.

I find myself getting stuck on a few things in Elm, and I’m not sure the best way to get better. I understand people are taking time out of their busy life to answer questions on here, and that the community is small. I think I need a mentor of sorts to help me get unstuck at times.

For me, some of the difficult parts of functional programming are the following, when you don’t have a tutorial to hold your hand:

  • “Seeing” the flow of data and state (from a high-level view)
  • Planning your program
    • Which data structures are most appropriate? The most simple?
    • How do I design my program and deconstruct it?
    • How to re-design my program when I discover problems and complexities?
  • “Gluing the parts together”
    • Deciding which functions to use (and using them correctly)
    • And how to combine them
    • Where to place them in the program
  • Difficult stuff like recursive types and weird terminology (hopefully I can avoid these)

A lot of this is trial and error, and I’m working my way through “Functional Programming Made Easier” (which uses Purescript), but even after reading through “How To” books on designing programs, doing and building on your own can often trip you up.

I was going to head to Slack for advice, but I read this article and it put me off joining a bit.

Perhaps working on a real-life problem with others is the best way forward. I’m primarily focused on the following things (for my purposes). All quite usual stuff for apps, mostly focusing on prototyping, then handing over to a team when it makes cash:

  • CRUD forms and posting/receiving json
  • Building out suitable models and data structures
  • Simple UI and UX for end-users. Projects include:
    • Food reviews (think TripAdvisor)
    • Book lists/catalogues (requires using APIs, think Goodreads)
  • Working with tags and search (I expect this to be difficult)

I imagine a lot of people have the same struggle, and learning alone only gets you so far. Unless you’re very smart you’re going to come unstuck at some point! I’m a senior in HTML/CSS but a junior/intermediate with programming.

Who do I ask? Where do I go?

  • How can I learn? (paid work if possible, most jobs are Vue/React)[1]
    • Somebody’s pet project
    • Freelance work
  • Where do you go for mentorship? (Elm, Purescript or Haskell-like)
  • Where to read more about actually building things (rather than tutorials)

Like I said, I’m working on improving my knowledge, but it’s going from hand-holding to real life that’s the problem. I’m not that much of a logic guy, my background is in the arts/design, so I’m more of a visual learner. Functional doesn’t always come naturally. Maths is OUT.

On a slightly tangential note …

I’m handing over some Elm examples to a friend who works for Nuxt, to see how much easier/harder it is to build the same thing. Some aspects of functional seem harder than they need to be (List.map doesn’t take Result of different types, for example), or too many ways to do it (form validation). I can report back if anyone’s interested!


  1. Learning yet another paradigm/language has a lot of overhead and I don’t have the time. ↩︎

3 Likes

@badlydrawnrob I feel your pain.

A few high-level thoughts based on your question:

  1. It’s probably better to attack your problem head on rather than indirectly. For e.g. don’t read “Functional Programming Made Easier” and then try to transfer that knowledge to Elm, instead try to learn from Elm specific resources. Try one of these Learn Elm.
  2. Don’t try to know or understand everything before starting to build. Learn a little, build a little, repeat. For e.g. I started by reading https://guide.elm-lang.org/. Then, I picked a project that wasn’t too much of a stretch for me to build and tried to apply the knowledge. One of my very first projects in Elm was GitHub - dwayne/elm-todos: An Elm implementation of the TodoMVC's to-do list web application.. Why? There were already a lot of existing implementations I could learn from after trying to build it myself.
  3. If you’re trying to learn to do specific things in Elm then you don’t need a real-life problem you just need a contrived problem that allows you to practice those skills. Only build out as much as you need to understand how to solve the specific thing you’re trying to solve with Elm.
  4. Your HTML/CSS background will help you tremendously when it comes to building Elm views. That’s something you can lean into to start reaping the benefits of Elm early on. Here’s a short preview of my process for building Elm web apps: design, prototype in HTML/CSS, translate to Elm views, add business logic. For the design part, I usually don’t do that myself. When learning I use existing designs and for work I use a designer. For e.g. when I wanted to learn about handling animations in Elm I used the existing design for 2048 so I could focus on the other parts of my process: prototype in HTML/CSS, translate to Elm views, add business logic.

Here’s how I did it. Be forewarned, my process requires patience.

In conclusion, if I were starting to learn Elm now I’d do pretty much the same thing. There are newer better resources, for e.g. Frontend Mentor, comes to mind but the approach would remain the same, i.e. learn, build, repeat.

P.S. As for getting a mentor. I think the Elm community consists of really thoughtful and helpful people that the #beginner channel on Slack is all you’d really need. Start working on something and when you hit a dead end reach out for help. If after a few tries you’re not getting the help you need then reconsider.

8 Likes

Hi Rob,

I too felt that way many years ago. It’s probably natural to feel that way when facing difficulties. So I never found a mentor (nor did I really look for one in thruth), but let me give you my view point.

Deliberate practice. If you have difficulties on a particular subject it means you haven’t practiced enough.

I think this is the wrong way to think about it, “seeing the flow” is an imperative mind set. Instead you need to think in terms of “describing computations”. If you think about it, a whole program may be one big recursive loop, there’s no way you could fit all that in your head.

I think this takes years of practice to master (and making lots of mistakes!).

Don’t think too hard about it, be satisfied with a less than ideal solution if that’s the best you can do in the moment: a badly written program is (probably) better than no program at all. You can always come back to things later, at a cost obviously.

In terms of learning I would say you need to find what works for you. If the PureScript book’s not working for you, try something else! Maybe next year will be a better time for it…

Personally I know that reading many different books in many different languages fits my learning style. So I try to do exercises everyday whatever the language or the subject.

So, in that sens, I have many mentors on my bookshelf.

Don’t do that. Nothing comes naturally. Whatever difficulties you may have, you can overcome them with work.

The only thing that matters is whether you’re making progress towards the goals you’ve set for yourself.

That’s my 2 cents, hope that helps.

5 Likes

Thanks for the well thought out responses both.

Books and exercises

@dwayne So far “Functional Programming Made Easier” has been fine coding the examples in Elm. The reason I picked this book is hopefully it gives a better overview of typed functional than the fairly limited resources Elm has — I imagine there’ll be quite a bit in later chapters that doesn’t transfer though.

I’ve also read Elm in Action and half-way through Programming Elm which are both good. There’s also this book but I found it too hard to get into (a bit advanced?)

It seems your general advice is pick a concrete problem with a requirements set, which feels just about doable with current knowledge and ask around on Slack if you get stuck. Good advice.

Does Make Data Structures fit into that method? What I’ve learned from similar videos in Elm is that you start with data, rather than components (which is the Vue/React way), so I guess both a little top/down and bottom/up process (for design/code)

I’m not interested in building games (that 2048 has a lot of state!) but the other smaller programs seem like fun. Perhaps I’ll start there. There’s also Exercism for exercises but I haven’t tried out the mentorship there yet. I think trying to keep it fun and interesting is key.

Deliberate practice

Hey @benjamin-thomas deliberate practice seems to be a running theme from feedback I’m getting. I think the issue I’m having is I’ve got other stuff to do, so I’ve got to keep the learning/targets manageable and somewhat simple.

“Describing computations”, yes I get that, but I’ll give you an example of a program (from Programming Elm). The Elm Guide’s json examples are fairly straightforward to follow, but some type signatures (such as Http.expectJson) are difficult to understand (I understand them superficially), and without an example Msg or “in-use” examples, I might not have figured that out for myself.

I suppose I should just mess around with elm repl a bit more for discovery:

But I still find it confusing at times. PureScript’s compiler errors so far are rubbish in comparison!

I understand Result well, but the flow of data as I’ve mentioned could be just describing inputs and outputs of functions, and where to deal with them (such as the resulting Msg payload). I don’t think that’s at all trivial. I think @rtfeldman said Json Decoders are the hardest things to teach. Visual diagrams would help (Beginning Elm does a reasonable job) so you’re probably right, even a 3 year CompSci course isn’t enough and it probably does take years!

Yes, I’d agree just getting something working is a good thing. Hopefully you’ll incrementally improve. Definitely agree to mix it up: Learning How To Learn or A Mind for Numbers are great books/course all about that: interleaving different sources/methods. They’re good for all ages.

I hope I wasn’t being too negative, but I definitely know my limitations. Advanced typed functional is a serious investement in time, and I have a good idea what I can/can’t achieve without working full-time on it!

If anyone else has any job boards, websites, mentor tips, I think a lot of beginners would benefit. All good helpful comments so far!

2 Likes