• YoyitoTV
  • Posts
  • Javascript was slowing me down. All in on Elixir

Javascript was slowing me down. All in on Elixir

I'm a bit pissed at myself, and this is a resentful rant towards JavaScript

Disclaimer: I'm a bit pissed at myself, and this is a resentful rant towards JavaScript perhaps driven by emotions. To be fair, it's mainly some of the ideas I bought into when I first started coding that I regret. Before I dive in, a quick backstory on how I got into JavaScript is necessary to make my point.

My first foray into programming was a bit of JavaScript, HTML, and CSS when I was 13, but that's too far back. College was mainly C++, and in 2015 I tried Swift because I loved the idea of creating mobile apps. However, my true first language was Ruby. I learned Ruby and Ruby on Rails in 2016 and instantly fell in love with programming. Ruby felt like a joy to work with.

My first professional job in 2017 was full-on RoR with Coffeescript (member that?). It wasn't until a severe need for mobile development help at my company, coupled with my early curiosity about mobile, that I jumped into React Native. I offered to learn and help, spending two weeks getting up to speed. With colleagues' support, I picked it up quickly, fueled by my obsession with mobile development, not JavaScript itself.

As I progressed, Freecodecamp started touting JavaScript's superiority over Ruby and other languages, specifically highlighting how it offered transparency into concepts like database setup and direct browser interaction. They argued that frameworks like RoR hide these details, creating the illusion of building without true understanding.  Plus, the idea of mastering one versatile language was appealing. I ended up freelancing and running my own software development agency specializing in JS/TS projects, recommending it to clients because:

  1. One language to rule them all.

  2. Abundance of developers.

  3. Frontend and backend with the same skillset.

  4. Cheaper developers (or so I thought).

  5. Easier to find developers.

Despite never truly liking JS/TS, I wholeheartedly believed in these points. Around 2018, Elixir piqued my interest. Coming from an OOP background, it took some time to grasp functional programming concepts. But when it clicked, oh boy, did I fall in love – pattern matching, Ruby-like syntax, the FP approach, and that glorious pipe operator! Still, professionally, I felt stuck.  Every time I suggested Elixir, I was met with skepticism. So, while I used it for personal and side projects (mainly APIs, as I still believed frontend was "easier" in JS), I remained a JavaScript developer.

Last year, I embarked on an indie hacker/solopreneur journey and decided to give Phoenix a shot for full-stack applications as a monolith. Building a personal project with Liveview for the first time, I needed an admin dashboard where I could create organizations and events tied to those organizations. Phoenix generators handled most of it, but I had to manually add an organization dropdown for the events form. Doing this took mere SECONDS! A wave of rage and resentment (mostly towards myself) washed over me as I realized the countless hours wasted on client projects that could've been minutes with Elixir/Phoenix.

To illustrate, accomplishing the same task with our usual JS stack would involve: API route setup, controller logic, error handling, data validation on the API side. Then, on the client side, API requests to fetch organizations and the new event insert endpoint, UI logic, form handling, organization display, state management…  A 30-minute ordeal, approximately. Multiply that across countless features, and projects that took 6 months could've been done in 2? Infuriating.

And no, I have not forgotten about NextJS new features and also the new server components, It's a hilarious full circle back to the very MVC architectures once mocked for their monolithic nature. In my opinion, it's actually a worse architecture, even more confusing and prone to spaghetti code than anything else I've encountered. Now you have everything crammed together – you have to mentally juggle "use server" and "use client" sections of your application, which can now reside in the same file! On top of that, there's this crazy level of abstraction layered on by default, burying the very transparency that was once a selling point of learning JavaScript in the first place.

Enough ranting! I'm here to profess my love for Elixir. In my quest for lightning-speed product development, Elixir/Phoenix has proven an unbeatable combo. Not only is it compiled, but Phoenix with Liveview lets me build truly limitless web applications at a pace unmatched by anything in JavaScript, all while keeping my code clean, architecturally sound, and free from lock-in to third-party tools. I'm all in on Elixir – elegant, enjoyable, and the source of a coding joy I haven't felt in a long time. I'm happy, in love, and ready to just build, without the noise.

As I was writing this I figured I should make a video to show what I mean so check it out if you like: