Are there any detailed walkthroughs of complicated Elixir apps?

Hi all,

I’m trying to get back into Elixir and was wondering if there are any resources out there that walk you through building something complicated in Elixir (non-Phoenix specific). I’ve been an Elixir fan for a long time, but haven’t really built anything other than simple Web apps, so I always have this feeling that I’m not really learning how to write a proper Elixir app.

There’s a great resource called danistefanovic/build-your-own-x: :nerd_face: Build your own (insert technology here) (github.com), but not much Elixir related.

Thanks,
Jeramy

6 Likes

Tried “the real world” project that has been written in numerous languages and frameworks?

3 Likes

Does anyone know of any others?

1 Like

Which books (if any) did you get through Jeramy? I’m personally a fan of books (and courses) as you often pick up lots of tips and by the time you’ve gone through them all, you’ll usually have encountered a wide variety of apps/scenarios :smiley:

I’m currently enjoying Prag Dave’s course Elixir for Programmers, Second Edition

1 Like

I’ve purchased every Manning and PragProg Elixir book (I want to support anyone that writes a book about Elixir), and have finished several of them, but I haven’t felt like any of them prepared me for Production quality code. I guess I’m looking for something like zero2prod, but for Elixir.

3 Likes

I’m surprised to hear that… what do you feel they were lacking?

I wonder if the next step might be some Erlang books? I’ve actually been trying to get @max-au and the WhatsApp team to write one! I am pretty sure we’d learn a ton of awesome stuff if they did! :003:

If you are looking to learn more about architecting an app, and haven’t done it yet, I think Prag Dave’s course could be well worth a look. I loved the first one, and I’d love for José and Chris and @sasajuric and other Elixir experts to do similar courses too - I’d love to see how they go about creating a full app!

2 Likes

