Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 4664149

Browse files
authored
Merge branch 'master' into improve-lessonplan-3
2 parents 5f89a8b + e8eb6c4 commit 4664149

File tree

16 files changed

+479
-298
lines changed

16 files changed

+479
-298
lines changed

README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,51 +11,73 @@ In this module you'll make a start into wonderful world of programming. We will
1111

1212
You'll be learning two main things:
1313

14-
1. Fundamental concepts in programming
15-
While we're using JavaScript to illustrate these concepts, it's important to keep in mind that what you will learn is applicable to **any** programming language. They might differ in syntax (a fancy term for the arrangement of words in a language in order for it to make sense), but the functionality will be the same: a loop will always be a loop.
14+
1. **Fundamental concepts in programming**. While we're using JavaScript to illustrate these concepts, it's important to keep in mind that what you will learn is applicable to **any** programming language. They might differ in syntax (a fancy term for the arrangement of words in a language in order for it to make sense), but the functionality will be the same: a loop will always be a loop.
1615

17-
This should be your mindset when you're learning concepts: **I'm learning how to become a software developer that can adjust to any language used, because I know what the underlying principles and concepts are**.
16+
This should be your mindset when you're learning concepts: **I'm learning how to become a software developer that can adjust to any language used, because I know what the underlying principles and concepts are**.
1817

19-
2. How to think like a programmer
20-
In one sentence this means: **knowing how to solve problems computationally**. Let's split that up in two parts: `how to solve problems` refers to the ability to identify issues and find effective solutions. `computationally` refers to the ability to think in logical steps that the computer can understand and execute.
18+
2. **How to think like a programmer**. In one sentence this means: knowing how to solve problems using a computer. Let's split that up in two parts: `how to solve problems` refers to the ability to identify issues and find effective solutions. `computationally` refers to the ability to think in logical steps that the computer can understand and execute.
2119

22-
This should be your mindset when you're learning how to think : **I'm learning how to think in logical steps, identifying cause and effect, and always looking for solutions**.
20+
This should be your mindset when you're learning how to think : **I'm learning how to think in logical steps, identifying cause and effect, and always looking for solutions**.
2321

2422
## Before you start!
2523

24+
### 1. Install some new software!
25+
2626
In order to test your JavaScript code, you'll be using software that will execute your files from the command line. This software is called [Node.js](https://nodejs.org/en/download/). Download the Long-Term Support (LTS) version for your specific operating system.
2727

