Morzaram
Hey everyone, I often see questions regarding best practices, and examples that people can reference so they know how to structure and accomplish certain objectives they’re facing. So, I wonder if anyone is open to collaborating and creating documentation on best practices to get things done.
I’m not completely sure of the best route to doing this, but perhaps people can raise their hands to what they’re good at, and also what best practices they’d want to see be built out. Based on consensus, I can take care of the organizing, but I still feel that I’m a super newbie at Elixir despite having 1 year of experience still, so I’d have to rely on the community (you) to help with the actual knowledge part of the how to.
An example for me is showing the best practice of multi select such as fly.io’s article here but to give more detail in how to implement and update embedded schemas in a clean and reusable way. (Ecto is still a struggle for me with these things)
I think this can empower the entire community because they can have a reference on how to structure, write high-quality code, and also build confidence as an Elixir developer. The more livebeats like examples the better.
I was thinking it could be a maintainable GitHub project where people can do some PRs and then have a simple static site.
Also, I’m willing to make some youtube videos with anyone open to it, so we have both written and video documentation.
Would love everyone’s thoughts on this, and apologies if this has been discussed before.
Thanks!
Trending in Discussions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
derpycoder
I found out a super optimal Fibonacci sequence algorithm for Elixir:
So I was thinking, if snippets like this are collected, so we can use them in any project, just like using Emmet!
I am creating my personal project, which will be like a starter kit I can use for every other project that comes after.
I am adding all the best practices one by one, as I keep learning. I think the generators, documentations, phoenix framework generated code itself has lots of sensible defaults.
And I believe books, videos and tutorials are necessary to know why things are the way they are. Like Elixir Secure Coding Curriculum!
Plus there are tools like Dialixir, Sobelow, Credo.
Though it would be cool if we can have some default way of doing authorisation that can scale, just like Ecto library, and default Authentication generator along with an awesome Admin panel, CMS, plus anything else that Startups can use to jump start projects.
sergio
Would be a great addition to the community for sure!
I think the “latest and greatest” best practice is actually Chris Mccords very own LiveBeats.
https://github.com/fly-apps/live_beats
Morzaram
I completely agree with this example being a best practice reference. Perhaps we can disect and document what code snippets of live beats are best practice and build some written understanding of how it works, how to implement it, etc.
Then also do that for other repos that are also considered to have best practices.
Are there any specific examples within live beats that you would consider worth mentioning for best practices?
derpycoder
I would like to read that book.
scoop
For us beginners (with visions
) trying to parse out the most crucial snippets and best practices would be amazing.
i’ve tried to consume Chris’ app in my spare time but, yeah. It’s a lot to taking.
Also, a moving target etc.
AstonJ
I’d love to see a Phoenix Recipes book - I’ve posted about this in a few threads now:
I think it would be great if José and Chris were involved too, not necessarily as the people writing it, but as co-authors overseeing what is/isn’t included and maybe adding their thoughts on things every now and again.
It’s no longer in print, but this is what was in Rails Recipes:
The only issue really is Phoenix is moving pretty fast atm, so such a book might become outdated quickly (in which case a Recipes section here on the forum could be worth exploring, a bit like our ‘how would you’ type section, or adding something to the Phoenix site itself..)
christhekeele
Based on my experience with this sort of thing, any such resource (either as a book, website, repo, livebooks) has to have a full test suite that runs regular on CI, and “looks ahead” to the language’s
masterwith unlocked deps to get ahead of changes.Also clearly documenting the pub date and versions of software used in all code examples.
TBH this is one of my main struggles with Livebook right now; there’s no way to externally and programmatically drive its execution as a project dependency. Makes me reluctant to use them as a form of primary documentation for anything.
olivermt
A good book format for this could be exdoc in a repo that can be versioned I would say. That way you can have doctests and even actual code sample modules referenced in the exdoc pages.
dimitarvp
I imagine this can and should be handled with Git tags.
Or LiveBook nowadays, maybe.
derpycoder
@dimitarvp LiveBooks, yes please.
There’s cheatsheet feature in ExDoc, and LiveBooks can be embedded into the generated docs.
So we can read the LiveBooks when away from machines and then run it when possible.
I liked @AstonJ’s idea. I am beginner in backend dev, so I was thinking a cookbook for building SaaS related features would be great. (Not beginner algorithms and challenges, that can be its own book!)