Although I don’t think it’s precisely what @jeramyRR ‘s looking for, Alex Koutmos’ upcoming Elixir Patterns (https://elixirpatterns.dev/) seems from the TOC like it might be worth keeping an eye out for.

@AstonJ - do you think someone who already has the Elixir basics covered (albeit without having written any serious prod code) would learn much from the Dave Thomas course? The overview makes it look like an intro, but I’m still tempted as I always find Dave Thomas deep & lucid on programming topics.

4 Likes

Nerves-Hub is open source, many parts of hex are open source. It’s for sure not guided or build for education, but also I don’t think it’s too hard to get into those codebases when being comfortable with basic elixir/phoenix. There’s also GitHub - dashbitco/bytepack_archive: Archive of bytepack.io for a less complete, but structured by the dashbit team, project.

Lastly I’d suggest to not overestimate what it takes to do elixir in production. When you’re able to create a mix release you’re imo almost done on the elixir/beam specific side. The remaining steps might be reading Erlang in Anger as well as the whole devops/ops part, which can be largely ignorant of the fact that it’s elixir to be run.

1 Like

Looking at open-source projects does help a lot, but a lot of the time the code doesn’t explain why the developers choose to do something a particular way and why it’s advantageous. A good course or book from someone with serious prod experience would be great in that regard.

I’m asking because I’ve proposed a system, for our upcoming hackathon at Microsoft, in Elixir. When it comes to production services in C#, Java, and Rust I’m proficient and experienced enough to be confident in deploying what I develop. However, if my Elixir proposal gets approved, I’m not confident enough that I know what I’m doing to deploy it in Production.

1 Like

So, you want to learn best practices / avoidable pitfalls beforehand by exposing yourself to elixir open source code .

And need to do it fast (that’s why the explanation of code is needed)

Here are a few things you can try.

  1. If someone can pick a library , i can try to chart out in a blog post what it does, and how. Maybe, i’ll able to answer why as well. Would love to coordinate on this one. Digging together, basically.

  2. Pick up (or let someone suggest a codebase ), and ask questions of related things in forum. People are very responsive and encouraging here.

:slight_smile:

4 Likes

I’m interested in the subject and will monitor this thread closely. As a junior programmer (though I’ve been programming for a while), it’s quite frustrating for a book author to give an example accompanied with a disclaimer “Don’t write this in production” - the essence of picking up a book is to learn/acquire knowledge to write production grade code unless the book is a beginner’s guide which most of the books are the direct opposite (I would argue a beginner should be introduced to production grade code - cultivating the habit of writing quality code right from the onset rather than didactic examples, I stand to be corrected). I can’t say the same for most of the elixir books though I think some of them contains non-real world examples.

I suggest seasoned/experts advise on a progressive list of books/resources to help noob/budding programmers systematically progress in learning a language and more books from the subject experts. Books that once you grasp it content; you are confident enough to write production grade code.

Regardless of the above, I’ve a few elixir applications running in production - maybe with time, refactoring code based on knowledge/experience will make it more of production grade.

I’ve perused a few open source code; I end up looking for resources to read to fill the knowledge gaps.
I’m open for counselling from the expert, as usual elixirforum members have been my goto counsellors.

4 Likes

I could be wrong (I often am!), but I believe this to be impossible. You can’t learn to write production code from books (or, from an author’s perspective: you can’t write a book to teach someone to write production code). A book that attempted to do this would literally be a book about everything an experienced programmer brought to the table, from the specifics of the language and ecosystem, to overarching concepts, to nitty-gritty pragmatic tips and tricks. It would be an indigestible monster, and an inevitable failure. Books aim to teach, and essential to teaching is to focus on the level and lesson at hand, excluding confusing side issues.

By analogy with music: you just couldn’t have a book to make you a confident pro guitar player. It would be a thousand confusing volumes. So instead boks focus on scales or harmony or the fretboard, and the reader uses them as steps on the way.

That said, I would agree the market for programming books has been skewed toward beginners books. This does seem to be changing.

6 Likes

Maybe these real world Elixir examples help you.
They did to me a lot, understanding how an Elixir app is built from A to Z.

3 Likes

Hi, I totally agree with you, a bit of context will probably help clarify that line. Consider a book like Metaprogramming Elixir written by @chrismccord - once you grasp the content, you are certain of writing production quality macros with a little effort on your part; it’s not a generic elixir book and that’s exactly what I expect from other resources not being branded as beginner’s guide. Another good example is Programming Ecto

2 Likes

I guess people learn differently! I have never felt confident about writing production code after reading a book to “grasp the content”. It’s always required an iterative process of reading, writing code, comparing with other resources, failing (or enjoying small successes), and trying again. To me the conceptual part of programming (which is what I take to be “grasping the content”?) is a good basis, but it’s practice that burns the concepts into procedural knowledge.

Or perhaps I’m being too picky about your meaning. I’d agree of course that there are books whose code examples, if worked with, will get you closer to the kind of thing that you’ll write in production. I don’t see it though as a deficit in ‘generic elixir books’ that they don’t have this kind of content. If they did, they’d be too difficult for beginners, and too diffuse for developers already experienced in the book’s domain.

A general hole in the book market seems to be fast-moving introductions and overviews for languages (& their associated tools/ecosystems etc) for developers already experienced in other languages. Most ‘generic’ books seem to conflate ‘beginner’ (at programming per se) with ‘beginner’ (to the specific language)

4 Likes

I don’t believe there is any book that does what you want. If you’re not comfortable then it’s best to start with a project you can afford to make mistakes on.

In my experience, books are there to give you a baseline to start from. To obtain serious wisdom you need a combination of experience and mentorship. Re: open source, I don’t think you’ll find (m)any people documenting the entire catalog of wisdom behind the project. The onus is on the interested party to read through the documentation, old issues and PRs and to try submitting a non-trivial PR themselves. You can learn quite a bit about why things were done a certain way by trying to make changes yourself.

In my opinion, this is the same for any skilled profession. You can’t be a serious mathematician or physicist just because you read the text books and aced your exams. And your advisor won’t have time to tell you everything you need to know. Books, classes, etc… are meant to give you a foundation to build yourself up from.

6 Likes

From my experience, in order to achieve this level, it requires a lengthy trial & error process/loop that includes, along with practice, constant documentation:

  • reading books/articles
  • searching the Internet for unknowns
  • asking on forums for unknowns
  • reading others code (github) and best practices

With every iteration I found myself closer to the production code.
Valid for any programming language/software stack/framework.
Once can’t acquire this skill just from books. It’s too complex.

3 Likes

I’ll write a proper review when I finish it but I would say yes - even if that is to see how someone who has being coding for a long time goes about things. The first version of the course took things to the extreme, and he’s said he’s refined his thoughts and the new course is the result… so I am very keen to see how things have changed. The only thing I wished the original had was some sort of database or persistence - every single app I’ve created has needed a DB so without this aspect this does limit the usefulness, I haven’t checked but I hope this update has one included. Check out the reviews in the thread/s to see whether it’s something you might benefit from (or wait for my review once I’ve finished it) :smiley:

Completely agree with this^^

Try not worrying too much about it Jeramy - if it ‘works’ then you’re half way there imo. But if you are worried, just finish those books because once you have you’ll know you’ve got a fairly good grasp of things and you’re heading in the right direction. That’s what I did with my first ever app and that’s what I tend to do myself anyway.

Maybe create a small app and then deploy it to a cheap hosting account? Ask questions here if you get stuck?

+

Personally I prefer to first read/learn as much as I can so that I have a good overview of a language/framework before getting stuck in. In fact the first app I created was arguably one of my finest… because all the best practices, info, tips and tricks were all fresh in my mind (I definitely got a bit lazy afterwards!)

I wish someone would write an Elixir (or Phoenix) Recipes book - I have referred to the Rails Recipes book often over the years when working with Rails - not because it has info that isn’t anywhere else, but because it’s a lot of ‘good’ reliable info in one place. (Maybe some of our mods or regulars could write such a book :blush:)

1 Like

Prompted by this thread I took the plunge and started it this morning. My dips into learning Elixir have stalled for various reasons, and even though I generally favour books over video I thought this course would be a galvanising way to get started again. Might write a review myself when I’m through.

From the looks of the TOC the hangman app he builds doesn’t havt any form of persistence. I don’t particularly mind that as the official Phoenix guides have enough to get anyone started with Ecto & Postgres. What tends to be more lacking in early-level learning material is guidance on how to structure apps, how to relate runtime to module structure, etc, and it looks like this is a strength of Thomas’ course. I’m looking forward to spending a bit of time on it this week.

2 Likes

Awesome - let us know how you get on! :023:

That’s true, but because Dave goes about things differently I would have liked to see how he deals with the persistence layer… I’ll be curious if you feel the same when you’ve finished the course :smiley: