1 computer programming. users vs. designers which are you?which are you? which do you want to...

22
1 Computer Computer Programming Programming

Upload: brett-pope

Post on 29-Dec-2015

217 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

1

Computer Computer ProgrammingProgramming

Page 2: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Users vs. DesignersUsers vs. Designers

• Which are you?Which are you?

• Which do you want to be?Which do you want to be?

• Do you ever wonder – how does it work?Do you ever wonder – how does it work?

This class will introduce you to the way This class will introduce you to the way software works and you will move from software works and you will move from user to designer as the semester moves user to designer as the semester moves on.on.

2

Page 3: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Computer ProgrammingComputer Programming

• What is computer programming?What is computer programming?

3

Page 4: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Computer ProgrammingComputer Programming

• What is computer programming?What is computer programming?– Process of writing, testing, debugging, and Process of writing, testing, debugging, and

maintaining the source code of computer maintaining the source code of computer programs.programs.

4

Page 5: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Computer ProgrammingComputer Programming

• Where does code come from?Where does code come from?

5

Page 6: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Computer ProgrammingComputer Programming

• Where does code come from?Where does code come from?– Written in a programming language from Written in a programming language from

scratchscratch– Modified from existing codeModified from existing code

6

Page 7: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Computer ProgrammingComputer Programming

• Why do we do it?Why do we do it?– To create a program that performs a desired To create a program that performs a desired

behavior.behavior.

• There is some debate as to whether There is some debate as to whether programming is an art, a craft, or an programming is an art, a craft, or an engineering discipline.engineering discipline.

7

Page 8: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Computer ProgrammingComputer Programming

• Programmers work to create code that is Programmers work to create code that is efficient (works without draining current efficient (works without draining current resources) and evolvable (can become resources) and evolvable (can become something bigger in the future)something bigger in the future)

• Programmers are generally given a list of Programmers are generally given a list of requirements and then work to translate requirements and then work to translate those requirements into something the those requirements into something the computer can understand.computer can understand.

8

Page 9: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Computer ProgrammingComputer Programming

• Programming is often compared to following a Programming is often compared to following a recipe.recipe.

• Programming is about giving the computer step by Programming is about giving the computer step by step instructions to go about completing the task.step instructions to go about completing the task.

• The instructions generally take the form of:The instructions generally take the form of:– a direct statementa direct statement

– a conditional statementa conditional statement

– a link to a group of statementsa link to a group of statements

– a loop around statements meant to be repeated for a loop around statements meant to be repeated for some amount of time.some amount of time.

9

Page 10: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Pizza Dough Recipe Pizza Dough Recipe (Requirements)(Requirements)

1. Gather Ingredients1. Gather Ingredients2. Combine sugar (1tbs), salt 2. Combine sugar (1tbs), salt

(1tbs), olive oil (1tbs), flour (1c) (1tbs), olive oil (1tbs), flour (1c) in mixing bowlin mixing bowl

3. Turn on mixer3. Turn on mixer4. Add 1/4 cup of flour4. Add 1/4 cup of flour5. If dough comes off the sides go 5. If dough comes off the sides go

to step 6, otherwise go back to to step 6, otherwise go back to step 4step 4

6. Knead 15 minutes6. Knead 15 minutes7. Let rest for at least 45 minutes in 7. Let rest for at least 45 minutes in

warm areawarm area

1 dough ball1 dough ball

Page 11: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

N-Pizza Dough ProgramN-Pizza Dough Program• Gather IngredientsGather Ingredients• Combine sugar (N tbs), salt (N Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) tbs), olive oil (N tbs), flour (N c) in mixing bowlin mixing bowl

• Turn on mixerTurn on mixer• Add N/4 cup of flourAdd N/4 cup of flour• If dough comes off the sides If dough comes off the sides

go to step 6, otherwise go go to step 6, otherwise go back to step 4back to step 4

• Knead 15 minutesKnead 15 minutes• Let rest for at least 45 minutes Let rest for at least 45 minutes

in warm areain warm area

N dough ballsN dough balls

Page 12: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

N-Pizza Dough ProgramN-Pizza Dough Program• Gather IngredientsGather Ingredients• Combine sugar (N tbs), salt (N Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) tbs), olive oil (N tbs), flour (N c) in mixing bowlin mixing bowl

• Turn on mixerTurn on mixer• Add N/4 cup of flourAdd N/4 cup of flour• If dough comes off the sides If dough comes off the sides

go to step 6, otherwise go go to step 6, otherwise go back to step 4back to step 4

• Knead 15 minutesKnead 15 minutes• Let rest for at least 45 minutes Let rest for at least 45 minutes

in warm areain warm area

Sequence of Sequence of

StatementsStatements

N dough ballsN dough balls

Page 13: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

N-Pizza Dough ProgramN-Pizza Dough Program• Gather IngredientsGather Ingredients• Combine sugar (N tbs), salt (N Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) tbs), olive oil (N tbs), flour (N c) in mixing bowlin mixing bowl

• Turn on mixerTurn on mixer• Add N/4 cup of flourAdd N/4 cup of flour• If dough comes off the sides If dough comes off the sides

go to step 6, otherwise go go to step 6, otherwise go back to step 4back to step 4

• Knead 15 minutesKnead 15 minutes• Let rest for at least 45 minutes Let rest for at least 45 minutes

in warm areain warm area

N dough ballsN dough balls

VariableVariable

Page 14: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

N-Pizza Dough - ProgramN-Pizza Dough - Program• Gather IngredientsGather Ingredients• Combine sugar (N tbs), salt (N Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) tbs), olive oil (N tbs), flour (N c) in mixing bowlin mixing bowl

• Turn on mixerTurn on mixer• Add N/4 cup of flourAdd N/4 cup of flour• If dough comes off the sides If dough comes off the sides

go to step 6, otherwise go go to step 6, otherwise go back to step 4back to step 4

• Knead 15 minutesKnead 15 minutes• Let rest for at least 45 minutes Let rest for at least 45 minutes

in warm areain warm area

ConditionalConditional

Page 15: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

N-Pizza Dough - ProgramN-Pizza Dough - Program• Gather IngredientsGather Ingredients• Combine sugar (N tbs), salt (N Combine sugar (N tbs), salt (N

tbs), olive oil (N tbs), flour (N c) tbs), olive oil (N tbs), flour (N c) in mixing bowlin mixing bowl

• Turn on mixerTurn on mixer• Add N/4 cup of flourAdd N/4 cup of flour• If dough comes off the sides If dough comes off the sides

go to step 6, go to step 6, otherwise go back to step 4otherwise go back to step 4

• Knead 15 minutesKnead 15 minutes• Let rest for at least 45 minutes Let rest for at least 45 minutes

in warm areain warm area

SubroutinesSubroutines

Mini-programsMini-programs

N dough N dough ballsballs

Page 16: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Programming LanguagesProgramming Languages

• There are hundreds of different There are hundreds of different programming languages.programming languages.

• A few basic types of instructions appear in A few basic types of instructions appear in all of themall of them– Input (get input from the user)Input (get input from the user)– Output (display data to the user on a monitor or printout)Output (display data to the user on a monitor or printout)– Math (perform basic mathematical operations)Math (perform basic mathematical operations)– Conditional Execution (check for conditions and execute the Conditional Execution (check for conditions and execute the

appropriate sequence of statements)appropriate sequence of statements)– Repetition (perform some sequences of statements repeatedly)Repetition (perform some sequences of statements repeatedly)

16

Page 17: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Programming BenefitsProgramming Benefits

• What do students learn through programming?What do students learn through programming?– Mathematical and computational ideasMathematical and computational ideas

• Coordinates, Variables, Random NumbersCoordinates, Variables, Random Numbers– Problem solving skillsProblem solving skills– Process of DesignProcess of Design

• Idea->Prototype->Experiments->Debugging->Redesign-Idea->Prototype->Experiments->Debugging->Redesign->New Ideas>New Ideas

– Fluency with Digital TechnologyFluency with Digital Technology• To be fluent in language, you learn to read AND write – how To be fluent in language, you learn to read AND write – how

to express yourself in the language. The same is true of to express yourself in the language. The same is true of programming – using the computer not just to interact but to programming – using the computer not just to interact but to create.create.

17

Page 18: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

ProgrammingProgramming

• Many see programming as a tedious, Many see programming as a tedious, specialized activityspecialized activity

• Traditional programming languages can Traditional programming languages can be difficult to learn at first.be difficult to learn at first.

• Recent developments have worked to Recent developments have worked to create graphical programming languagescreate graphical programming languages– Makes programming more engaging and Makes programming more engaging and

accessible to those first learningaccessible to those first learning

18

Page 19: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Graphical ProgrammingGraphical Programming

• We will begin our programming We will begin our programming experiments with a language called experiments with a language called “Scratch”“Scratch”

• Scratch is a graphical programming Scratch is a graphical programming language where you drag and drop language where you drag and drop concepts and link them together like you concepts and link them together like you used to connect Lego blocks as a child.used to connect Lego blocks as a child.

19

Page 20: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

ScratchScratch

• Scratch allows students to create complex Scratch allows students to create complex projects but is easy to learn.projects but is easy to learn.

• Scratch mixes different types of media Scratch mixes different types of media clips (graphics, music, instructions) in clips (graphics, music, instructions) in creative ways.creative ways.

• The name came from the “scratching” The name came from the “scratching” technique used by hip-hop artists who mix technique used by hip-hop artists who mix music clips in creative ways.music clips in creative ways.

20

Page 21: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

ScratchScratch

• You can download scratch for free from You can download scratch for free from the Internet and learn more about it the Internet and learn more about it through their website at:through their website at:

http://scratch.mit.edu/

21

Page 22: 1 Computer Programming. Users vs. Designers Which are you?Which are you? Which do you want to be?Which do you want to be? Do you ever wonder – how does

Until next time…Until next time…

• Purchase your text books if you have not Purchase your text books if you have not already done so.already done so.

• Skim through chapters 1 and 2 – READ Skim through chapters 1 and 2 – READ Chapter 3.Chapter 3.

• If you want, download and install Scratch If you want, download and install Scratch on your own personal computer/laptop. on your own personal computer/laptop. You can also use the version in the lab You can also use the version in the lab here.here.

22