28-
- For Windows, click [here](https://nodejs.org/dist/v10.16.0/node-v10.16.0-x64.msi)
29-
- For Mac, click [here](https://nodejs.org/dist/v10.16.0/node-v10.16.0.pkg)
30-
- For Linux, click [here](https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz)
28+
- For Windows, click [here](https://nodejs.org/dist/v12.16.1/node-v12.16.1-x86.msi)
29+
- For Mac, click [here](https://nodejs.org/dist/v12.16.1/node-v12.16.1.pkg)
30+
- For Linux, click [here](https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz)
3131

3232
After you've installed it, go to your command line interface. Type in the following command:
3333

3434
```
3535
node --version
3636
```
3737

38-
It should show you version `v10.14.2` or higher.
38+
It should show you version `v12.16.1` or higher.
39+
40+
### 2. A new way of submitting homework!
41+
42+
Starting from this module you'll submit homework in a different way. You will be only using GIT and GitHub and work **like a real developer would**: pushing code from your computer to GitHub and making pull requests!
43+
44+
Before you start with the homework, make a `fork` of the following repository: [HackYourHomework/JavaScript1](https://www.github.com/hackyourhomework/javascript1). You'll always use the **HackYourHomework** version of the module repository whenever you have to submit your homework.
45+
46+
Here are the steps to get started:
47+
48+
1. `fork` the HackYourHomework repository to your personal account.
49+
2. `clone` your forked repository to your computer.
50+
3. Make `GIT` branches for each week. Start at the `master` branch and execute the following (note that they're 3 different commands):
51+
52+
```console
53+
foo@bar:~$ git branch week1-YOURNAME
54+
foo@bar:~$ git branch week2-YOURNAME
55+
foo@bar:~$ git branch week3-YOURNAME
56+
```
57+
58+
4. `checkout` to `week1-YOURNAME`
59+
5. Get started with making your homework!
60+
61+
Here's a video in order that shows you how it's done: [How to Submit Your Homework](https://www.youtube.com/watch?v=CpYARPYGQU8)
3962

4063
## Learning goals
4164

4265
In order to successfully complete this module you will need to master the following:
4366

44-
- Have an idea of what computer programming is
45-
- Know the basic buildingblocks of JavaScript
46-
- Correctly write and use variables, functions and loops
47-
- Understand the control flow
48-
- Think like a programmer
67+
- Have an idea of what `computer programming` is
68+
- Know the basic building blocks of `JavaScript`
69+
- Correctly write and use `variables`, `functions` and `loops`
70+
- Understand the `control flow`
4971

5072
## How to use this repository
5173

52-
This repository consists of 3 parts:
74+
This repository consists of 3 essential parts:
5375

54-
1. `Reading materials`: this document contains all the required theory you need to know _**while**_ you're coding. It's meant as both study material and as a reference to understand what you're doing.
55-
2. `Homework`: this document contains the instructions for each week's homework.
56-
3. `Lesson Plans`: this part is meant for teachers as a reference. However, as a student don't be shy to take a look at it as well!
76+
1. `README`: this document contains all the required theory you need to understand **before** class. It's also meant as a reference to understand what you're doing while you're coding.
77+
2. `MAKEME`: this document contains the instructions for each week's homework.
78+
3. `LESSONPLAN`: this document is meant for teachers as a reference. However, as a student don't be shy to take a look at it as well!
5779

58-
After your first class you should start with checking the `reading materials` for that week. So, for the first time that is the [Week 1 Reading](/Week1/README.md). Study all the concepts and try to get the gist of everything. After, you can get started with the `homework` for that week.
80+
**Before** the first class of the module you should start off with the [Week 1 Reading](/Week1/README.md). Study all the concepts and try to get the gist of everything. After your first class, you can get started with the [Week 1 Homework](/Week1/MAKEME.md).
5981

6082
If you have any questions or if something is not entirely clear ¯\\\_(ツ)\_/¯, please ask/comment on Slack!
6183

Week1/LESSONPLAN.md

Lines changed: 31 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -34,42 +34,18 @@ Examples the two different kind of websites
3434

3535
Discuss in class which claim belongs to which type of website:
3636

37-
Content of Web pages can not be change at runtime.
38-
39-
40-
Server side languages such as PHP, Node.js are used.
41-
42-
43-
Content of Web pages can be changed.
44-
45-
46-
No interaction with database possible.
47-
48-
49-
Interaction with database is
50-
51-
52-
It is faster to load as compared to the other type of website.
53-
54-
55-
It is slower then static website.
56-
57-
58-
59-
Lower Development costs.
60-
61-
62-
63-
Content may change everytime the page is loaded.
64-
65-
66-
Feature of Content Management System.
67-
68-
69-
HTML, CSS, Javascript is used for developing the website.
70-
71-
72-
Same content is delivered everytime the page is loaded.
37+
- Content of Web pages can not be change at runtime.
38+
- Server side languages such as PHP, Node.js are used.
39+
- Content of Web pages can be changed.
40+
- No interaction with database possible.
41+
- Interaction with database is possible
42+
- It is faster to load as compared to the other typ of website.
43+
- It is slower then static website.
44+
- Lower Development costs.
45+
- Content may change every time the page is loaded.
46+
- Feature of Content Management System.
47+
- HTML, CSS, Javascript is used for developing the website.
48+
- Same content is delivered every time the page is loaded.
7349

7450
### Essence
7551

@@ -88,7 +64,7 @@ Discuss in class which claim belongs to which type of website:
8864
- Easy to pull in data on stuctured and organised way
8965
- Content management system
9066
Disadvantage:
91-
- Design is more fixed, becasue the pages are more of a template
67+
- Design is more fixed, because the pages are more of a template
9268
- Costs
9369

9470
## 2. The pillars of web development: HTML/CSS/JavaScript
@@ -130,10 +106,9 @@ A big disadvantage of web pages like this is that the only way that a visitor ha
130106
It doesn't exhibit any dynamic behavior like:
131107

132108
1. reacting to user actions such as mouse click events or key presses.
133-
1. rendering complex animations
134-
1. sending requests over network to servers and fetching a response
135-
1. and this is where JavaScript steps in.
136-
<<<<<<< HEAD
109+
2. rendering complex animations
110+
3. sending requests over network to servers and fetching a response
111+
4. and this is where JavaScript steps in.
137112

138113
## 3. What are variables (const & let) & naming conventions
139114

@@ -173,8 +148,10 @@ console.log(age);
173148

174149
```javascript
175150
// Variable Initialization
176-
var firstName = 'Marco';
177-
let lastName = 'Borsato';
151+
152+
var firstName = "Yash";
153+
let lastName = "Kapila";
154+
178155
const age = 29;
179156

180157
console.log(firstName);
@@ -183,15 +160,15 @@ console.log(age);
183160
```
184161

185162
```javascript
186-
var firstName = 'Tom';
187-
let lastName = 'Hanks';
163+
var firstName = "Tom";
164+
let lastName = "Hanks";
188165

189166
console.log(firstName);
190167
console.log(lastName);
191168

192-
// Assigning a different value to variables
193-
firstName = 'Katy';
194-
lastName = 'Perry';
169+
// Assigning variables to a different value
170+
firstName = "Hanks";
171+
lastName = "Tom";
195172

196173
console.log(firstName);
197174
console.log(lastName);
@@ -201,12 +178,13 @@ console.log(lastName);
201178

202179
1. Create 2 variables using the `let` keyword
203180

204-
1. make 1 variable contain your first name
205-
1. the second variable should have no value assigned
181+
- make 1 variable contain your first name
182+
- the second variable should have no value assigned
206183

207184
1. Make 2 variables using the `const` keyword
208-
1. the first variable should contain the town/city you currently stay at
209-
1. come up with name and a value for the second variable yourself
185+
- the first variable should contain the city you currently stay at
186+
- come up with name and a value for the second variable yourself
187+
210188

211189
### Essence
212190

@@ -246,6 +224,7 @@ Whenever you declare a variable (using `let`), but you don't set a value, the va
246224

247225
### Exercise
248226

227+
249228
Everybody has four minutes to find a way to store all basic data types in a variable by making use of the typeof operator:
250229

251230
```js

Week1/MAKEME.md

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ In the following exercises you'll learn how to use different JavaScript concepts
2626
2727
**Exercise 1: Hello world!**
2828

29-
Write a statement, using the `console.log()` function. Give it a string as an argument. The string should contain the message "Hello world!".
29+
Write a statement, using the `console.log()` function. It should fulfill the following requirements:
3030

31-
Write 10 statements like these, but in different languages.
31+
- It takes a string as an argument
32+
- The string should contain the message `"Hello world!"`
33+
- Execute the function 10 times, each time using the phrase in different languages
3234

3335
For example:
3436

@@ -38,38 +40,44 @@ Ciao, mondo! // Italian
3840
Hola, mundo! // Spanish
3941
```
4042

41-
Using the command line, navigate to your `js-exercises` folder and type in the following to test your code:
43+
Finished? Using the command line, navigate to your `js-exercises` folder and type in the following to test your code:
4244

43-
```
44-
node FILENAME.js
45+
```console
46+
foo@bar:~$ node FILENAME.js
4547
```
4648

47-
It should show the message `Hello world!` in 10 different languages.
49+
Expected output: It should show the message `Hello world!` in 10 different languages.
4850

4951
**Exercise 2: Error debugging**
5052

5153
Consider the following code:
5254

5355
```js
54-
console.log('I'm awesome');
56+
console.log('I'm awesome'!;
5557
```
5658
57-
Copy the code in your `.js` file and run it in the command line using `node`. You will see that you will get a SyntaxError. **Correct the mistake**.
59+
Here are the requirements:
60+
61+
- Copy the code in your `.js` file and run it in the command line using `node`.
62+
63+
You will see that you will get a [SyntaxError](https://techterms.com/definition/syntax_error).
5864
59-
Hint: the SyntaxError message will give you some indication of what the error _might_ be, but figure out yourself how to correct it!
65+
- **Correct the mistake**.
6066
61-
When done right, it should show the message `I'm awesome`.
67+
> Hint: the SyntaxError message will give you some indication of what the error _might_ be, but figure out yourself how to correct it!
68+
69+
Expected output: When done right, the command line should show the message `I'm awesome!`.
6270
6371
**Exercise 3: Log the number**
6472
6573
Follow the steps. Make sure that each step is written on the line after.
6674
67-
1. First, declare your variable `numberX`. Do not _initialize_ it (which means, don't give it a value) yet.
68-
2. Add a `console.log` statement that explains in words _what you think_ the value of `x` is, like in this example.
75+
1. First, declare your variable `numberX`. Do not _initialize_ it (which means, don't give it a starting value) yet
76+
2. Add a `console.log` statement that explains in words _what you think_ the value of `x` is
6977
3. Add a `console.log` statement that logs the value of `numberX`.
70-
4. Now _initialize_ your variable `numberX` with a number (also called an `integer` in computer science terms).
71-
5. Next, add a `console.log` statement that explains _what you think_ the value of `numberX` is.
72-
6. Add a `console.log` statement that logs the value of `numberX`.
78+
4. Now _initialize_ your variable `numberX` with a number (also called an `integer` in computer science terms)
79+
5. Next, add a `console.log` statement that explains _what you think_ the value of `numberX` is
80+
6. Add a `console.log` statement that logs the value of `numberX`
7381
7482
**Exercise 4: Log the string**
7583
@@ -86,7 +94,7 @@ Follow the steps. Make sure that each step is written on the line after.
8694
8795
Follow the steps. Make sure that each step is written on the line after.
8896
89-
1. Declare a variable `z` and assign the number 7.25 to it.
97+
1. Declare a variable `z` and assign the number `7.25` to it.
9098
2. Write a `console.log` statement in which you log the value of `z`.
9199
3. Declare another variable `a` that has the value of `z` but rounded to the nearest integer.
92100
4. Write a `console.log` statement in which you log the value of `a`.
@@ -115,7 +123,14 @@ Follow the steps. Make sure that each step is written on the line after.
115123
116124
**Exercise 8: Type checker**
117125
118-
Write a program that checks the data types of two variables and logs to the console `SAME TYPE` if they are the same type. If they are different types log `Not the same...`.
126+
Create a `function` that fulfills the following requirements:
127+
128+
- Takes in 2 arguments
129+
- Check the data type of each
130+
- Compares each data type
131+
- Logs to the console the message `SAME TYPE` if they are the same type. If they are different types log `Not the same...`.
132+
133+
Follow the steps:
119134

120135
1. Declare 4 variables: 2 must be `strings` and 2 must be `objects`
121136
2. Create 6 conditional statements, where for each you check if the data type of one variable is the same as the other
@@ -142,14 +157,16 @@ if (...) {
142157
143158
**Exercise 9: Log the remainder**
144159
145-
For each of these, write in comments what the answer is followed by how you came to that conclusion
160+
Answer the following questions. For each, write in comments what the answer is followed by how you came to that conclusion:
146161
147162
1. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the value of `x` after the calculation?
148163
2. If `y` equals 21, and the only other statement is `y = y % 4`, what would be the value of `y` after the calculation?
149164
3. If `z` equals 13, and the only other statement is `z = z % 2`, what would be the value of `z` after the calculation?
150165
151166
**Exercise 10: Compare arrays**
152167
168+
Follow the steps:
169+
153170
1. Declare 2 variables, that each hold an array. The first array should have 4 items, the second 7 items
154171
2. Find out how to get the length of each array. Write a `console.log` statement that shows the length of each array
155172
@@ -163,19 +180,23 @@ console.log('The length of the array is...' + ...);
163180
164181
## **3. Code along**
165182
183+
> Create a new GitHub repository for this project. It's a portfolio piece!
184+
166185
We don't want to lose the connection with HTML/CSS, so in the following tutorial you'll learn how to build a simple web application use HTML/CSS and JavaScript.
167186
168-
You'll first write the HTML and CSS, to provide structure and style to the page. When doing so, keep notice of how the developer chooses to do this. Why do they use this tag instead of something else? Why do they give an element a certain class name?
187+
You'll first write the HTML and CSS, to provide structure and style to the page. When doing so, notice how the developer chooses to do this. Why do they use this tag instead of something else? Why do they give an element a certain class name?
169188
170189
After, the developer will write JavaScript code. You'll notice it's different from how you've used JavaScript. It is something we call **DOM Manipulation**. Don't worry, you don't need to master this just yet. Just follow along and do some research yourself if you already want to learn more about it!
171190
172191
- [Calculator](https://www.youtube.com/watch?v=6v4vBXL-qkY)
173192
174193
## **SUBMIT YOUR HOMEWORK!**
175194
176-
After you've finished your todo list it's time to show us what you got! Starting from this week you'll be submitting all your homework through GitHub. What you'll be doing is upload all your files to a forked repository (a copy from the original, which in this case is the [JavaScript1](https://www.github.com/HackYourFuture/JavaScript1) repository) using GIT.
195+
After you've finished your todo list it's time to show us what you got! Starting from this week you'll be submitting all your homework through GitHub. What you'll be doing is upload all your files to a separate repository.
196+
197+
Go over to [HackYourHomework/JavaScript1](https://www.github.com/HackYourHomework/JavaScript1). Notice how it's **HackYourHomework**, a repository meant to submit the homework!
177198
178-
Take a look at the following [guide](../hand-in-homework-guide.md) to see how it's done.
199+
Then take a look at the following [guide](../hand-in-homework-guide.md) to see to set everything up.
179200
180201
The homework that needs to be submitted is the following:
181202

0 commit comments

Comments
 (0)