Deserialization Tutorial
Deserialization Tutorial
CREATOR OF ARDUINOJSON
Mastering ArduinoJson
Efficient JSON serialization for embedded C++
Contents
Acknowledgments ii
Contents iii
1 Introduction 1
1.1 About this book . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Introduction to JSON . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 What is JSON? . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 What is serialization? . . . . . . . . . . . . . . . . . . . 4
1.2.3 What can you do with JSON? . . . . . . . . . . . . . . 4
1.2.4 History of JSON . . . . . . . . . . . . . . . . . . . . . . 6
1.2.5 Why is JSON so popular? . . . . . . . . . . . . . . . . . 6
1.2.6 The JSON syntax . . . . . . . . . . . . . . . . . . . . . 7
1.2.7 Binary data in JSON . . . . . . . . . . . . . . . . . . . 11
1.3 Introduction to ArduinoJson . . . . . . . . . . . . . . . . . . . 12
1.3.1 What ArduinoJson is . . . . . . . . . . . . . . . . . . . 12
1.3.2 What ArduinoJson is not . . . . . . . . . . . . . . . . . 12
1.3.3 What makes ArduinoJson different? . . . . . . . . . . . 13
1.3.4 Does size really matter? . . . . . . . . . . . . . . . . . . 14
1.3.5 What are the alternatives to ArduinoJson? . . . . . . . . 16
1.3.6 How to install ArduinoJson . . . . . . . . . . . . . . . . 17
1.3.7 The examples . . . . . . . . . . . . . . . . . . . . . . . 22
6 Troubleshooting 163
6.1 Program crashes . . . . . . . . . . . . . . . . . . . . . . . . . . 164
6.1.1 Undefined Behaviors . . . . . . . . . . . . . . . . . . . . 164
6.1.2 A bug in ArduinoJson? . . . . . . . . . . . . . . . . . . 164
6.1.3 Null string . . . . . . . . . . . . . . . . . . . . . . . . . 165
6.1.4 Use after free . . . . . . . . . . . . . . . . . . . . . . . 165
6.1.5 Return of stack variable address . . . . . . . . . . . . . 167
6.1.6 Buffer overflow . . . . . . . . . . . . . . . . . . . . . . 169
6.1.7 Stack overflow . . . . . . . . . . . . . . . . . . . . . . . 170
6.1.8 How to detect these bugs? . . . . . . . . . . . . . . . . 171
6.2 Deserialization issues . . . . . . . . . . . . . . . . . . . . . . . 173
6.2.1 A lack of information . . . . . . . . . . . . . . . . . . . 173
6.2.2 Is input valid? . . . . . . . . . . . . . . . . . . . . . . . 174
6.2.3 Is the JsonBuffer big enough? . . . . . . . . . . . . . . 174
6.2.4 Is there enough RAM? . . . . . . . . . . . . . . . . . . 175
6.2.5 How deep is the document? . . . . . . . . . . . . . . . . 177
6.2.6 The first deserialization works? . . . . . . . . . . . . . . 177
Contents ix
8 Conclusion 241
Index 242
Chapter 3
Deserialize with ArduinoJson
Now that you’re familiar with JSON and C++, we’re going learn how to use
ArduinoJson. This chapter explains everything there is to know about deserial-
ization. As we’ve seen, deserialization is the process of converting a sequence
of byte into a memory representation. In our case, it means converting a JSON
document to a hierarchy of C++ structures and arrays.
In this chapter, we’ll use a JSON response from Yahoo
Query Language (YQL) as an example. YQL is a
web service that allows fetching data from the web in
a SQL-like syntax. It is very versatile and can even
retrieve data outside of the Yahoo realm. Here are
some examples of what you can do with YQL:
• download weather forecast (we’ll do that in this
chapter)
• download market data
• scrap web pages via XPath or CSS selectors
• read RSS feeds
• search the web
• search on a map
For most applications, you don’t need to create an account.
For our example, we’ll use a 3-day weather forecast of the city of New York.
We’ll begin with a simple program, and add complexity one bit at a time.
Chapter 3 Deserialize with ArduinoJson 57
Let’s begin with the most simple situation: a JSON document in memory. More
precisely, our JSON document resides in the stack in a writable location. This
fact is going to matter, as we will see later.
Our example is today’s weather forecast for the city of New York:
{
"date": "08 Nov 2017",
"high": "48",
"low": "39",
"text": "Rain"
}
As you see, it’s a flat JSON document, meaning that there is no nested object
or array.
It contains the following piece of information:
1. date is the date for the forecast: November 8th, 2017
2. high is the highest temperature of the day: 48°F
3. low is the highest temperature of the day: 39°F
4. text is the textual description of the weather condition: “Rain”
There is something quite unusual with this JSON document: the integer values
are actually strings. Indeed, if you look at the high and low values, you can see
that they are wrapped in quotes, making them strings instead of integers. Don’t
worry, it is a widespread problem, and ArduinoJson handles it appropriately.
Chapter 3 Deserialize with ArduinoJson 58
In the previous chapter, we saw that this code creates a duplication of the string
in the stack. We know it is a code smell in production code, but it’s a good
example for learning. This unusual construction allows getting an input string
that is writable (i.e., not read-only), which is important for our first contact
with ArduinoJson.
When you create a JsonBuffer, you must specify its capacity in bytes.
In the case of DynamicJsonBuffer, you set the capacity via a constructor argu-
ment:
DynamicJsonBuffer jb(capacity);
As it’s a parameter of the constructor, you can use a regular variable, whose
value can be computed at run-time.
In the case of a StaticJsonBuffer, you set the capacity via a template parame-
ter:
StaticJsonBuffer<capacity> jb;
As it’s a template parameter, you cannot use a variable. Instead, you must use
a constant, which means that the value must be computed at compile-time. As
we said in the previous chapter, the stack is managed by the compiler, so it
needs to know the size of each variable when it compiles the program.
Now comes a tricky question for every new user of ArduinoJson: what should
be the capacity of my JsonBuffer?
To answer this question, you need to know what ArduinoJson will store in the
JsonBuffer. ArduinoJson needs to store a tree of data structures that mirrors the
hierarchy of objects in the JSON document. In other words, it contains objects
describing the JSON document and these objects are linked one to another, in
the same way as they are in the JSON document.
Therefore, the capacity of the JsonBuffer highly depends on the complexity
of the JSON document. If it’s just one object with few members, like our
example, a few dozens of bytes are enough. If it’s a massive JSON document,
like WeatherUnderground’s response, up to a hundred kilobytes are needed.
ArduinoJson provides macros for computing precisely the capacity of the JSON
buffer. The macro to compute the size of an object is JSON_OBJECT_SIZE(). Here
Chapter 3 Deserialize with ArduinoJson 60
is how to compute the capacity of our JSON document composed of only one
object containing four elements:
Now that the JsonBuffer is ready, we can parse the input. To parse an object,
we just need to call JsonBuffer::parseObject():
if (obj.success()) {
// parseObject() succeeded
} else {
// parseObject() failed
}
ArduinoJson is not very verbose when parsing fails: the only clue is this boolean.
This design was chosen to make the code small and prevent users from bloating
their code with error checking. If I were to make that decision today, the outcome
would probably different.
However, there are a limited number of reasons why parsing could fail. Here are
the three most common causes, by order of likelihood:
1. The input is not a valid JSON document.
2. The JsonBuffer is too small.
Chapter 3 Deserialize with ArduinoJson 62
Ü More on arduinojson.org
For an exhaustive list of reasons why parsing could fail, please refer
to this question in the FAQ: “Why parsing fails?”
Chapter 3 Deserialize with ArduinoJson 63
There are multiple ways to extract the values from a JsonObject; we’ll see all of
them.
Here is the first and simplest syntax:
Not everyone likes implicit casts, mainly because it messes with parameter type
deduction and with the auto keyword.
We saw how to extract values from an object, but we didn’t do error checking;
now let’s talk about what happens when a value is missing.
When that happens, ArduinoJson returns a default value, which depends on the
type:
The two last lines (JsonArray and JsonObject) happen when you extract a nested
array or object, we’ll see that in a later section.
` No exceptions
ArduinoJson never throws exceptions. Exceptions are an excellent
C++ feature, but they produce large executables, which is unaccept-
able for embedded programs.
Sometimes, the default value from the table above is not what you want. In
this situation, you can use the operator | to change the default value. I call it
the “or” operator because it provides a replacement when the value is missing
or incompatible. Here is an example:
This feature is handy to specify default configuration values, like in the snippet
above, but it is even more useful to prevent a null string from propagating. Here
is an example:
char hostname[32];
const char* configHostname = config["hostname"];
if (configHostname != nullptr)
strlcpy(hostname, configHostname, 32);
else
strcpy(hostname, "arduinojson.org");
This syntax is new in ArduinoJson 5.12, and it’s only available when you use
the subscript syntax ([]). We’ll see a complete example in the case studies.
Chapter 3 Deserialize with ArduinoJson 67
The first thing we can do is look at all the keys and their associated values. In
ArduinoJson, a key-to-value association, or a key-value pair, is represented by
the type JsonPair.
We can enumerate all pairs with a simple for loop:
JsonObject::iterator it;
for (it=obj.begin(); it!=obj.end(); ++it) {
it->key // is a const char* pointing to the key
it->value // is a JsonVariant
}
// Is it a string?
if (p.value.is<char*>()) {
// Yes!
// We can get the value via implicit cast:
const char* s = p.value;
// Or, via explicit method call:
auto s = p.value.as<char*>();
}
If you use this with our JSON document from Yahoo Weather, you will find
that all values are strings. Indeed, as we said earlier, there is something special
about this example: integers are wrapped in quotes, making them strings. If
you remove the quotes around the integers, you will see that the corresponding
JsonVariants now contain integers instead of strings.
Chapter 3 Deserialize with ArduinoJson 69
obj["low"].is<int>();
obj.is<int>("low");
Here too, the two statements are equivalent and produce the same
executable.
There are a limited number of types that a variant can use: boolean, integer,
float, string, array, object. However, different C++ types can store the same
JSON type; for example, a JSON integer could be a short, an int or a long in
the C++ code.
The following table shows all the C++ types you can use as a parameter for
JsonVariant::is<T>() and JsonVariant::as<T>().
` More on arduinojson.org
The complete list of types that you can use as a parameter for
JsonVariant::is<T>() can be found in the API Reference.
Chapter 3 Deserialize with ArduinoJson 70
If you have an object and want to know whether a key exists in the object, you
can call containsKey().
Here is an example:
However, I don’t recommend using this function because you can avoid it most
of the time.
Here is an example where containsKey() can be avoided:
The code above is not horrible, but it can be simplified and optimized if we just
remove the call to containsKey():
This code is faster and smaller because it only looks for the key “error” once
(whereas the previous code did it twice).
Chapter 3 Deserialize with ArduinoJson 71
We’ve seen how to parse a JSON object from a Yahoo Weather forecast; it’s
time to move up a notch by parsing an array of object. Indeed, the weather
forecast comes in sequence: one object for each day.
Here is our example:
[
{
"item": {
"forecast": {
"date": "09 Nov 2017",
"high": "53",
"low": "38",
"text": "Mostly Cloudy"
}
}
},
{
"item": {
"forecast": {
"date": "10 Nov 2017",
"high": "47",
"low": "26",
"text": "Breezy"
}
}
},
{
"item": {
"forecast": {
"date": "11 Nov 2017",
"high": "39",
"low": "24",
Chapter 3 Deserialize with ArduinoJson 72
This document is not as straightforward as one would hope but it’s not that
complicated either. Furthermore, it perfectly illustrates a problem that many
ArduinoJson use encounter: the confusion between object and array.
` Optimized cross-product
With Yahoo Weather, it’s possible to pass an extra parameter to
change the layout of the array to match our initial expectation. This
parameter is crossProduct=optimized. However, if we use it, we lose
the ability to limit the number of days in the forecast and we take
the risk of having a response that is too big for our ATmega328. We
could get along with that, as we’ll see in the case studies, but I want
to keep things simple for your first contact with ArduinoJson.
// Parse succeeded?
if (arr.success()) {
// Yes! We can extract values.
} else {
// No!
// The input may be invalid, or the JsonBuffer may be too small.
}
As said earlier, an hard-coded input like this would never happen in production
code, but it’s a good step for your learning process.
You can see that the expression for computing the capacity of the JsonBuffer is
quite complicated:
• There is one array of three elements: JSON_ARRAY_SIZE(3)
• In this array, there are three objects of one element:
3*JSON_OBJECT_SIZE(1)
Chapter 3 Deserialize with ArduinoJson 74
You just need to paste your JSON document in the box on the left, and the
Assistant will return the expression in the box on the right. Don’t worry, the
Assistant respects your privacy: it computes the expression locally in the browser;
it doesn’t send your JSON document to a web service.
Chapter 3 Deserialize with ArduinoJson 75
The process of extracting the values from an array is very similar to the one for
objects. The only difference is that arrays are indexed by an integer, whereas
objects are indexed by a string.
To get access to the forecast data, we need to unroll the nested objects. Here
is the code to do it, step by step:
And we’re back to the JsonObject with four elements: date, low, high and text.
This subject was entirely covered in the previous selection, so there is no need
to repeat.
Fortunately, it’s possible to simplify the program above with just a single line:
It may not be obvious, but the two programs above use implicit casts. Indeed,
the return value of the subscript operator ([]) is a JsonVariant; the JsonVariant
is then implicitly converted to a JsonObject&.
Chapter 3 Deserialize with ArduinoJson 76
Again, some programmers don’t like implicit casts, that is why ArduinoJson offer
an alternative syntax with as<T>(). For example:
All of this should sound very familiar because as it’s the same as objects.
When we learned how to extract values from an object, we saw that, if a member
is missing, a default value is returned (for example 0 for an int). It is the same
if you use an index that is out of the range of the array.
Now is a good time to see what happens if a complete object is missing. For
example:
The index 666 doesn’t exist in the array, so a special value is returned:
JsonObject::invalid(). It’s a special object that doesn’t contain anything and
whose success() method always returns false:
Our example was very straightforward because we knew that the JSON array
had precisely three elements and we knew the content of these elements. In this
section, we’ll see what tools are available when the content of the array is not
known.
If you know absolutely nothing about the input, which is strange, you need to
determine a memory budget allowed for parsing the input. For example, you
could decide that 10KB of heap memory is the maximum you accept to spend
on JSON parsing.
This constraint looks terrible at first, especially if you’re a desktop or server
application developer; but, once you think about it, it makes complete sense.
Indeed, your program is going to run in a loop, always on the same hardware,
with a known amount of memory. Having an elastic capacity would just produce
a larger and slower program with no additional value.
However, most of the time, you know a lot about your JSON document. Indeed,
there is usually a few possible variations in the input. For example, an array
could have between zero and four elements, or an object could have an optional
member. In that case, use the ArduinoJson Assistant to compute the size of
each variant, and pick the biggest.
The first thing you want to know about an array is the number of elements it
contains. This is the role of JsonArray::size():
Remark that JsonObject also has a size() method returning the number of
key-value pairs, but it’s rarely useful.
3.7.3 Iteration
Now that you have the size of the array, you probably want to write the following
code:
The code above works but is terribly slow. Indeed, a JsonArray is internally
stored as a linked list, so accessing an element at a random location costs O(n);
in other words, it takes n iterations to get to the nth element. Moreover, the
value of JsonArray::size() is not cached, to it needs to walk the linked list
too.
That’s why it is essential to avoid arr[i] and arr.size() in a loop, like in the
example above. Instead, you should use the iteration feature of JsonArray, like
this:
With this syntax, the internal linked list is walked only once, and it is as fast as
it gets.
I used a JsonObject& in the loop because I knew that the array contains objects.
If it’s not your case, you can use a JsonVariant instead.
Chapter 3 Deserialize with ArduinoJson 80
JsonArray::iterator it;
for (it=arr.begin(); it!=arr.end(); ++it) {
JsonObject& elem = *it;
}
To test the type of array elements the same way we did for object values. In
short, we can either use JsonVariant::is<T>() or JsonArray::is<T>().
Here is a code sample with all syntaxes:
// Same in a loop
for (JsonVariant& elem : arr) {
// Is the current element an object?
if (elem.is<JsonObject>()) {
// We called JsonVariant::is<JsonObject>()
}
}
Chapter 3 Deserialize with ArduinoJson 81
3.8.1 Definition
At the beginning of this chapter, we saw how to parse a JSON document that
is writable. Indeed the input variable was a char[] in the stack, and therefore,
it was writable. I told you that this fact would be important, and it’s time to
explain.
ArduinoJson behaves differently with writable inputs and read-only inputs.
When the argument passed to parseObject() or parseArray() is of type char* or
char[], ArduinoJson uses a mode called “zero-copy.” It has this name because
the parser never makes any copy of the input; instead, it will use pointers pointing
inside the input buffer.
In the zero-copy mode, when a program requests the content of a string member,
ArduinoJson returns a pointer to the beginning of the string in the input buffer.
To make it possible, ArduinoJson must inserts null-terminators at the end of
each string; it is the reason why this mode requires the input to be writable.
3.8.2 An example
To illustrate how the zero-copy mode works, let’s have a look at a concrete
example. Suppose we have a JSON document that is just an array containing
two strings:
Chapter 3 Deserialize with ArduinoJson 82
["hip","hop"]
And let’s says that the variable is a char[] at address 0x200 in memory:
After parsing the input, when the program requests the value of the first element,
ArduinoJson returns a pointer whose address is 0x202 which is the location of
the string in the input buffer:
'[' '"' 'h' 'i' 'p' '"' ',' '"' 'h' 'o' 'p' '"' ']' 0
0x200
parseArray()
'[' '"' 'h' 'i' 'p' 0 ',' '"' 'h' 'o' 'p' 0 ']' 0
0x202 0x208
Adding null-terminators is not the only thing the parser modifies in the input
buffer. It also replaces escaped character sequences, like \n by their correspond-
ing ASCII characters.
Chapter 3 Deserialize with ArduinoJson 83
I hope this explanation gives you a clear understanding of what the zero-copy
mode is and why the input is modified. It is a bit of a simplified view, but the
actual code is very similar.
As we saw, in the zero-copy mode, ArduinoJson returns pointers into the input
buffer. So, for a pointer to be valid, the input buffer must be in memory at the
moment the pointer is dereferenced.
If a program dereferences the pointer after the destruction of the input buffer, it
will create an undefined behavior (a UB, in the C++ jargon), which means that
the code may work by accident, but will crash sooner or later.
Here is an example:
// Declare a pointer
const char *hip;
// New scope
{
// Declare the input in the scope
char input[] = "[\"hip\",\"hop\"]";
// Parse input
JsonArray& arr = jb.parseArray(input);
// Save a pointer
hip = arr[0];
}
// input is destructed now
We saw how ArduinoJson behaves with a writable input, and how the zero-copy
mode works. It’s time to see what happens when the input is read-only.
Let’s go back to out previous example except that, this time, we change its type
from char[] to const char*:
As we said in the C++ course, this statement creates a sequence of bytes in the
“globals” area of the RAM. This memory is supposed to be read-only, that’s
why we need to add the const keyword.
Previously, we had the whole string duplicated in the stack, but it’s not the case
anymore. Instead, the stack only contains the pointer input pointing to the
beginning of the string in the “globals” area.
As you saw in the previous section, in the zero-copy mode, ArduinoJson returns
a pointer pointing inside the input buffer. We saw that it has to replace some
characters of the input with null-terminators. But, with a read-only input,
ArduinoJson cannot do that anymore; to return a null-terminated string, it
needs to make copies of "hip" and "hop".
Where do you think the copies would go? In the JsonBuffer of course!
In this mode, the JsonBuffer holds a copy of each string, so we need to increase
its capacity. Let’s do the computation for our example:
1. We still need to store an object with two elements, that’s
JSON_ARRAY_SIZE(2).
2. We have to make a copy of the string "hip", that’s 4 bytes including the
null-terminator.
Chapter 3 Deserialize with ArduinoJson 86
3. And we also need to copy the string "hop", that’s 4 bytes too.
The exact capacity required is:
In practice, you would not use the exact length of the strings; it’s safer to add a
bit of slack, in case the input changes. My advice is to add 10% to the longest
possible string, which gives a reasonable margin.
3.9.3 Practice
Apart from the capacity of the JsonBuffer, we don’t need to change anything
to the program.
Chapter 3 Deserialize with ArduinoJson 87
// A read-only input
const char* input = "[\"hip\",\"hop\"]";
const char* is not the only type you can use. It’s possible to use a String:
It’s also possible to use a Flash string, but there is one caveat. As we said
in the C ++ course, ArduinoJson needs a way to figure out if the input string
is in RAM or Flash. To do that, it expects a Flash string to have the type
const __FlashStringHelper*. So, if you declare a char[] PROGMEM, it will not be
considered as Flash string by ArduinoJson. You either need to cast it to const
__FlashStringHelper* or use the F() macro:
Chapter 3 Deserialize with ArduinoJson 88
In the next section, we’ll see another kind of read-only input: streams.
Chapter 3 Deserialize with ArduinoJson 89
In the Arduino jargon, a stream is a volatile source of data, like a serial port. As
opposed to a memory buffer, which allows reading any bytes at any location, a
stream only allows to read one byte at a time and cannot go back.
This concept is materialized by the Stream abstract class. Here are examples of
classes derived from Stream:
Ü std::istream
In the C++ Standard Library, an input stream is represented by the
class std::istream.
ArduinoJson can use both Stream and std::istream.
// Open file
File file = SD.open("weather.txt");
// Print weather
Serial.println(forecast["date"].as<char*>());
Serial.println(forecast["text"].as<char*>());
Serial.println(forecast["high"].as<int>());
Serial.println(forecast["low"].as<int>());
}
You can find the complete source code for this example in the folder
ReadFromSdCard of the zip file.
You can apply the same technique to read a file on an ESP8266, as we’ll see in
the case studies.
Now is the time to parse the real data coming from Yahoo Weather server.
Chapter 3 Deserialize with ArduinoJson 91
Yahoo services use a custom language named “YQL” to perform a query. Care-
fully crafting the query allows to retrieve only the information we need, and
therefore reduces the work of the microcontroller.
In our case the query is:
select item.forecast.date,
item.forecast.text,
item.forecast.low,
item.forecast.high
from weather.forecast(3)
where woeid=2459115
This query asks for the weather forecast of the city of New York (woeid=2459115)
and limits the results to three days (weather.forecast(3)). As we don’t need all
forecast data, we only select relevant columns: date, text, low and high.
The YQL query is passed as an HTTP query parameters, here is the (shortened)
URL we need to fetch:
http://query.yahooapis.com/v1/public/yql?q=select%20item.forecast...
HTTP/1.0 200 OK
Content-Type: application/json;charset=utf-8
Date: Tue, 14 Nov 2017 09:57:39 GMT
{"query":{"count":3,"created":"2017-11-14T09:57:39Z","lang":...
{
"query": {
"count": 3,
"created": "2017-11-14T09:57:39Z",
"lang": "en-US",
"results": {
"channel": [
{
"item": {
"forecast": {
"date": "14 Nov 2017",
"high": "46",
"low": "36",
"text": "Partly Cloudy"
}
}
},
{
"item": {
"forecast": {
"date": "15 Nov 2017",
"high": "47",
"low": "38",
"text": "Mostly Cloudy"
}
}
},
{
"item": {
"forecast": {
"date": "16 Nov 2017",
"high": "52",
"low": "43",
"text": "Partly Cloudy"
}
}
}
]
Chapter 3 Deserialize with ArduinoJson 93
}
}
}
As the class EthernetClient also derives from Stream, we can pass it directly to
parseObject(), just like we did with File.
The following program performs the HTTP request and displays the result in
the console:
// Allocate JsonBuffer
const size_t capacity = JSON_ARRAY_SIZE(3)
+ 8*JSON_OBJECT_SIZE(1)
+ 4*JSON_OBJECT_SIZE(4)
+ 300;
StaticJsonBuffer<capacity> jsonBuffer;
// Parse response
JsonObject& root = jsonBuffer.parseObject(client);
A few remarks:
1. I used HTTP 1.0 instead of 1.1 to avoid Chunked transfer encoding.
2. We’re not interested in the response’s headers, so we skip them using
Stream::find(), placing the reading cursor right at the beginning of the
JSON document.
3. Stream::find() takes a char* instead of a const char*, that’s why we need
to declare endOfHeaders.
4. As usual, I used the ArduinoJson Assistant to compute the capacity of the
JsonBuffer.
You can find the complete source code of this example in the folder YahooWeather
in the zip file. We will see two other weather services in the case studies.
Continue reading...
That was a free chapter from the book Mastering ArduinoJson; I hope you like
it. If so, you may be interested in buying the complete text.
Not only you’ll learn new skills, but you’ll contribute to sustainable open-
source software. By providing a small source of revenue to the author, you
create the incentive that keeps the development running. With this model, you
ensure that the building blocks of your projects stay relevant, so you don’t have
to switch technologies after a few years.
The e-book comes in three formats: PDF, epub and mobi. If you purchase
the e-book, you get access to newer versions for free. A carefully edited
paperback edition is also available.