OpenTechSchool / js-beginners-day1

Outdated curriculum for the first day of JSFaB. Use https://github.com/OpenTechSchool/js-beginners-1
31 stars 17 forks source link

The concept of assignment using an equals sign #17

Closed theophani closed 12 years ago

theophani commented 12 years ago

On page 1, Line 155 this statement is made:

“The above program introduces two new concepts: the semicolons, and the use of var.” https://github.com/OpenTechSchool/js-beginners-day1/blob/master/page1.html#L155

However, the program also introduces assignment using an equals sign. The concept is assumed to be understood in the paragraph that begins on Line 168: https://github.com/OpenTechSchool/js-beginners-day1/blob/master/page1.html#L168

Can we add a step (or a remark in this step) about = being used to set a value?

theophani commented 12 years ago

Credit: This suggestion was inspired by http://andy.wordpress.com/2012/05/30/programming-is-not-algebra/, which hit on a confusion I certainly had as a beginner.

marijnh commented 12 years ago

The concept is assumed to be understood in the paragraph that begins on Line 168:

The way I intended it, that paragraph explains the concept, rather than assuming it to be understood.

What do you find unclear about the explanation?

theophani commented 12 years ago

Hrmm, perhaps I'm reading too little into the line. In my mind, it implies that = assigns values without granting that the concept is new.

The sentence for reference: “The = operator can be used at any time to give it a new value, as in the third line of the example.”

I was thinking something such as changing the intro to “introduces three new concepts: the semicolons, the use of var, and the = operator” to hint that while the = looks familiar, it acts differently than you may expect. The only change needed later would be: “to give variables new values”