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.
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.
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.
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.
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.
Pick up (or let someone suggest a codebase ), and ask questions of related things in forum. People are very responsive and encouraging here.
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.
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.
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
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)
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.
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.
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)
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 )
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.
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
Try to migrate your small back-end project to elixir, it will give you some kind of idea about performance and development processing. Especially if you used functional programing like python or ruby, it will be much more easy.
Oh yeah, I’ll echo this. My first Elixir project was rewriting part of a huge Rails app, to a crushing success. It was super eye-opening to have covered the basics and immediately jump into trying to make useful code that replaces other useful (but already very slow to run and hard to maintain) code.
I decided that I’m going to create this resource. I’ll try to cover as many aspects as possible of creating and deploying a production quality Elixir app. I have experience deploying Elixir apps in Azure, but not ones that I would consider ready for production. So, it’ll take me a long time as I’m going to have to learn a lot of it from trial and error, research, and plain old questioning the experts.
If anyone has anything, they will want to include in something like this let me know.
So far I have the following planned:
Dev Environment
Setting up VS Code with a Docker Dev environment to match production resources. This includes the host OS container, dependencies such as a database and telemetry observability applications, basic VS Code plugins
Elixir toolchain
mix
releases
iex, etc.
Continuous Integration
Tests
Builds in Github or Azure DevOps
Automated Deployments
Infrstructure as Code
Application configuration
Application starting with different configurations depending on deployment environment.
Using third party or cloud provided tools like Azure Key Vault, AWS’s Key Management System, or something like Hashicorp’s Vault
Error handling
When to use Supervision trees and/or try/rescue
Let it crash is sometimes an option, but not always.
Telemetry
Logging
What type of Telemetry to collect (depending on the example application)
How and where to push
Setting up alerts for incident management and on-call (depending on the Telemetry Observability application provider)
Sending email as part of confirming pertinent user changes and information
Api Security
Unit tests and Integration tests
Also part of CI/CD
Data Persistence
Choosing the correct database type for our application
Using Ecto
Database Migrations
Including production
I’ve gotten permission from Luca (zero2prod.com) to create the domain zero2deploy.com. I probably didn’t need permission but felt that the name is so similar that it would be shameful not to run it by him first.
I would love to share as I am developing on MS Windows - but not deploying on Windows.
I think one of the main selling points is that Elixir is a rare programming language which runtime works natively on Windows. It takes a bit of effort to set up though like some libraries will need the Visual C++ Build tools.
Thoroughly approve of the chapters though here are some suggestions:
a. Explore :observer in extra depth and explain the metrics would be a definite gamechanger as many arent 100% familiar with BEAM. There are quite a number of books out of there - but a Cliff’s notes will be really useful especially when Elixir is a very hard sell.
b. Explore alternative tools like :observer_cli and explain how to make Erlang nodes and use observer to monitor them remotely. Took a while for it to click for me mentally.
c. Performance expectations. Yes load tests. There isnt a whole lot of effort spent on benchmarking Elixir - yes because it simply is different. But surely, there is a way to guide people how to do good load tests and gain enough confidence that their coding skills pass muster.
I learned Python at home but at work Python was not embraced. At some day I just started to write Python scripts to support my daily job. Then I was hired by a department of a big dutch energy company and the automation there was a disaster. I wrote Python scripts with a big extra focus on error-handling&reporting and then I convinced my manager to launch a dedicated Linux server in their Azure cloud as a home for my Python scripts. Well, it now runs for more then 2 years.
Just have trust and go for it. And don’t forget to document your scripts in an text document. They will mention you in their prays later.
I know you wanted non-Phoenix specific resources, but I still recommend checking out LiveBeats. It is a really cool project and I personally learned a lot from it.