After dinner, Cate asked if we can continue to learn about computer programming. I told her I would love nothing more.
I told her that I will teach her HTML, Hypertext Markup Language and Javascript. HTML is what designers use to control how a page looks like in Firefox. Javascipt let the programmer add interactivity.
I show her a bit of HTML source code and open and close tags. Some sample tags like <b> and <font> and the tag to start telling the computer that we are about to start writing javascript
So we reviewed the few simple reserved words like
var
To declare a variavble
while
A loop that stops when an expression is false. 0, false or null is false, anything else is true.
for(initiator, conditional; increment)
A loop with an initiator, conditional and increment
new
To create a new object. An object has state and methods or actions.
wondow.alert
To display a message to the programmer or user
We added tonight
int
To declare an integer which is a non-decimal. So 2, 8, 66 are integers while 9.6 is not.
if ... then...
Conditionals that will only do something if an expression is true
We then talked about ++ and += and went throaugh examples like
var x=2
x ++
window.alert(x)
I found a small tutorial on the window object.
we looked at and played with an example
window.alert()
Used to display a simple message
window.prompt()
Used to ask for input from the user
wndow.confirm()
Used to ask for a yes or no type of answer.
Then at night she wanted me to review what we learned. As she was falling asleep, I talked with her about the syntax of the Javascript keywords, talked about how we can build loops using for, and 5 minutes later she was asleep.
—-
This is a series that documents my daughter’s curiosity to learn about computer programming
—-
Leave a Reply