By Developers, For Developers

Historical errata for Adopting Elixir

PDF PgPaper PgTypeDescriptionFixed onComments
53TYPO

{:excoveralls, “~> 0.7.4”, only [:test] runtime: false},

missing : after only
missing , after [:test]

2017-11-21
xiiTYPO

“In some teams, the folks that write the code are the same ones that deploy and support it in productions.”

Change “productions” to “production”.

2017-11-21
44ERROR

“…
Both inputs and the output might be of type integer(), so your typespec would
look like this:
@spec add(integer(), integer()) :: map
def add(x, y), do: x + y
…”

Expected typespec:
@spec add(integer(), integer()) :: integer()

2017-11-21
41TYPO

…
As you can guess, it works like this:
iex(1)> BeliefStructure.hexify(“warden”) "warden_ex
…

Missing closed quotation mark

2017-11-21
50TYPO

…

## Examples
iex> BeliefStructure.package(“math_ex”) “math_ex”
iex> BeliefStructure.package(“math_ex”) “math_ex”
…

Duplicated example

2017-11-21
194TYPO

The grammar is somewhat off in:

“After seeing early success with Elixir, specifically in creating an incredibly scalable chat feature and seeing Ruby engineers pick up the language, we felt both were worthwhile risks to take on and decided moved forward with the acquisition. ”

2017-11-21
205TYPO

perspective changed in single sentence (they, our):

“icanmakeitbetter didn’t stop working on the Elixir migration, but the focus was divided across some features they needed to build to stay competitive and maintain our growth”

2017-11-21
3319TYPO

Missing space in beginning of second paragraph:

“Imagine this.You’ve ”

2017-11-21
4026TYPO

space before full stop

" so let’s cover two topics . Since we’re Elixir"

2017-11-21
5743TYPO

2nd paragraph. Fonts are off. mix credo –ignore moduledoc should be monospaced and the following sentence should be in normal typeface again.

2017-11-21
6248TYPO

This sentence is somewhat off..

“Dialyzer does require an explicit step to run and the cryptic errors so it an acquired taste, but if you tend to like the safety types can provide, typespecs with Dialyxer may provide just enough support for you.”

2017-11-21
7384TYPO

Missing word in

“you only care that knows how to split(”/“).”

2017-11-21
8495SUGGEST

The supervision example uses direct specification of the spec, that is, it uses

worker(PathAllocator, [])

instead of

{PathAllocator, []}

or simply

PathAllocator

together with a child_spec method within PathAllocator.

2017-11-21We are targeting earlier Elixir versions in this book but in a future revision we will likely move to the latest API. Thank you!
8495ERROR

The example speaks of adding

Process.flag(:trap_exit,true)

to the init function but does not actually do it.

2017-11-21
9685TYPO

“If you are working on an application that talks to a database, it its supervision tree probably starts a process that connects to the database. ”

“it” should be removed

2017-11-21
10090SUGGEST

In the explanation of cookies you write:

“It’s not a browser cookie; it’s simply an atom for security that’s a unique identifier”

As far as I understand, by default the Erlang VM does not protect inter node communication, i.e., encrypt and authenticate the communication between nodes. Thus, anyone listening in can easily extract the cookie and then connect to a system. In my understanding the cookie is thus more of an organizational feature (run disjoint clusters) than a security feature. In particular, clusters should not be used over insecure connections without adding additional measures (e.g. enabling TLS for BEAMs communication). I would suggest to either add some explanation as to what security guarantees are given or to not sell the cookie as a security feature as readers may jump to false conclusions.

2017-11-21
10999TYPO

“as the rate of registrations become quite limited when the number of nodes grown”

grown -> grows

2017-11-21
82SUGGEST

Maybe describe the points of when to use a GenServer earlier than quite directly after starting a section about not using GenServers. When skimming through the page this might lead to misunderstanding.

2017-11-21
124115TYPO

" ones designed especially for for running NIFs"

for for

2017-11-21
119TYPO

In sentence: We can also data from the port, which is “hello\
”

Should be "We can also GET data from the port….

2017-11-21
121OK

You will want to take measures to make sure your processes terminate cleanly.

Should be: You will want to take MEASUREMENTS…

2017-11-21I think we mean measures, as in take actions.
125TYPO

If you need to run multiple Java nodes, you will have to decide how to you load-balance them from Elixir

Should be: … you will have to decide how to load-balance them…

Remove the “you” in between “how” and “load”

2017-11-21
134TYPO

…you can chose the proper Logger…

chose -> choose

…Unfortunately the mix run command can’t receive…

missing comma after `Unfortunately`

2017-11-21
23TYPO

…In this section, let’s see how the Bleacher Report team was able to break through the concept of “functions tranform data” and the importance of managing expectations along the way.

Replace “tranform” with “transform”

2017-12-02
22SUGGEST

“Kevin Durant, the most famous basketball player of our time.”

Lebron has held this title for much of the past decade.

How about: “Kevin Durant, one of the best basketball players in the world.”

2017-12-02
170SUGGEST

Link 17 should point to the actual article theerlangelist.com/article/phoenix_latency
instead of just theerlangelist.com

2017-12-02
67TYPO

Simple typo error where a colon is missing.

Currenty is:
{:excoveralls, “~> 0.7.4”, only [:test], runtime: false},

Should be:
{:excoveralls, “~> 0.7.4”, only: [:test], runtime: false},

2017-12-02
59TYPO

It is written Dialyxer. Should be Dialyxir.

2018-02-19
59TYPO

I am not sure it is a typo:
“Let’s give Dialyzer a try in the same hexify project from the previous section.”
Should it be
“Let’s give Dialyxir a try in the same hexify project from the previous section.”
??

2018-02-19
140TYPO

“as bin/sample start or fetch the tar.gaz file” has a typo in extension, it should be “tar.gz”

2018-02-19
73ERROR

At least with Elixir 1.5.1, Task.async/1 returns just the task, and not a {:ok, task} tuple.

2018-02-19
123ERROR

When adding dialyxir to deps, if you wish the ensure_consistency alias introduced on page 132 to work, I think the dialyxir dep has to also be available in the :test environment. Also, ensure_consistency needs to be run with MIX_ENV=test, I’m pretty sure, otherwise the `test task will complain about being run in a non-test environment.

2018-02-19
73TYPO

Last paragraph:

“They can be compiled, tested and deployed separatedly.”

Should read “separately”

2018-02-19
92TYPO

“If your goal is [to] build truly independent and isolated subsystems,”

missing the “to”

2018-02-19
84SUGGEST

Towards the bottom: “The client uses a JSON parser called HTTPoison”

Should probably read “HTTP client” or similar instead of “JSON parser”.

2018-02-19
234TYPO

FROM:
“were worthwhile risks to take on and decided moved forward”
TO:
“were worthwhile risks to take on and decided to move forward”

2018-02-18
11SUGGEST

“This project, though, shows a simplification of the development stack and better
development buy-in, it reduced the costs of feature development and made
it easier to bring in new staff when it’s necessary.”

The flow of ‘it reduced’ seems to start a new sentence, but follows a comma.

2018-02-21
21SUGGEST

“If you’d like to take the same approach, you have several good books to choose
from, and the Elixir website is a good start when looking up for Elixir
resources.1”

Using ‘up for’ seems an odd combination. Using either ‘looking up’ or ‘looking for’ might be better.

2018-02-21
23SUGGEST

Change Type: comma
BEFORE: When we say “functions transform data” what do we mean?
AFTER: When we say “functions transform data,” what do we mean?

24SUGGEST

Change Type: commas
BEFORE: Eventually they found themselves scattering conditionals around the code to manage the different types and depending on heuristics that often failed.
AFTER: Eventually they found themselves scattering conditionals around the code to manage the different types and, depending on heuristics, that often failed.

24SUGGEST

Change Type: comma
BEFORE: With changesets you validate and modify the data through a series of functions.
AFTER: With changesets, you validate and modify the data through a series of functions.

25SUGGEST

Change Type: split sentence, remove comma
BEFORE: Developers who were learning Elixir could quickly add a new content type; it inspired confidence, and it was discrete functionality that the developer could see in the app.
AFTER: Developers who were learning Elixir could quickly add a new content type. It inspired confidence and it was discrete functionality that the developer could see in the app.

25SUGGEST

Change Type: comma
BEFORE: This is just one example but these are the ways in which you can build your team.
AFTER: This is just one example, but these are the ways in which you can build your team.

88TYPO

Beta 4—Jan 16, 2017?
Beta 4—Jan 16, 2018?

2018-03-02
54TYPO

“coveralls.post”: :test,
“coveralls.html”: :test,
],
test_coverage: [tool: ExCoveralls],

The final entry in the list `“coveralls.html”: :test, contains a superfluous comma. If you were to run Mix format % it would be correctly removed. This is not a compiler issue, but just be good to ensure the code snippets reflect the Mix Format standard ;D Awesome book, loving it.

