FelixFortis

FelixFortis

Designing Elixir Systems with OTP: Explain the Quiz application more fully up front before getting too granular

Preface

I’m finding this to be a wonderful book that has taught me a lot so far, and I do understand that the core purpose of the book is to communicate to the reader the main design patterns for OTP in Elixir, and not to hand-hold them through an example application tutorial.

Having said that, the irony of the following isn’t lost on me :slight_smile:

Problem

The app we are building is described in Start with the right data layer > Try it out > Break Nouns into Data Structures:

In our quiz project, we can have templates in various categories that create questions. For an example, a template for a simple addition problem may be <%= left %> + <%= right %> with [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] being valid values for left and right. This means a quiz might generate 3 + 2 or 0 + 0. As we ask questions, we track the user’s responses and we keep generating questions until our user masters the template. Once they get three in a row right, we’ll let them move on to the next category.

Which I found to be abrupt, too shallow and relatively impenetrable. Consequently, I’m finding the Build a Functional Core section quite hard to follow.

For example, where did these nouns spring from? There was no high level explanation allowing you to wonder what nouns you might come up with on your own, or how you might build the app based on your own experience thus far. There was no opportunity to engage with the content - it was just force fed to the reader.

And the app itself - Is it a CLI? A desktop or browser based app? Who is the user? How will they actually use it? Are they typing in arguments and clicking generate? How are these templates generated? Will the app be pre-loaded with templates or are the questions user generated? Is a ‘template’ a Phoenix-style EEx template or just domain language for this application? I’m floating around without any context here.

I feel like the section is focusing so hard on design patterns that it’s neglecting necessary context and the big picture of the application that we’re building. It leaves me copying out the code and filling out the module functions but not understanding why. Is it working? How should I know? If its not working, why not? If Elixir has made breaking changes, how can I tweak my code to get it working if I don’t understand, at a high level, what that code is trying to do?

Suggestion

The reader needs a place to go back to from time to time where a detailed, high level explanation is provided, so they can zoom out from the nitty-gritty and reacquaint themselves with what this all means for the user and for the application as a whole.

Please flesh out the initial explanation of the app in writing. A wire-frame or user flow diagram could be included. Intermittent IEX sessions could be included between code examples to keep us grounded in what we are trying to build (okay, now we’ve written these functions, let’s go into IEX and see what a user can do, and also see both the app and our design pattern in action).

TL;DR

Following along with Build a Functional Core reminds me of unit testing without integration testing but for my brain. Some integration explanation as well as unit explanation please!

Where Next?

Popular Pragmatic Bookshelf topics Top

yulkin
your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=&gt; (create-...
New
mikecargal
Title: Hands-On Rust (Chap 8 (Adding a Heads Up Display) It looks like ​.with_simple_console_no_bg​(SCREEN_WIDTH*2, SCREEN_HEIGHT*2...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
nicoatridge
Hi, I have just acquired Michael Fazio’s “Kotlin and Android Development” to learn about game programming for Android. I have a game in p...
New
brunogirin
When trying to run tox in parallel as explained on page 151, I got the following error: tox: error: argument -p/–parallel: expected one...
New
akraut
The markup used to display the uploaded image results in a Phoenix.LiveView.HTMLTokenizer.ParseError error. lib/pento_web/live/product_l...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
roadbike
From page 13: On Python 3.7, you can install the libraries with pip by running these commands inside a Python venv using Visual Studio ...
New
dachristenson
I’ve got to the end of Ch. 11, and the app runs, with all tabs displaying what they should – at first. After switching around between St...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
AstonJ
I’ve been hearing quite a lot of comments relating to the sound of a keyboard, with one of the most desirable of these called ‘thock’, he...
New
AstonJ
Just done a fresh install of macOS Big Sur and on installing Erlang I am getting: asdf install erlang 23.1.2 Configure failed. checking ...
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
New
PragmaticBookshelf
Programming Ruby is the most complete book on Ruby, covering both the language itself and the standard library as well as commonly used t...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
New
PragmaticBookshelf
Develop, deploy, and debug BEAM applications using BEAMOps: a new paradigm that focuses on scalability, fault tolerance, and owning each ...
New

Sub Categories: