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

test homework week1 - #14

Merged
mkruijt merged 3 commits into
HackYourFuture:masterfrom
mkruijt:master
Oct 29, 2017
Merged

test homework week1#14
mkruijt merged 3 commits into
HackYourFuture:masterfrom
mkruijt:master

Conversation

@mkruijt

@mkruijt mkruijt commented Oct 24, 2017

Copy link
Copy Markdown
Member

hi, I've made a first draft for how we can tweak the homework in a way that students have to think more about what is going on in their programs. My idea was that it would stimulate them to think more and not just type syntax. Also it requires them to actually know how to run the code, and be aquatinted with their basic environment setup, something some of them especially in early javascript have issues with. Would be cool if one of you can take a look and tell me what you think.

Comment thread Week1/MAKEME.md Outdated
5. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
For example:
1.1 First, _declare_ your variable `x`.
1.2 Add a console.log statement that explains what _you think_the value of `x` is, like in this example:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...that explains in words...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that is a better way of putting it!

Comment thread Week1/MAKEME.md Outdated
3.4 Console.log `z` again.

4. Arrays!
4.1 Declare an empty array (you can decide on how to call it yourself).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to hammer in early that choosing appropriate names is paramount in programming. So I would propose to add this sentence: `(you can decide on how to call it yourself, but read on a bit here and see if you can find a good name that exactly describes what this variable will hold).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep agree!

Comment thread Week1/MAKEME.md Outdated
4.3 Console.log your array.
4.4 Create an array that has your favorite animals inside
4.5 Log your array
4.6 Ads Daan's favorite animal (baby pig) to the existing array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Ads -> Add

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you expect students to use push rather than modifying their array initialization in the source code. In that case we could say: Add a statement to adds Daan's...

@remarcmij remarcmij left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Maartje, excellent changes! I wonder however how much array manipulation you expect the students to be able to do at this point. See my detail comments below.

Comment thread Week1/MAKEME.md Outdated
4.5 Log your array
4.6 Ads Daan's favorite animal (baby pig) to the existing array
4.7 Log your new array!
4.8 Now add Gijs's favorite animal to the array (moose), but make sure it will be placed after the first animal that you have placed in your array.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To do this programmatically would require slice and concat (or array destructuring) but I note that we are teaching array manipulations in Week 3. So, perhaps you intend for the students to just add in the moose manually?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no not really, I think I got a bit carried away here. I feel that there can always be a part of the homework that they have to figure out themselves. I've moved half of the questions to week 3 homework and now only ask then to add Daan's favourite animal to the array.

Comment thread Week1/MAKEME.md Outdated
4.9 Write a console.log statement in which explain what _you think_ the new value of the array is.
4.10 Log your new new array!
4.11 Log the length of the array, add a message: "The array has a length of: "(here you should show the length of the array)
4.12 Eyad does not like giraffes, delete this animal from the array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, do you expect them to use array manipulation?

Comment thread Week1/MAKEME.md Outdated
5.2 Add the string to your file and console.log it.
5.3 Find a way to get the length of `mystring`.
5.4 Console.log the length of `mystring`.
5.5 The comma's make that the sentence is quite hard to read. Find a way to remove the comma's from the sting and replace them with a spaces

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: sting -> string. I would replace the commas with myString = myString.replace(/,/g, ' ') But that would mean we need explain what a regular expression and what the global flag does. BTW, I propose we hammer in the use of camelCase early, so can we make it myString?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I agree, again also got a big carried away here, i moved half of the assignment to week3

Comment thread Week1/MAKEME.md Outdated


7. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
6.1 First declare at least four variables and assign them with different data types.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'with' can go

Comment thread Week1/MAKEME.md Outdated

7. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
6.1 First declare at least four variables and assign them with different data types.
6.2 For each variable write a console log statement that that logs the value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console.log, remove one 'that'

Comment thread Week1/MAKEME.md Outdated
6.2 For each variable write a console log statement that that logs the value
```js
let foo = 3
console.log('My the value of my variable foo is: ' + foo)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'My the...' -> 'The

Comment thread Week1/MAKEME.md Outdated
let foo = 3
console.log('My the value of my variable foo is: ' + foo)
```
6.3 Now write a console.log statement weiring you first explain what you think the _type_ of your variables is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weiring -> wherein?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! difficult word!

Comment thread Week1/MAKEME.md Outdated
```js
let x = 9;
let y = 'Hello';
let x = 9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW are we doing semicolons or not? I remember from last discussion (don't remind Mauro) that we decided to use semi-colons, although I don't use them myself. Strongest supporter for semicolons was Rob but he out of the picture for the time being. The book that is on the reading list (Speaking JavaScript) actually recommends semicolons.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added semicolons :)

Comment thread Week1/MAKEME.md Outdated
* Can you compare inifities? (Not in Eyad's world) - does 6/0 == 10/0? How can you test this?
9. Write a program to answer the following questions:
7.1 Can you store multiple types in an array? Numbers and strings?
7.2 Can you compare inifities? (Not in Eyad's world) - does 6/0 == 10/0? How can you test this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== -> ===

…ented feedback from Jim about ;'s and language
@mkruijt
mkruijt requested a review from joostlubach October 25, 2017 13:15
Comment thread Week1/MAKEME.md Outdated
4.7 Log your new array!
4.8 Now add Gijs's favorite animal to the array (moose), but make sure it will be placed after the first animal that you have placed in your array.
4.9 Write a console.log statement in which explain what _you think_ the new value of the array is.
4.10 Log your new new array!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new new -> new

@fversnel fversnel left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that we let them go through the mechanical part of creating and inspecting variables. I agree with Jim we should let the students name the variables themselves as naming is quite fundamental to writing readable code. They don't have to come up with good names at all yet at this stage, but let them come up with something

@mkruijt
mkruijt merged commit c1b160c into HackYourFuture:master Oct 29, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants