How to be a Web Developer: A Complete Beginner's Guide on What to Know and Where to Start 1st Edition Radu Nicoara instant download
How to be a Web Developer: A Complete Beginner's Guide on What to Know and Where to Start 1st Edition Radu Nicoara instant download
https://ebookmeta.com/product/how-to-be-a-web-developer-a-
complete-beginners-guide-on-what-to-know-and-where-to-start-1st-
edition-radu-nicoara-2/
https://ebookmeta.com/product/how-to-be-a-web-developer-a-
complete-beginners-guide-on-what-to-know-and-where-to-start-1st-
edition-radu-nicoara/
https://ebookmeta.com/product/how-to-win-client-business-when-
you-dont-know-where-to-start-a-rainmaking-guide-for-consulting-
and-professional-services-1st-edition-fletcher/
https://ebookmeta.com/product/how-to-be-a-complete-bastard-
edmondson/
https://ebookmeta.com/product/nkjv-study-bible-full-color-thomas-
nelson/
A Fractured Infinity 1st Edition Nathan Tavares
https://ebookmeta.com/product/a-fractured-infinity-1st-edition-
nathan-tavares-4/
https://ebookmeta.com/product/sensors-and-probes-for-
bioimaging-1st-edition-young-tae-chang/
https://ebookmeta.com/product/companion-to-the-aisc-steel-
construction-manual-vol-2-design-tables-15th-edition-american-
institute-of-steel-construction/
https://ebookmeta.com/product/teacher-of-the-year-teachers-in-
love-1-1st-edition-m-a-wardell/
https://ebookmeta.com/product/deterministic-numerical-modeling-
of-soil-structure-interaction-1st-edition-stephane-grange/
Research Methods The Basics 3rd Edition Nicholas
Walliman
https://ebookmeta.com/product/research-methods-the-basics-3rd-
edition-nicholas-walliman/
Radu Nicoara
This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
1. Introduction
Radu Nicoara1
(1) Berlin, Germany
Welcome to your journey into the world of web development! Since you
picked up this book, you must have some interest in the domain. That
means that you most likely have what it takes to take your first steps in
the fascinating world of programming. This chapter starts with an
exploration of what web development is, how it works, and how you
can be a part of it.
I wrote this book to explain all the things that I wished I knew
before I started along the path of changing my career to web
development. There were a lot of ups and downs and hiccups along the
way, but to this day I enjoy the process and am constantly learning
something new. And I sincerely hope you will as well.
Common Misconceptions
There are a lot of things that people get wrong about programming in
general, and they revolve mostly around what a programming career
actually means. That is, what you actually do at work.
You must be a whiz at math. In fact, you do not need to be good at
math in order to be a good programmer. I myself was pretty terrible at
math, especially the more complex parts of mathematics, like calculus.
You do not need those things. The only important part is that you can
think logically.
Then, despite what many might say, programming is not boring and
it does not require you to sit in front of a screen all day. In order to be a
good programmer, maybe you just need to code. But to be a great
programmer, you need to build systems that people actually enjoy using
and find valuable. That by definition involves a lot of discussions with
user focus groups, collaboration, and generally being open and talking
to other people. Only this way can you be of great value to your project
and your company. If you do not enjoy talking to people, a programming
career will still fit you, but the extent of how far it can go, and how
productive you can become in it, will unfortunately be limited. You can’t
hide in the backroom and ignore everyone. You need your team’s help,
and they need yours.
That being said, of course, you will spend a lot of time with your
headphones on, focusing on your task, as well as a lot of time working
from home and doing your job. But in order to be great, you need a
decent amount of soft skills and a healthy inclination toward human
interaction.
On another note, you also do not need to memorize all the
commands, and you definitely don’t need to know everything by heart.
Nobody does. The main characteristic that makes you a developer is
being able to split complex tasks into simple structures, which you then
put into if/else statements and for loops. An example of such a logic
structure, written in plain English, is: If the user’s account is disabled,
reject the login process. Or: To each user in the database, send an email.
Imagine programming a piece of code that instructs a car to drive.
You have access to a machine that can only understand left, right,
accelerate, and break. With those four simple commands, you can take a
round-the-world trip. It is the same with when an app. You just need to
know the basic commands.
You are too old/young for this. There is no age that makes you any
better or any worse at programming. This is not sports. As long as you
have some soft skills, and you can learn a bit of coding, you are needed
in the market. That is regardless of your age, sex, religion, or anything
else. I would argue that programming is one of the most inclusive
career paths, because at the end of the day, all that matters is how good
your code is, and how much it helps your end users do the things that
they want to do.
You need a degree in computer science. There is also a great need for
people who have studied other fields. You don’t need to get another
degree. Programming in itself is only a means to an end. At the end of
the day, you will build software that some people will need to perform
their jobs and hopefully will also find useful and intuitive. If you have
knowledge and experience in the field that you are building software
for, you will be almost irreplaceable. I once worked with a young lady
who, before switching to IT, worked in Human Resources. Since we
were building software exactly for this purpose, she quickly became the
go-to person on the project, and the most knowledgeable among us all.
So the more diverse your experience is, the more you can help.
The Downsides
Since I have talked about the interesting parts of the job, and the
common misconceptions, it’s only right to discuss the potential
negative sides of a programming career as well.
You will always have to learn. Programming is one of those jobs
where it is very easy to get stuck out of the loop. There are always new
languages, new frameworks, and new ways of doing things. I would say
that every two-three years you will change one of the ways in which
you are working. Whether that is the frontend, the backend, the
architecture of your app, or where and how you are deploying,
programming means always staying on top of the wave. That might get
tiring at times and can have the potential to erode your self-confidence.
This also means that you will always find somebody who is better
than you. This comparison applies to everyone in the field. IT is such a
large domain, that there cannot be a single person who knows
everything.
You most likely still need some degree. Although it is not absolutely
required, web development is one of those jobs where having a degree
will open many doors for you. But the up side is, as mentioned, you do
not necessarily need to have one in computer science in order to be a
top candidate. A degree in any STEM (Science, Technology, Engineering,
Mathematics) field is usually just as good, and a degree in a more
humanistic domain will still be an advantage. And yes, it is true that you
can still be successful even without a degree. But having one will make
things significantly easier.
Staying on the topic of hiring, although there is a large amount of
open positions in the field, there is also a lot of competition. Maybe not
as much as in other fields, like music or HR, but you definitely won’t be
able to simply march into an interview from your first job application.
You will still need a bit of patience to find a nice job. This, however,
tends to be less of a problem as you progress throughout your career.
After having six-seven years of experience, you will find that you don’t
even need to apply, as you will get unsolicited job offers on a regular
basis.
There are no guarantees. Just because you get into a domain like IT,
or no matter the specialty that you choose, there is no guarantee that
you will automatically earn a good salary, or that you will always find a
remote job. It might be significantly easier, but you will still have to
fight for it. There is also no certification, no degree, and no credentials
that will guarantee a job. You need to be prepared to send about 100
job applications, and go through at least 10 interviews, before you get
an offer. If this happens, just know that you are not doing anything
wrong. You are simply competing against a large number of people. And
the better the job, the bigger the competition. Including the
international one.
You will probably need to start small. Whether that is working in a
startup, or starting from the first level, you will be a junior for a few
years. That might be a bit frustrating, especially if you are switching
careers from a domain where you are already relatively established. I
discuss this a bit more in the later chapters, but you will most likely not
be starting directly into a well-paid job.
I do not want to discourage you in any way by saying this. I just
want to set realistic expectations about the current state of affairs in
the IT job market. If you manage to get through the rough part, you will
find that at the end you will have a fun, well paid career, with good
prospects into the future. This book is written to guide you along the
way.
<html>
<head>
<title>CRM Website</title>
<link rel="stylesheet" type="text/css"
href="style.css" />
</head>
<body>
<h1>My Website Header</h1>
</body>
</html>
Once your system loads the HTML, it will execute the next layer,
which is CSS (Cascading Style Sheets), and which holds data about how
the web page should look. This contains properties such as distances
between elements, colors, backgrounds, and so on. For example, the
following code affects all elements with the custom_element class,
but you will learn more about this in the next chapter.
.custom_element {
background-color: black;
}
However, arguably the most important layer is the logic layer itself,
which is JavaScript. It was initially built in plain JavaScript, and it was
later extended by a library called jQuery, which quickly took over as the
preferred way to develop frontend logic. The jQuery library contained a
number of prewritten functions such as hiding and showing elements,
and sending forms. Now, the most commonly used library is React,
which was initially developed by the Facebook team, and which you will
learn in this book. This framework uses JavaScript to monitor the
current state of the page being displayed, and once a certain trigger is
activated (such as a new notification, clicking a button, or new data
coming from the server), it calculates the easiest way to display the
changes, without modifying the entire web page.
The logic layer is responsible for all of the logic inside your page.
For example, going behind the scenes to the server and gathering data
in such a manner that your page does not need to refresh in order to
show the latest data.
The most important part of the JavaScript layer is that it can
generate the other two layers (HTML and CSS) dynamically. That means
that within the execution of your web page on your browser, different
parts of the web page being displayed by your browser will change,
appear, or disappear. Having these abilities led to the one-page
applications (also known as single-page applications or SPAs) that we
currently see all over the Internet. The following code combines HTML
and JavaScript:
The most relevant part of this type of architecture was easy to see
when Facebook changed the messaging system. Before, you needed to
go to a separate tab in order to access Messenger as a standalone
application. But around 2010 they started building Messenger as an
integral part of the experience, so that you could read posts and write
comments while still having the Messenger open inside the same page.
This was all possible because, behind the scenes, your browser can talk
to the Facebook servers without the need for you to refresh the page in
order to see the latest messages.
Figure 1-5 Current backend language use. Some projects contain multiple
languages [2]
The most popular backend language at the moment is JavaScript,
and you have to use JavaScript for the frontend either way. Since you
already have to know it, why not use it for your backend as well?
That being said, you will use JavaScript for this project of creating a
Customer Relationship Management system, both for the frontend and
the backend. For the frontend, you will use React, as it is the most
popular platform by far, and for backend, you will use Node.js, which is
the server-side framework for JavaScript, for the same reason.
Summary
A web application is made up of multiple components. The “frontend”
represents everything that runs on the visitor’s device. That is the text
being displayed, and the way the user interacts with the data being sent
back and forth. The “backend” is represented by everything that
happens on the server. That is data manipulation and storage,
authentication, and processing.
As for the languages, they do not matter that much, but you will
stick with JavaScript in this book for the sake of simplicity and of
learning languages that are valuable in the market.
Part II
The Tech Stack
© The Author(s), under exclusive license to APress Media, LLC, part of Springer
Nature 2023
R. Nicoara, How to be a Web Developer
https://doi.org/10.1007/978-1-4842-9663-9_2
2. SQL Basics
Radu Nicoara1
(1) Berlin, Germany
Installing MySQL
MySQL comes in a bundle called XAMPP. You can download it from
apachefriends.org, and then you have to install the package. Once
you install it, the command interface will appear, where you need to
start the Apache and MySQL services, as shown in Figure 2-1.
Figure 2-1 Admin command interface of XAMPP
Let’s look at what you see in the command interface, and what every
process that you start up does:
Apache is a web server that enables you to interact with the
database using a user interface (UI). It basically compiles HTML and
PHP code and provides it to the web browser. If you were to learn
PHP, you would do it using the Apache service as well.
MySQL is a service that runs in the background. It listens on port
3306 on your computer (this will matter later), and you can normally
interact with it using the command line. But since that is really
cumbersome, you will be using the UI in these examples.
Once the services start, access the following URL from your
browser: http://localhost/phpmyadmin. This will bring up the
UI, and from this moment on, you can start learning SQL (see Figure 2-
2).
After saving the database, the system will prompt you to start
creating tables. But before you do that, you need to create a logical data
scheme for your application. Based on that, you can create the database
layer as well, and then build the backend on top of it, and finally, the
frontend.
With that in mind, this section starts with a general overview of the
types of fields you can choose for a table column. Here are the most
commonly-used ones:
Integer. This holds whole numbers like 1,2,3… It is also the default
used for the ID that each entity receives, as it can be auto-
incremented.
Varchar. A variable character is the data type you use for short
strings like email addresses, passwords, and names.
Text. You use this for long text data, like comments or paragraphs.
The upside of this type is that it can hold a large amount of data, but
the downside is that it is difficult to search through, and as a result it
should only be used for storage.
Date and DateTime. This is data that you use for events, like
creation date, last login, and so on.
Boolean. This holds data of type true or false, and is mostly used
for status checks, such as whether a user was deleted.
Now that you have seen the most used data types, you have to adapt
them into your structure. Which begs the question—what kind of data
exactly do you want to save into your CRM system? This is exactly the
point where building the web application starts—by sketching the
database and the relationships.
I suggest that you start by having some customers—the companies
that you have contracts with. Then a few contacts will be linked to your
customers, to know exactly who to call if you need anything from one of
your customers. And finally, a place to store the users who will log into
the system, together with their data and their passwords.
This data scheme will look something like Figure 2-4.
You will have a list of users that can log in, then a list of customers,
and for each customer, a list of contacts. Also, a single contact can be
assigned to multiple customers, so this relationship goes both ways.
One user will be assigned one customer, but they will have access to see
all of the customers. Then you create a list of contacts, and then a page
where you can assign a customer to a contact.
Before you start, consider the following standards. These are highly-
used in the industry, and will make things clearer for other people
using your database. Those are as follows:
Table names should always be singular. So use customer instead of
customers.
Do not use spaces or dots in names. Either use underscores _ to
reference other tables or simply camelCase.
Every table should have a column that is an ID, auto-incremented, to
be used as the unique identifier.
Every column that links from the current entity into another one
should have a name that follows this pattern:
TableName_ColumnName
The length of the column should be as small as you can reasonably
expect it to be.
That brings you to the structure defined in Figure 2-5.
SQL Selects
You will first insert some data into the tables. In order to do that, just
select your tables and go to the Insert tab for each of them.
You need to leave the id column empty, but feel free to populate the
rest of the data. You will see that this will populate the data and
generate the SQL code that the app executes in order to insert the data
into the tables.
This is a good time to talk about quotes inside SQL. Note the ``
back quotes, which are used for table names and column names, and
the '' single straight quotes, which are used to represent string values.
There are also sometimes "" double quotes, which are used to assign
aliases to tables. You will learn about their functions a bit later.
Now examine the syntax of the previous script. It follows the
general syntax of an SQL query. You have an action that needs to be
done, then the table where this needs to be executed, and then the
additional conditions or values.
Now go to the SQL tab. From there, you can run your queries
directly in text format. Try this:
As you can see in Figure 2-8, the customer with the ID 1 will be
retrieved. That is the nice part about SQL. When you read a query, it is
relatively easy to understand what is happening.
As you can see in Figure 2-9, only the columns that you want have
been pulled out of the table.
This will perform an exact match search, which in some cases might
be what you are looking for (such as when you’re searching for an email
address). However, an issue appears when you want to search for text
within the data of a column. For that, you need to use the syntax LIKE
instead of the = operator. It provides you with access to the % wildcard,
as follows.
Similarly, you could write the following query, which searches the
customers for an address containing the country, Spain. You do not
need to select the column in order to query based on it.
This query
will return all of the customers whose addresses contain the word
Spain, at the beginning, the end, or in the middle of the string.
Homework
As homework, try to determine what the following queries will return:
SQL Functions
Inside of an SQL query, you can operate different functions, in order to
retrieve more complex data. For example, imagine that your boss asks
you how many customers you have in the database. The following
query will return the number of rows from the table, shown in Figure 2-
11.
As you can see, the name of the column is COUNT(*), which would
not help you a lot if you exported this data and give it to your boss.
Therefore, you can use an alias for the extracted column (see Figure 2-
12):
Or, if you have a table with contracts, you could run this query to
retrieve all of your sales for 2022:
As you can see, writing SQL queries is not difficult at all. It takes a
bit of getting used to, that is true. But you will quickly be able to pull
out data that you need without even thinking twice about the code.
That is the beauty of SQL. If you can articulate it, you can put it in code
just as easy.
SQL Joins
This might be the most complicated problem of SQL, and the part that
most people have issues understanding. Imagine you have the following
problem: You have a number of users, and each user is assigned to a
certain customer. Holidays are coming, so you ask user to send a letter
to the customer to whom they are assigned. This means that you need
to pull a list of all the users, together with the addresses of their
assigned customers.
In order to do that, you need to do a JOIN operation. This is a way
in which you can pull related data from two different tables at the same
time. First of all, you need to understand the types of joins, which are
illustrated in Figure 2-13.
Figure 2-13 Different types of joins
The type of join basically represents the relationship between data
that is getting get pulled, and also explains which data should get
excluded in the selection. The large majority of joins are LEFT JOINS,
so if you ever don’t know which one to use, try a LEFT JOIN first.
Now for the syntax. You start with a simple SELECT statement from
the base table, and then you join into the second table, by explaining
the condition between the two tables. Therefore, the join will look like
this:
SELECT * FROM
TABLE_1 LEFT JOIN TABLE_2
ON TABLE_2.COLUMN = TABLE_2.ANOTHER_COLUMN
Pay attention here. You always have a table on the left side of the
JOIN keyword, and always a table on the right side of the keyword.
This also means that one column of first table needs to be left of the =
operation, and one column of the second table needs to be on the right
of the = operation.
That makes the query, based on the database, look like this:
SELECT * FROM
user LEFT JOIN customer
ON user.customer_id = customer.id
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of Tales from
the Gesta Romanorum
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.
Language: English
December, 1844.
CONTENTS.
I t was a dull, cold Christmas evening; the snow fell fast and small, and the
cutting northeast wind blew its white shower into heaps and ridges in every
corner of St. John’s quadrangle, and piled its clear flakes against every projecting
part of the old building. No one was moving in college, at least out-of-doors; but
the rude laugh from the buttery, and the dull-red gleam through the closely drawn
curtains of one of the upper rooms in the outer quadrangle, proved that in two
portions of the college Christmas was being kept with plenty and with gayety.
The change from the white cold of the quadrangle to the ruddy blaze of that
upper room was inspiriting. The fire burnt bright; the small table, drawn
immediately in front of its merry blaze, glittered with after-dinner good cheer; and
three young and happy faces sat by that little table, and compared their former
Christmases at home, with this one, during which they were determined to remain
up in Oxford and read for the ensuing examination.
“Morrison is always in good luck,” said Henry Herbert, the youngest of the party.
“Whatever it is, whether drawing lots for a Newham party, or cramming for an
examination, he always succeeds; and now he is the last man that got away from
Oxford before the roads were blocked up by this snow-drift.”
“Fortunate fellow!” said Lathom. “We are shut up now—fifteen feet of snow at
Dorchester, and Stokenchurch bottom quite impassable.”
“Ay, and Oxford streets equally so,” said Frederick Thompson, the last of the
triumvirate, “and we shut up here with the pleasant prospect of taking our
constitutional, for some days to come, under the old Archbishop’s cloisters.”
“By the by,” said Herbert, “what were you after in the old library last week,
Lathom?”
“Looking for a copy of the Gesta Romanorum, with the idea of reading some of
its amusing stories during our after-dinner sittings.”
“Any thing but those Romans: it is bad enough to have read and believed all that
Livy wrote, from his Sucking Wolf to his Capitol Goose, and then to have a shrewd
German prove that kings were not kings, and consuls not consuls, just when you
are beginning to think that you really do know something about your Roman
history.”
“You will have but little of Roman history, Thompson; the title of the book but ill
agrees with its contents: fables of all climes contribute their share in the formation
of this singular composition. The majority of the tales are entirely unconnected
with the history of Rome, though the writer, in order to, in some manner, cover
this deviation from his title, has taken care to preface almost every story with the
name of some emperor, who in most cases never existed, and sometimes has little
to do with the incidents of the narrative.”
“To whom, most learned antiquary, are we indebted for this very stout volume?”
“To the imagination, knowledge, and literary labor of the monks of the middle
ages. In the refectory, whilst the monks ate their meals, one, the youngest
generally, of the society, read from some such collection as this, a tale at once
amusing and instructive. Nor was the use of these fables confined to the refectory.
The success which has always attended instruction by fables, and the popularity
ever consequent on this form of teaching, led the monks to use this medium to
illustrate their public discourses, as well as for their own daily relaxation.”
“Few things are more certain,” said Herbert, “than that an argument, however
clear,—a deduction, however logical,—operates but faintly except on trained
intellects; but an apposite story at once arouses the attention, and makes a more
durable impression on illiterate auditors. Knowledge in the garb of verse is soonest
appreciated by an uneducated mind, and remains there far longer than in any
other form. A ballad will descend from generation to generation without a fault or
an interpolation.”
“Yes,” rejoined Lathom, “and next to poetry comes poetic prose, at the head of
which class stands didactic fiction. Many a clever man has confessed that he was
more indebted to Shakspeare and Scott for his English and Scottish history, than to
the standard historians of either land.”
“And as far as the general belief goes,” said Thompson, “the popular dramatist or
poet will always outweigh the learned historian. Let Walpole or Turner write what
they will about Richard the Third; to the majority—ay, to more than four fifths of
the people—he is still Shakspeare’s Richard, the Humpbacked Murderer.”
“One of the best of the old monks’ stories,” said Lathom, “was translated in
Blackwood’s Magazine some years since. It well illustrates the popular method by
which the writers of these tales inculcated Christian duties on their brethren of the
convent, or on their hearers in the Church. If you like, I will read it.”
The following was the tale of
THE UNGRATEFUL MAN.
Vitalis, a noble Venetian, one day, at a hunting party, fell into a pit,
which had been dug to catch wild animals. He passed a whole night
and day there, and I will leave you to imagine his dread and his
agony. The pit was dark. Vitalis ran from the one side of it to the
other, in the hope of finding some branch or root by which he might
climb its sides and get out of his dungeon; but he heard such
confused and extraordinary noises, growlings, hissings, and plaintive
cries, that he became half-dead with terror, and crouched in a corner
motionless, awaiting death with the most horrid dismay. On the
morning of the second day he heard some one passing near the pit,
and then raising his voice he cried out with the most dolorous accent:
“Help, help! draw me out of this; I am perishing!”
A peasant crossing the forest heard his cry. At first he was
frightened; but after a moment or two, taking courage, be
approached the pit, and asked who had called.
“A poor huntsman,” answered Vitalis, “who has passed a long
night and day here. Help me out, for the love of God. Help me out,
and I will recompense you handsomely.”
“I will do what I can,” replied the peasant.
Then Massaccio (such was the name of the peasant) took a hedge-
bill which hung at his girdle, and cutting a branch of a tree strong
enough to bear a man,—“Listen, huntsman,” said he, “to what I am
going to say to you. I will let down this branch into the pit. I will
fasten it against the sides, and hold it with my hands; and by pulling
yourself out by it, you may get free from your prison.”
“Good,” answered Vitalis; “ask me anything you will, and it shall
be granted.”
“I ask for nothing,” said the peasant, “but I am going to get
married, and you may give what you like to my bride.”
So saying, Massaccio let down the branch—he soon felt it heavy,
and the moment after a monkey leapt out of the pit. He had fallen
like Vitalis, and had seized quickly on the branch of Massaccio. “It
was the devil surely which spoke to me from the pit,” said Massaccio,
running away in affright.
“Do you abandon me, then?” cried Vitalis, in a lamentable accent;
“my friend, my dear friend, for the love of the Lord, for the love of
your mistress, draw me out of this; I beg, I implore you; I will give
her wedding gifts, I will enrich you. I am the Lord Vitalis, a rich
Venetian; do not let me die of hunger in this horrible pit.”
Massaccio was touched by these prayers. He returned to the pit—
let down another branch, and a lion jumped out, making the woods
echo with a roar of delight.
“Oh certainly, certainly, it was the devil I heard,” said Massaccio,
and fled away again; but stopping short, after a few paces, he heard
again the piercing cries of Vitalis.
“O God, O God,” cried he, “to die of hunger in a pit! Will no one
then come to my help? Whoever you may be, I implore you return;
let me not die, when you can save me. I will give you a house and
field, and cows and gold, all that you can ask for; save me, save me
only.”
Massaccio, thus implored, could not help returning. He let down
the branch, and a serpent, hissing joyously, sprang out of the pit.
Massaccio fell on his knees, half-dead with fear, and repeated all the
prayers he could think of to drive away the demon. He was only
brought to himself by hearing the cries of despair which Vitalis
uttered.
“Will no one help me?” said he. “Ah, then, must I die? O God, O
God!” and he wept and sobbed in a heart-breaking manner.
“It is certainly the voice of a man for all that,” said Massaccio.
“Oh, if you are still there,” said Vitalis, “in the name of all that is
dear to you, save me, that I may die at least at home, and not in this
horrible pit. I can say no more; my voice is exhausted. Shall I give
you my palace at Venice, my possessions, my honors? I give them all;
and may I die if I forfeit my word. Life, life only; save only my life.”
Massaccio could not resist such prayers, and mingled with such
promises. He let down the branch again.
“Ah, here you are at last,” said he, seeing Vitalis come up.
“Yes,” said he, and uttering a cry of joy he fainted in the arms of
Massaccio.
Massaccio sustained, assisted him, and brought him to himself;
then, giving him his arm,—“Let us,” said he, “quit this forest”; but
Vitalis could hardly walk,—he was exhausted with hunger.
“Eat this piece of bread,” said Massaccio, and he gave him some
which he took out of his wallet.
“My benefactor, my savior, my good angel,” said Vitalis, “how can I
ever sufficiently recompense you!”
“You have promised me a marriage portion for my bride, and your
palace at Venice for myself,” said Massaccio. But Vitalis now began to
regain his strength.
“Yes, certainly, I will give a portion to your wife, my dear
Massaccio, and I will make you the richest peasant of your village.
Where do you live?”
“At Capalatta in the forest; but I would willingly quit my village to
establish myself at Venice in the palace you have promised me.”
“Here we are out of the forest,” said Vitalis; “I know my road now;
thank you, Massaccio.”
“But when shall I come for my palace and the portion for my
intended?” returned the peasant.
“When you will,” said the other, and they separated.
Vitalis went to Venice, and Massaccio to Capalatta, where he
related his adventure to his mistress, telling her what a rich portion
she was to have, and what a fine palace she was to live in.
The next day early he set out for Venice, and asked for the palace
of the Signor Vitalis,—went straight to it, and told the domestics that
he should come shortly with his mistress, in a fine carriage, to take
possession of the palace which the Signor Vitalis had promised to
give him. Massaccio appeared to those who heard him mad, and
Vitalis was told that there was a peasant in his hall, who asked for a
marriage portion, and said the palace belonged to him.
“Let him be turned out immediately,” said Vitalis, “I know him
not.”
The valets accordingly drove him away with insults, and Massaccio
returned to his cottage in despair, without daring to see his mistress.
At one corner of his fireplace was seated the monkey, at the other
corner the lion, and the serpent had twisted itself in spiral circles
upon the hearth. Massaccio was seized with fear. “The man has
driven me from his door,” thought he; “the lion will certainly devour
me, the serpent sting me, and the monkey laugh at me; and this will
be my reward for saving them from the pit.” But the monkey turned
to him with a most amicable grimace; the lion, vibrating gently his
tail, came and licked his hand, like a dog caressing his master; and
the serpent, unrolling its ringy body, moved about the room with a
contented and grateful air, which gave courage to Massaccio.
“Poor animals!” said he, “they are better than the Signor Vitalis; he
drove me like a beggar from the door. Ah! with what pleasure I would
pitch him again into the pit! And my bride! whom I thought to marry
so magnificently! I have not a stick of wood in my wood-house, not a
morsel of meat for a meal, and no money to buy any. The ungrateful
wretch, with his portion and his palace!”
Thus did Massaccio complain. Meanwhile the monkey began to
make significant faces, the lion to agitate his tail with great
uneasiness, and the serpent to roll and unroll its circles with great
rapidity. Then the monkey, approaching his benefactor, made him a
sign to follow, and led him into the wood-house, where was regularly
piled up a quantity of wood sufficient for the whole year. It was the
monkey who had collected this wood in the forest, and brought it to
the cottage of Massaccio. Massaccio embraced the grateful ape. The
lion then uttering a delicate roar, led him to a corner of the cottage,
where he saw an enormous provision of game, two sheep, three kids,
hares and rabbits in abundance, and a fine wild boar, all covered
with the branches of trees to keep them fresh. It was the lion who
had hunted for his benefactor. Massaccio patted kindly his mane.
“And you, then,” said he to the serpent, “have you brought me
nothing? Art thou a Vitalis, or a good and honest animal like the
monkey and the lion?” The serpent glided rapidly under a heap of
dried leaves, and reappeared immediately, rearing itself superbly on
its tail, when Massaccio saw with surprise a beautiful diamond in its
mouth. “A diamond!” cried Massaccio, and stretched forth his hand
to stroke caressingly the serpent and take its offering.
Massaccio then set out immediately for Venice to turn his diamond
into money. He addressed himself to a jeweller. The jeweller