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

jimschubert
In Chapter 3, the source for index introduces Config on page 31, followed by more code including tests; Config isn’t introduced until pag...
New
Razor54672
The answer to 3rd Problem of Chapter 5 (Making Choices) of “Practical Programming, Third Edition” seems incorrect in the given answer ke...
New
sdmoralesma
Title: Web Development with Clojure, Third Edition - migrations/create not working: p159 When I execute the command: user=&gt; (create-...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
New
brunogirin
When I run the coverage example to report on missing lines, I get: pytest --cov=cards --report=term-missing ch7 ERROR: usage: pytest [op...
New
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
tkhobbes
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New
davetron5000
Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
New

Other popular topics Top

PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
PragmaticBookshelf
Author Spotlight Rebecca Skinner @RebeccaSkinner Welcome to our latest author spotlight, where we sit down with Rebecca Skinner, auth...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File &gt; New Rule: And select Deny, O...
New
husaindevelop
Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New

Sub Categories: