-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
171 lines (168 loc) · 11.9 KB
/
index.html
File metadata and controls
171 lines (168 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<html lang="en">
<head>
<title>Variations on a Theme: JavaScript</title>
<meta name="title" content="Variations on a Theme: JavaScript">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta charset="UTF-8">
<meta name="description" content="An object-oriented Introduction">
<meta name="keywords" content="JavaScript,object orientation,introduction">
<meta name="author" content="Ralph P. Lano">
<meta name="robots" content="index,follow">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="book.css">
</head>
<body>
<center>
<div id="wrap">
<ul class="sidenav">
<p><a href="index.html">Variations on a Theme</a><a href="index.html">JavaScript</a></p>
<li><a href="Ch1_Karel.html">Karel</a></li>
<li><a href="Ch2_Graphics.html">Graphics</a></li>
<li><a href="Ch3_Console.html">Console</a></li>
<li><a href="Ch4_Agrar.html">Agrar</a></li>
<li><a href="Ch5_MindReader.html">MindReader</a></li>
<li><a href="Ch6_Swing.html">Swing</a></li>
<li><a href="Ch7_Asteroids.html">Asteroids</a></li>
<li><a href="Ch8_Stocks.html">Stocks</a></li>
<li><a href="index.html"> </a></li>
<li><a href="AppA_Primer.html">Primer</a></li>
<li><a href="AppB_Libraries.html">Libraries</a></li>
<li><a href="AppC_Ideas.html">Ideas</a></li>
</ul>
<div class="content"><h1>
<a href="https://www.amazon.de/gp/product/1727733142"><img alt="" src="img/Book6_Icon.jpg" style="margin-left: 10px; margin-right: 10px; width: 200px; height: 259px; float: right;" /></a>Variations on a Theme:<br />
JavaScript<br />
An object-oriented Introduction</h1>
<p>
by Ralph P. Lano, 1. Edition</p>
<h3>
Why</h3>
<p>
this book? I have always been writing little bits and pieces of JavaScript, but my preferred language
always was Java, which is what I teach. What triggered this book, was a student with an iPad Pro, who
asked if he could use it for my class. Unfortunately, the answer was no. Times change, and so did
JavaScript. With the advent of ES6, some "syntactic sugar" was added to the language:
classes. And since I really like sugar, I set myself the challenge: could I rewrite my introductory Java
book in JavaScript? My main design criteria was to have as few changes as possible to convert Java
examples to JavaScript. And surprisingly, it worked really well. This may not really be a good
reason to write a book, but then, what is?</p>
<h3>
For whom</h3>
<p>
Well, obviously for the student with the iPad. Definitely, hardcore JavaScript folks will not like it,
and this is NOT a mainstream JavaScript book. This is a fun project. And if you have little or no
programming skills, maybe this book here will be a helpful introduction. If you like books with many
pictures, then also, this book may be for you. But don't be fooled by the number of pages: there is
a lot of work to be done. If a lot of work is not your thing, then this book probably is not for you.
</p>
<h3>
From whom</h3>
<p>
I have been teaching Java for roughly twenty years now, in different forms, courses and universities. So
naturally, this is JavaScript through the eyes of a Java developer. Since 2011, I have been Professor of
Internet Programming and Multimedia Applications in the MediaEngineering program at the Nuremberg Institute of
Technology. From 2003 to 2010 I was Professor of Software Engineering and Multimedia Applications at the
University of Applied Sciences Hof, and from 2010 to 2011 Professor of Media and Computing at HTW
Berlin. I received my doctorate in 1996 from the University of Iowa on the subject 'Quantum Gravity:
Variations on a Theme'. From 1996 to 1997 I was Postdoctoral Research Associate at the Centre for
Theoretical Studies of the Indian Institute of Science. From 1997 to 2003 I worked at Pearson Education
and later at Siemens AG in software development and project management.</p>
<h3>
About what</h3>
<p>
It's getting a bit technical now, but some people want to know what they're getting into: In the
first chapter we take the first programming steps with Karel. We get to know functions, loops,
conditions and our first software engineering principles. Above all, the top-down principle is
introduced for the first time. The second chapter introduces graphics programming, we learn to use
objects using a JavaScript version of the ACM graphics library. This is followed by an introduction to
console programs. The point here is to get to know variables and operators, conditions and loops are
deepened, boolean variables are introduced and the 'Loop and a Half' is shown. In the chapter
Agrar the top-down principle is deepened and functions are put on a new foundation. It is also shown how
animations and mouse events work, and the random generator is used for the first time. Chapter five
deals with strings and introduces classes. The Swing chapter introduces the basics of graphical user
interfaces and concretizes the concept of instance variables. The basics of object orientation,
inheritance and composition, will be discussed in detail in the following chapter and will be deepened by
numerous examples. Arrays and simple image processing are also introduced. Then we finish off the
main part with the introduction of the list and map data structures, and we conclude with interfaces and
loosely introduce the term polymorphism.</p>
<p>
The appendix starts with a primer on JavaScript and some of its new features. This is followed by a
brief description of each of the libraries we use in the main part. Especially the graphics libraries
are nothing but a thin wrapper around the p5.js library from the Processing Foundation [7]. The final
chapter, is just a loose collection of idea, which is work in progress.</p>
<h3>
How</h3>
<p>
does one learn to play the piano? Not by watching or listening. It's the same with
programming: you have to practice a lot! And the more you practice, the better you become with
programming. We're not only learning programming here, but also actually taking our first steps in
software engineering. But as Johann Sebastian Bach so nicely said: "All you have to do is hit the
right key at the right time."</p>
<p>
The course as I teach it, consists of three components: the lecture, the labs and homework. The lecture
is four hours per week and corresponds to the first part of each chapter in the book. We complete one
chapter in about one to two weeks. In the labs, which also last four hours a week, we then devote
ourselves to the projects. We manage between four and six of the projects per lab. In the labs,
the students work in teams, usually in pairs, to help each other.</p>
<p>
Homework is done on a weekly basis and takes about 8 to 10 hours per week. It is important that the
students work alone on their homework. I attach great importance to the fact that the students commit
themselves to follow the Stanford University honor code. The homework also doesn't have to be
complete or work perfectly. The homework is discussed individually in the labs, and almost all problems
related to the homework usually can be solved within five minutes.</p>
<h3>
Where</h3>
<p>
can I find the examples and the source code? You can find them on the website of the book: <a
href="https://github.com/rplano">https://github.com/rplano</a>. Also, the book in electronic form,
including updates, can be found there. The book in printed form is available on Amazon, in black and
white.</p>
<h3>
May I</h3>
<p>
use the examples, or copy the book? This material is licensed under Creative Commons Attribution -
Non-commercial - Distribution under Equal Terms 4.0 International (CC-BY-NC-SA 4.0). That is, you may
reproduce and redistribute the material in any format or medium, remix the material, modify it, and build upon
it. However, you must provide appropriate copyright and other proprietary notices, include a link to the
license, and indicate whether any changes have been made. This information may be provided in any reasonable
manner, but not in such a way as to create the impression that the Licensor is specifically endorsing you or
your use. You may not use the material for commercial purposes. And if you remix, modify, or
otherwise directly build upon the material, you may distribute your submissions only under the same license as
the original, and you may not use any additional clauses or technical procedures that legally prohibit others
from doing anything that the license permits. To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc-sa/4.0/.</p>
<p>
The source code is available under the MIT License (http://choosealicense.com/licenses/mit/).</p>
<h3>
From where</h3>
<p>
come the ideas? Since this book is almost identical to my first book, the style, the pedagogical
structure and many of the examples are heavily inspired by Mehran Sahami's lecture [1], which in turn is
based on the book by Eric Roberts [2]. I personally learned JavaScript from David Flanagan's book
[5]. However, JavaScript has changed quite a bit over the years, and if you really want to understand
it, you must read Douglas Crockford's book [3]. The tutorials on W3Schools [4] are really helpful
when you need a quick solution for a simple problem. Addy Osmani website [6] I really like, because it
shows that you can write really nice, clean code with JavaScript, just take a look for yourself.</p>
<h3>
References</h3>
<p>
[1] Programming Methodology, CS106A, von Mehran Sahami, https://see.stanford.edu/Course/CS106A<br />
[2] The Art and Science of Java, von Eric Roberts, Addison-Wesley, 2008<br />
[3] JavaScript: The Good Parts: Working with the Shallow Grain of JavaScript, Douglas Crockford, O'Reilly,
2008<br />
[4] JavaScript Tutorial - W3Schools, <a href="http://www.w3schools.com/js/">www.w3schools.com/js/</a><br />
[5] JavaScript: The Definitive Guide, David Flanagan, O'Reilly, 2012<br />
[6] Learning JavaScript Design Patterns, Addy Osmani, <a
href="https://www.patterns.dev/posts/classic-design-patterns/">https://www.patterns.dev/posts/classic-design-patterns/</a><br />
[7] p5.js, <a href="https://p5js.org/">https://p5js.org/</a></p>
<p>
.</p>
<p class="footer">
Copyright © 2016-2023 <a href="http://www.lano.de">Ralph P. Lano</a>. All rights reserved.
</p>
</div>
</div>
</center>
</body>
</html>