151ERROR

Example command for heart should not have “\\” at the end in command

elixir —erl “-heart” -e “Enum.map Stream.interval(1000), &IO.puts/1” \\
heart_beat_kill_pid = 48495

since the part “heart_beat_kill_pid = 48495” is output of the command.
The command appears in two listings on this page.

178SUGGEST

In the EctoInspector module log function uses IO.inspect and then returns log

def log(log) do
IO.inspect(log)
log
end

This is technically correct, but IO.inspect returns its input without modification anyway, so I would suggest to change it to just:

def log(log) do
IO.inspect(log)
end

It would probably require to also change the explaining part from “Then, we’ll just return it without modification.” to “IO.inspect returns its argument without modification, so our log function will also return the log without modifying it.”

24TYPO

Code example uses `data |> …`, should be `post |> …`

134TYPO

In the Packets section:
“● :nouse_stdio uses file descriptions 3 and 4 […]” should be “[…] file descriptors […]”.

131TYPO

3rd paragraph starts with “he Nerves team follow …”. Should be “The Nerves team…”

137TYPO

“You can use libraries such as poolboy12 to start a certain amount of processes …” should be “… a certain number of processes …”

“Amount” is used with uncountable nouns. “Number” is used with countable.

185ERROR

One of the suggested ways of increasing performance is to increase the number of keepalive requests. At the end of this section, the text says this can be done by setting protocol_options: [max_keepalive: 5_000_000] under :http options in the lib/demo_web/endpoint.ex.

This should probably actually be done in the config/prod.exs file:

config :demo, DemoWeb.Endpoint,
[…],
http: [port: 4040,
protocol_options: [max_keepalive: 5_000_000]
]

185ERROR

I think the file should be prod.exs, and not endpoint.ex.

“You can increase this limit by setting protocol_options: [max_keepalive: 5_000_000] under the :http options in the lib/demo_web/endpoint.ex file.”

Source: theerlangelist.com/article/phoenix_latency

91TYPO

The very last sentence on that page “Run iex counter.ex and then try this:” The source file counter.ex doesn’t exists. It should be “counter_3.ex”.

132SUGGEST

The first example in section “All-Caps I/O Program”, identified as “external_code/port_1/all_caps.exs” uses a for comprehension to loop over a file and output lines of text uppercased. However, the comprehension builds a list in memory, so it is wasteful to use it to print lines, because in addition to generating output it is building a data structure in memory, which will not be used for anything. Isn’t that a bad example of Elixir usage? Did I miss something?

132SUGGEST

The first example in section “All-Caps I/O Program”, identified as “external_code/port_1/all_caps.exs” uses a for comprehension to loop over a file and output lines of text uppercased. However, the comprehension builds a list in memory, so it is wasteful to use it to print lines, because in addition to generating output it is building a list in memory, which will not be used for anything. Isn’t that is a bad example of Elixir usage? Did I miss somethig?

Categories: