Skip to content

Commit 75af596

Browse files
committed
Integrate editing for the intro chapter
1 parent 9fff4ec commit 75af596

1 file changed

Lines changed: 35 additions & 35 deletions

File tree

00_intro.txt

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
= Introduction =
55

66
This is a book about getting ((computer))s to do what you want them to
7-
do. Computers are about as common as screwdrivers today, but contain a
7+
do. Computers are about as common as screwdrivers today, but they contain a
88
lot more hidden complexity, and thus are harder to operate and
99
understand. To many, they remain alien, slightly threatening things.
1010

@@ -26,7 +26,7 @@ tasks, we've had more luck with an approach that makes use of our
2626
talent for language: teaching the machine a language.
2727

2828
(((human language)))(((expressivity)))Human languages allow words and
29-
subsentences to be combined in many, many ways, allowing us to say
29+
phrases to be combined in many, many ways, allowing us to say
3030
many, many different things. Computer languages, though typically less
3131
grammatically flexible, follow a similar principle.
3232

@@ -36,7 +36,7 @@ language-based interfaces, which once were the default way in which
3636
people interacted with computers, have largely been replaced with
3737
graphical interfaces. But they are still there, if you know where to
3838
look. One such language, _JavaScript_, is built into just about every
39-
web ((browser)), and thus available on just about every consumer
39+
web ((browser)) and is thus available on just about every consumer
4040
device.
4141

4242
indexsee:[web browser,browser]This book intends to make you familiar
@@ -59,7 +59,7 @@ want to introduce the basic principles of programming. Programming, it
5959
turns out, is hard. The fundamental rules are typically simple and
6060
clear. But programs, built on top of these basic rules, tend to become
6161
complex enough to introduce their own rules and complexity. You're
62-
building your own maze, in a way, and might just get lost in it.
62+
building your own maze, in a way, and you might just get lost in it.
6363

6464
(((learning)))There will be times at which reading this book feels terribly
6565
frustrating. If you are new to programming, there will be a lot of new
@@ -103,9 +103,9 @@ fascinating game. A program is a building of thought. It is costless
103103
to build, it is weightless, and it grows easily under our typing
104104
hands.
105105

106-
If we are not careful, its size and ((complexity)) will grow out of
107-
control, confusing even the person who created it. This is the main
108-
problem of programming: keeping programs under control. When a program
106+
But without care, a program's size and ((complexity)) will grow out of
107+
control, confusing even the person who created it. Keeping programs
108+
under control is the main problem of programming. When a program
109109
works, it is beautiful. The art of programming is the skill of
110110
controlling complexity. The great program is subdued, made simple in
111111
its complexity.
@@ -152,8 +152,8 @@ program to add the numbers from 1 to 10 together and print out the
152152
result `(1 + 2 + ... + 10 = 55)`. It could run on a very simple,
153153
hypothetical machine. To program early computers, it was necessary to
154154
set large arrays of switches in the right position, or punch holes in
155-
strips of cardboard and feed them to the computer. You can imagine how
156-
this was a tedious, error-prone procedure. Even the writing of simple
155+
strips of cardboard and feed them to the computer. You can probably imagine how
156+
how tedious and error-prone this procedure was. Even writing simple
157157
programs required much cleverness and discipline. Complex ones were
158158
nearly inconceivable.
159159

@@ -199,19 +199,19 @@ memory locations:
199199
Output “total”
200200
----
201201

202-
(((loop)))(((jump)))(((summing example)))At this point it is not too
203-
hard to see how the program works. Can you? The first two lines give
202+
(((loop)))(((jump)))(((summing example)))Can you see how the program
203+
works at this point? The first two lines give
204204
two memory locations their starting values: `total` will be used to
205-
build up the result of the computation, and `count` keeps track of the
205+
build up the result of the computation, and `count` will keep track of the
206206
number that we are currently looking at. The lines using `compare` are
207-
probably the weirdest ones. What the program wants to do is see
208-
whether `count` is equal to 11 in order to decide whether it can stop
209-
yet. Because our hypothetical machine is rather primitive, it can only
210-
test whether a number is zero and make a decision (jump) based on
207+
probably the weirdest ones. The program wants to see
208+
whether `count` is equal to 11 in order to decide if it can stop
209+
running. Because our hypothetical machine is rather primitive, it can only
210+
test whether a number is zero and make a decision (or jump) based on
211211
that. So, it uses the memory location labeled `compare` to compute the
212212
value of `count - 11` and makes a decision based on that value. The
213213
next two lines add the value of `count` to the result and increment
214-
`count` by 1 every time the program has decided that it is not 11 yet.
214+
`count` by 1 every time the program has decided that `count` is not 11 yet.
215215

216216
Here is the same program in JavaScript:
217217

@@ -226,14 +226,14 @@ console.log(total);
226226
// → 55
227227
----
228228

229-
(((while loop)))(((loop)))This gives us a few more improvements.
229+
(((while loop)))(((loop)))This version gives us a few more improvements.
230230
Most importantly, there is no need to specify the way we want the
231231
program to jump back and forth any more. The `while` language
232232
construct takes care of that. It continues executing the block
233233
(wrapped in braces) below it as long as the condition it was given
234-
holds: `count <= 10`, which means “++count++ is less than or equal to
234+
holds. That condition is `count <= 10`, which means “++count++ is less than or equal to
235235
10”. We no longer have to create a temporary value and compare that
236-
to zero. This was an uninteresting detail, and the power of
236+
to zero, which was an uninteresting detail. Part of the power of
237237
programming languages is that they take care of uninteresting details
238238
for us.
239239

@@ -259,15 +259,15 @@ be expressed in long and short, unreadable and readable ways. The
259259
first version of the program was extremely obscure, whereas this last
260260
one is almost English: `log` the `sum` of the `range` of numbers from
261261
1 to 10. (We will see in link:04_data.html#data[later chapters] how to
262-
build things like `sum` and `range`.)
262+
build operations like `sum` and `range`.)
263263

264264
(((programming language,power of)))(((composability)))A good
265265
programming language helps the programmer by allowing them to talk
266266
about the actions that the computer has to perform on a higher level.
267267
It helps omit uninteresting details, provides convenient building
268268
blocks (such as `while` and `console.log`), allows you to define your
269-
own building blocks (such as `sum` and `range`), and makes it easy to
270-
compose these blocks.
269+
own building blocks (such as `sum` and `range`), and makes those blocks
270+
easy to compose.
271271

272272
== What is JavaScript? ==
273273

@@ -276,8 +276,8 @@ application)))(((JavaScript)))(((JavaScript,history of)))(((World Wide
276276
Web))) JavaScript was introduced in 1995, as a way to add programs to
277277
Web pages in the Netscape Navigator browser. The language has since
278278
been adopted by all other major graphical web browsers. It has made
279-
the current generation of web applications possible—browser-based
280-
email clients, maps, and social networks—and is also used in more
279+
the current generation of web applications—browser-based
280+
email clients, maps, and social networks—possible and is also used in more
281281
traditional sites to provide various forms of interactivity and
282282
cleverness.
283283

@@ -301,7 +301,7 @@ two names for the same language.
301301
(((JavaScript,weaknesses of)))(((debugging)))There are those who will
302302
say _terrible_ things about the JavaScript language. Many of these
303303
things are true. When I was required to write something in JavaScript
304-
for the first time, I quickly came to despise it—it would accept
304+
for the first time, I quickly came to despise it. It would accept
305305
almost anything I typed but interpret it in a way that was completely
306306
different from what I meant. This had a lot to do with the fact that I
307307
did not have a clue what I was doing, of course, but there is a real
@@ -347,15 +347,15 @@ outside of the browser.
347347
(((reading code)))(((writing code)))Code is the text that makes up
348348
programs. Most chapters in this book contain quite a lot of it. In my
349349
experience, reading and writing ((code)) is an indispensable part of
350-
((learning)) to program. Try to not just glance over the examples, read
351-
them attentively and understand them. This will be slow and confusing
350+
((learning)) to program, so try to not just glance over the examples. Read
351+
them attentively and understand them. This may be slow and confusing
352352
at first, but I promise that you will quickly get the hang of it. The
353353
same goes for the ((exercises)). Don't assume you understand them
354354
until you've actually written a working solution.
355355

356-
(((interpretation)))I recommend to try out your solutions to exercises
357-
in an actual JavaScript interpreter, to get immediate feedback on
358-
whether what you are doing is working or not, and, hopefully, to be
356+
(((interpretation)))I recommend you try out your solutions to exercises
357+
in an actual JavaScript interpreter. That way, you'll get immediate feedback on
358+
whether what you are doing is working or not, and, hopefully, you'll be
359359
tempted to ((experiment)) and go beyond the exercises.
360360

361361
ifdef::interactive_target[]
@@ -377,12 +377,12 @@ endif::book_target[]
377377

378378
(((developer tools)))(((JavaScript console)))Running JavaScript
379379
programs outside of this book's sandbox is also possible. You can opt
380-
to install ((Node.js)), and use it to run text files that contain
380+
to install ((Node.js)) and use it to run text files that contain
381381
programs. Or you can use your browser's developer console (typically
382382
found somewhere under a “tools” or “developer” menu) and play around
383-
in there. In link:12_browser.html#script_tag[Chapter 12], the way in
384-
which JavaScript programs are embedded in web pages (HTML files) is
385-
explained. There are also websites like http://jsbin.com[_jsbin.com_]
383+
in there. In link:12_browser.html#script_tag[Chapter 12], I explain
384+
the way in which JavaScript programs are embedded in web pages (HTML files).
385+
You could also try websites like http://jsbin.com[_jsbin.com_]
386386
which provide a friendly interface for running JavaScript code in a
387387
browser.
388388

0 commit comments

Comments
 (0)