As a recruiter working in the BEAM market I spend most hours or my days on calls with Erlang & Elixir developers, meaning I’m arguably in the best position to spot new trends that are catching their attention.
Eight years ago it was a new programming language that was seen as a ‘functional version of Ruby’ that everyone was asking me about: ‘Do you have any Elixir roles yet?’, before explaining, in great detail, a personal project they’d been working on in Elixir.
Whilst Elixir is still considered by many as somewhat niche, it’s now well established as a widely used programming language, making it inevitable that we’d see the creation of useful tech that can work well alongside it. Over the past 18 months or so my conversations have been full of excited talk of LiveView & how it could be a gamechanger for Full Stack Development in Elixir.
I wanted to ride the wave of excitement & I’m pleased to be collaborating with Phoenix LiveView enthusiasts Teifion Jordan & Benedictus Yevu on this Q&A interview in which we’ll look at various topics related to LiveView.
Hayden: Firstly, I’d like to thank you both for taking the time to work on this with me, hopefully it’s a great opportunity for you to help inform the community about your experiences with Liveview so far.
To start with, perhaps you could give a brief introduction to yourself & how you found yourself working with Elixir
Benedictus: I embarked on this journey 6 years ago when I was a software developer for a software outsourcing company. I was faced with the challenge of enhancing the performance of our voting platform on multi core machines, which was primarily developed in Ruby and Javascript. These sequential programming languages allowed some level of concurrent programming but it wasn’t that easy when I set out to solve the challenge at hand 6 years ago. Elixir was designed from the ground up to support concurrency, it emerged as a more straightforward solution to the problem. Since then, I embraced Elixir because it has come to stay.
Teifion: My name is Teifion Jordan; I’m a software engineer living in Wales. I’ve been using Elixir professionally for a little around 6 years; I was mainly using Python prior to that and while it was (and still is) a great language it just wasn’t working for me. I tried Elixir and once I got over the initial teething problems of any language it was a smash hit for me. I got started with Phoenix and never looked back.
Hayden: How were you first introduced to LiveView? Was there a specific problem you were trying to solve?
Benedictus: We wanted our user interface to instantly show data from our IoT devices as it came in. Its capability to provide real-time interactivity in web applications without writing extensive JavaScript was exactly what we were looking for.
Teifion: My first introduction was watching the talk given by Chris when he was making it. I’ll admit, I thought “uh huh, so we’re javascript now” and “this won’t work”. I am very happy to say I was wrong on both counts. I used LiveView on and off for a bit but the first time I used it properly was to give a real-time update on server state for something.
Hayden: Did you have any challenges to overcome initially when learning? If so, how did you solve them?
Benedictus: Backward incompatibility was a major issue and looking at how frequently LiveView is being updated. They haven’t figured out how to sort it out yet.
Teifion: My biggest initial challenge was shifting away from the mindset of “websockets but better” and actually treat a LiveView page as a living process instead of a page which got updates. I also initially struggled with components and messaging between them, I found it much easier to fall into the trap of putting everything into one page.
Hayden: What advice would you give to a new user that wants to learn LiveView?
Benedictus: Understanding the basics of Elixir is a must. Also, user must be willing to unlearn to be able to embrace the paradigm shift the LiveView comes with.
Teifion: If you’re new to Elixir start by learning the core concepts of Elixir (especially if you’re not used to a functional language) and then have a go with LiveView. It’s always more fun to start with the good stuff but if you skip foundational learning it’ll bite you later. My own journey was impeded by my not learning Ecto and Changesets correctly and instead jumping straight into using generators.
Hayden: What are your favourite features about LiveView vs other libraries you’ve used in the past?
Benedictus: Unified Language and Framework where both server-side logic and real-time client-side updates are written in Elixir. No need for multiple languages, frameworks and paradigms.
Teifion: I’ve not used similar libraries elsewhere so my comparisons are not feature based. I found the documentation to be extensive but sometimes very hard to find a very specific answer. A huge part of this is the speed of development LiveView has, information gets outdated very quickly so the documentation must stand on its own and cannot be bolstered by things like StackOverflow. The above mentioned trap I fell into I did so partly because I couldn’t always find the answer to my question in the docs.
Hayden: Is there anything you would like to see as an added feature of LiveView?
Teifion: I’m not sure how you’d go about changing it but I find the “not connected, connected” dance to be annoying. I’ve seen a few answers regarding its presence so I completely understand it and don’t see it as “a problem”. That’s the worst thing I can think of regarding it, the experience at this stage is so good.
Hayden: Do you see any specific domain/industry that will benefit from the use of LiveView?
Benedictus: IoT because IoT devices often send frequent updates which we integrated with the LiveView application. The state of the device reflects in real-time on the web. For IoT applications where timely updates are crucial, this is a significant advantage.
Teifion: Anything where the line between web-app and app-app is blurring. It bridges the front and backend very nicely but more than that I can’t predict.
Hayden: How do you find compatibility with applications that have been built using LiveView, do you have any recommendations to ensure full functionality for any device or OS?
Teifion: I’ve had zero compatibility issues with it. I know LiveView Native is being developed and given the nature of what they’re doing I’d expect compatibility issues are their biggest item but the standard LiveView has (to my experience) just worked as long as the browser is modern.
Hayden: What do you consider to be potential drawbacks when using Liveview for a project?
Benedictus: Decoupling. Thus trying to decompose your solution to try and achieve a micro service architecture. Secondly, the learning curve for new developers.
Teifion: The biggest drawback is the limitations imposed by a browser. With my previous role we were looking to create desktop notifications and (for good reason) browser apps are very limited in what they can do there compared to native apps. That said, the biggest drawback is also a massive advantage. Nearly everything has a browser and thus LiveView is incredibly available.
Hayden: With regards to Liveview & perhaps Elixir in general, can you recommend any communities or resources for your fellow engineers?
Benedictus: Elixir forum and books written by engineers in the ecosystem
Teifion: Only the usual ones; there is the Discord, the Slack and the Elixir Forum that spring to mind for communities. For resources I typically point people to elixirschool.com as a starting point. Once they have the basics I’ve typically then started pair programming with them in some way (the context is them contributing to an open source project with me).
Hayden: Well that's all from me, thank you both so much for taking the time to share your knowledge experience with me
Links:
Elixir Discord: https://discord.com/invite/elixir
Elixir Slack: https://elixir-lang.slack.com/
Elixir School: https://elixirschool.com
Elixir Forum: https://elixirforum.com/