axelson

axelson

Scenic Core Team

11) ElixirConf 2017 - Its Better Unstated - TJ Stankus

ElixirConf 2017 - Its Better Unstated - @tjstankus

This is a story about transitioning an obsession with object-oriented software design to an obsession with functional software design. It’s about experimentation, learning, and play. It’s about what happens when you let go of sacred cows you’ve hung onto for nearly 20 years and insist on wiping the slate clean.

The story is told through a code kata. It starts with a Ruby example, the result of a rigorous application of OO principles. It’s thoroughly decomposed, free of conditionals, and contains small objects representing domain concepts, including state. The solution is all about state and it’s lovely, if a little overwrought.

But could I implement the same kata in Elixir entirely without state? It turns out that leveraging functional approaches and Elixir features like pattern matching, robust list processing, and guard clauses, a conditional-free solution emerged with an 85% reduction in lines of code.

This talked is aimed squarely at the developer thinking about or just starting to transition from an OO mindset to a functional one. I’ve had several jaw-dropping moments along my learning path and I hope to share my experiences and enthusiasm with others.

Audience: Beginner

All talks are available in the Elixir Conf 2017 Talks List or via the elixirconf2017 tag

Most Liked

tjstankus

tjstankus

Guilty as charged. :slight_smile: It’s hard not to talk shop and teach with her as much as I do and not be strongly influenced by her ideas and presentation style.

JEG2

JEG2

Author of Designing Elixir Systems with OTP

I completely understand that. Sandi is terrific. I keep hoping she’ll try Elixir someday! :slight_smile:

JEG2

JEG2

Author of Designing Elixir Systems with OTP

I could definitely tell that this talk was done by someone who has taught with Sandi Metz. It sounded like her at times.

tjstankus

tjstankus

@JEG2 I’m working on it. :slight_smile: Actually, she’s been learning Elm as I’ve been learning Elixir. We’ve had some great conversations about the mindset transition from OOP to functional. Hopefully there will be some great material/talks coming out of those conversations.

axelson

axelson

Scenic Core Team

@tjstankus Nice use-case study of an OOP vs functional solution. It was nice to be able to go over the two solutions in detail. Nice talk :thumbsup:

Where Next?

Popular in Talks Top

axelson
ElixirConf 2017 - Elixir as a first language - Alexis Huefner What would it be like to use Elixir as your fi...
New
axelson
by @girlsleuth Whether you call it UI testing, End-to-End Testing, End-to-User Testing, or Acceptance Testing–it is often an intensely ...
New
New
axelson
ElixirConf 2017 - Working with legacy databases in Ecto - @geo Often when starting an Elixir or Phoenix proj...
New
axelson
We’re now on the day 2 talks! ElixirConf US 2018 – Understanding Elixir’s (Re)compilation – Renan Ranelli Elixir’s code...
New
brightball
Since the comments are turned off on the YouTube videos, I'm going to post on talk per day on here for viewing and discussion...starting ...
New
axelson
Hey folks, beginning to post today’s round of ElixirConf videos! ElixirConf US 2018 – Elixir at a Walking Pace – Lance Halvorsen (@lance...
New
axelson
ElixirConf 2017 - Building an Open Source, Real Time Forum with Phoenix and Elm - @knewter There’s a lot of ...
New
AstonJ
Keywords: LiveView autocomplete, LiveView search, focus Startups and web developers take note. Phoenix LiveView is the revolutionary fr...
New
AstonJ
Day 1 ElixirConf 2017 - Day 1 Keynote - Justin Schneck (Discussion thread) ElixirConf 2017 - My Journey from Go to Elixir - Veronica L...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

We're in Beta

About us Mission Statement