6. Becoming a Programmer
It isn’t about the programming language. It is
about changing how you think.
We have to know how the computer thinks to
change how we think.
7. How Computers “Think”
The short answer is that they don’t think.
Computers act as if they think by sequentially
executing simple instructions.
The only things a computer know are the things
we tell it.
8. Pseudo Code
Pseudo code is the process of writing a
program without using the syntax of a
programming language
12. Pseudo Code
Example #2 (Thermostat)
Outline pseudo code for an application that
would monitor the room temperature and adjust
it so that the room remains a certain
temperature.
13. Pseudo Code
Example #2 (Thermostat -- in English)
get the temperature
set the target temperature to 72 degrees
repeat these steps:
get the current temperature
if target temperature > (current temperature + 5), then
turn on the heater
if target_temperature <= current temperature, then
turn off the heater
14. Pseudo Code
Example #2 (Thermostat -- more code-like)
get target_temprature
target_temperature = 72
repeat forever,
current_temperature = get_sensor_reading
if target_temperature > (current_temperature + 5),
turn_on_heater
if target_temperature <= current_temperature,
turn_off_heater
22. What Can JavaScript Do?
Let’s look at a web page example:
~ Google “weather Boston”
23. What Can JavaScript Do?
variables: [ingredients] ???
loops: [repeated steps] ???
conditionals: [if one thing, then do something] ???
functions: [mini-programs] ???
24. Lab
Create pseudo code for the process of ordering
pizza.
Whiteboard the basics.
Work in teams of three.
25. Homework
Watch What Can You Do with JavaScript?
Research Chrome Developer Tools
Create index page for your server workspace