DEV Community

Mykolas Mankevicius
Mykolas Mankevicius

Posted on

6 2 2 2

My Experience with Elixir Development

I've been doing Elixir development full-time for nearly two years now.

I love the language and the tools we have as a community. The creators and maintainers are doing a superb job of supporting, maintaining, and creating new things.

All of the following are just some observations I have coming from a different ecosystem.

LSP - The Thing That Makes Your Editor Do Wonders

We have great news that there is a team now working on an official LSP for Elixir. Please go and support these people as I am - even a $1 donation to all three people will go a long way if we get enough of us to donate.

Here's the blog post with more details

Until then, for VS Code users, just use elixir-ls, and if you're using asdf, make sure to have a .tool-versions file in your project's root folder. It will work some of the time.

Project Setup

With LiveView 1.0, we finally got this, which is great to have in the docs. But it would be even nicer on the front page of Phoenix:

curl https://new.phoenixframework.org/myapp | sh
Enter fullscreen mode Exit fullscreen mode

It's something, but I personally think that Ash framework has something much better, and I hope that Phoenix will adopt it as well.

Image description

Adding Dependencies

Much better now with Igniter:

mix igniter.install some_library
Enter fullscreen mode Exit fullscreen mode

But without Igniter, it's this:

  1. Find the dependency
  2. Copy-paste the requirement into mix.exs
  3. Run mix deps.get

Which feels very convoluted for something so simple.

Dependency Setup

Much better now with Igniter, if the library supports it.

Otherwise, it's:

  1. Hope the documentation covers the setup
  2. If not, search the web for setup instructions
  3. If nothing is on the web, try asking in forum/slack/discord
  4. If no luck, wait a few years and maybe you'll join a team where someone has made it work

Try setting up ex_cldr with gettext with a backend and interpolation.
There are so many things to figure out, it's not even funny.

I'm lucky I'm working with people who have done it, so I can copy-paste many things into my own projects.

I don't know why, but this feels very complicated at times.

The Docs

While very good in content, they are hard to understand as a beginner coming from platforms like Laravel, Nuxt, Next, or Astro.

LiveView

While it's an amazing technology, pray you don't need any complex components or infinite scroll with position restoration.

You'll soon learn about hooks and how difficult they are to work with if you don't understand JavaScript at an intimate level.

I don't have that problem as I love JavaScript and don't mind creating hooks. But it's night and day compared to working with something like Vue/React and their ecosystems.

Code Organization

It's challenging, and I still don't know how to do it properly. In the projects that I'm working on with Ash, this becomes much clearer.

Components

Delete core_components.ex and use one of these to save some time:

Other Resources

Overall

You need to learn a lot to really have a nice starting point. You have to read/watch many blog posts, Reddit threads, and YouTube videos about setup and related topics to ensure you're well-prepared to start.

Look at something like Laravel - a lot of information is right on the front page, and the docs connect many concepts. I understand that Taylor does this for a living; I just wish that our leaders could work on these things and make money from them too.

Again, I'm just noting these things down in hopes that people will prove me wrong and tell me what I've missed.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (2)

Collapse
 
axibord profile image
Aghiles Lounis

I find that the Ash framework is a bad abstraction. It might be a skill issue, but imo it's a terrible idea to integrate it into Phoenix.

Collapse
 
neophen profile image
Mykolas Mankevicius

Maybe you're right, at the moment it works i've only started using it for my project and streaming the results. If you're interested you can have a look here: The Mykolas youtube

It's a very steep learning curve and i don't know how much it will pay off.
But so far it seems great for the things i'm trying to do, and saves a ton of boilerplate.

This is always the case though with tools like these either you love it or you don't. It might be a skill issue of me not knowing elixir/phoenix concepts enough.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay