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

brianokken
Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New
ianwillie
Hello Brian, I have some problems with running the code in your book. I like the style of the book very much and I have learnt a lot as...
New
mikecargal
Title: Hands-On Rust (Chapter 11: prefab) Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
jskubick
I think I might have found a problem involving SwitchCompat, thumbTint, and trackTint. As entered, the SwitchCompat changes color to hol...
New
digitalbias
Title: Build a Weather Station with Elixir and Nerves: Problem connecting to Postgres with Grafana on (page 64) If you follow the defau...
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
Charles
In general, the book isn’t yet updated for Phoenix version 1.6. On page 18 of the book, the authors indicate that an auto generated of ro...
New
New
creminology
Skimming ahead, much of the following is explained in Chapter 3, but new readers (like me!) will hit a roadblock in Chapter 2 with their ...
New

Other popular topics Top

Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
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
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New

Sub Categories: