introduction to coding

59
Introduction to Coding

Upload: chad-mairn

Post on 25-Jan-2017

1.559 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Introduction to Coding

Introduction to Coding

Page 2: Introduction to Coding

Agenda:•  Understand how computers work and learn basic computer programming concepts (e.g., variables, syntax etc.)

• Gain an appreciation of the various programming languages and study what they can do.

• Develop a resource list of computer programming tutorials and tools.

• Become inspired to learn programming basics to help you work smarter and more efficiently.

Page 3: Introduction to Coding

Is coding a cryptic visual of typed languages?

Or a process? Or both?

Page 4: Introduction to Coding

Computer programming has a reputation of being cryptic and too complex for the average person; however, when you get familiar with basic programming logic you 

will see patterns everywhere!

Page 5: Introduction to Coding

What is computer programming?• A set of commands a computer understands – like a recipe. 

• Computer programs can help cure diseases; drive cars; create video games; make animated movies/graphics; build websites and apps; and much more. • Basic coding concepts are used by most every program and most every programmer.

• To learn more visit http://www.bfoit.org/itp/Programming.html 

Page 6: Introduction to Coding

Why learn to code?• Why not? • Learn the importance of clarity/brevity of expression. • Be able to think and problem solve more accurately.• Have a better understanding of how technology works. • Create a tool that can make your life and many others’ lives easier.

Page 7: Introduction to Coding

Read more at http://goo.gl/Hgy16A

Page 8: Introduction to Coding

“It has often been said that a person does not really understand something until he teaches it to someone else.  Actually a person does not really understand something until after teaching it to a computer, i.e., express it as an algorithm.” 

Donald Knuth, in American Mathematical Monthly

Page 9: Introduction to Coding

Describe in natural language how to make a peanut butter and jelly sandwich.

Page 10: Introduction to Coding

Some great resources to help you learn to code

Page 11: Introduction to Coding

.com

Learn to code interactively, for free.

Page 12: Introduction to Coding

http://www.oeconsortium.org/ 

Page 13: Introduction to Coding

https://www.coursera.org/ 

Page 14: Introduction to Coding

https://www.codeavengers.com/ 

Page 15: Introduction to Coding

https://www.khanacademy.org 

Page 16: Introduction to Coding

https://teamtreehouse.com/

Page 17: Introduction to Coding

https://www.codeschool.com/ 

Page 18: Introduction to Coding

http://coderdojo.com

Page 19: Introduction to Coding

Some Other Coding Resources• Lightbot is a programming puzzle game that gives the user a one-to-one relationship with programming concepts. Try it today at http://light-bot.com/!

• Hopscotch: Coding for Kids is an iPad programming language. Download it today at https://www.gethopscotch.com/ .• Code.org wants to bring Computer Science classes to every K-12 school. Check it out at http://code.org/ and find some excellent computer programming tutorials.

• Scratch helps children create stories, games, animations, and also lets them share these projects with others around the world.  More info at http://scratch.mit.edu/.

• www.scratchjr.org  is a free iPad app that brings coding to students as young as age five.  • www.kodable.com gives children opportunities to program in order to solve puzzles. http://www.allcancode.com is similar.

• Visit Medium for a “2 minute read” listing other ideas and resources to help inspire children and teens to code. 

• There are several MOOCs (Massive Open Online Course) and other freely available resources that offer computer programming classes. Coursera, Udacity, and Edx are great examples. Also, Khan Academy has some great resources for kids and adults too!

• A Google search query for computer programming resources for kids limited to the last year can be found at http://goo.gl/RaUups. 

Page 20: Introduction to Coding

What is a programming language?• A programming language is set of rules that provides a way of telling a computer:• What operations to perform• Communicating an algorithm• Receives an input from the user and generates an output.

• A programming language is a system for describing a computation (math) or algorithms (logic) in a machine-readable and human-readable form.• Has words, symbols, and grammatical rules (natural language)

• Grammatical rules = Syntax• Each language has a different set of syntax rules

• Has semantics (meaning)

Slide courtesy of Brian Pichman

Page 21: Introduction to Coding

Tons of example code in the Arduino IDE (Integrated Development

Environment)

Page 22: Introduction to Coding

Raspberry Pi (Python) programming

Blinking LED code at: http://goo.gl/O3yozd

Page 23: Introduction to Coding

.org/downloadshttps://www.

Page 24: Introduction to Coding

Python Shell is where you enter commands and/or lines of code.

At the prompt type: print(“Hello, world!”)

Page 25: Introduction to Coding

IDLE - Integrated DeveLopment Environment)

# is a comment and the computer ignores it.The second line asks the user to enter their name and remembers it as "name.” This is a variable!The third line is a print statement, which prints the stored name.

Page 26: Introduction to Coding

demos

2.

1.

Page 27: Introduction to Coding

A Few Basic Programming Components (pretty much regardless of language)

• Variables & Arrays• Operators• Flow Control• Functions

Slide courtesy of Brian Pichman

Page 28: Introduction to Coding

Variables & Arrays

• A variable is a bucket that holds one piece of information. A variable can change value when• Specific conditions are met• Based on user input

• Examples (concept)• $string_myhomelibrary = “Montgomery Library”;• $numeric_variable= 100;• $myname = “Brian”;

Slide courtesy of Brian Pichman

Page 29: Introduction to Coding

Variables & Arrays

• An array is a type of variable (or bucket) that holds many pieces of information.

• Example (language doesn’t matter here; the concept does):• $FavoriteCities = array(“Orlando”, “Boulder”, “Miami”)• $FavoriteCities[0]  holds “Orlando”

• $FavoriteCities [1] holds “Boulder”

• $States = array(“1” => “Prime”; “FL”=> “Florida”, “CO” => “Colorado”)• $States[“FL”] holds “Florida”

Slide courtesy of Brian Pichman

Page 30: Introduction to Coding

Operators

• Arithmetic    +, -, *, / (add, subtract, multiply, divide)

• Assignment = (assign the value of 2 to the variable called v)$v = 2;

+= (“Add the value of 3 to the variable that already holds 1”)$v += 3; // $a now holds 5

Slide courtesy of Brian Pichman

Page 31: Introduction to Coding

Flow Control - Sequence• Reads like a book, the instructions are executed in the same order they where given:• OPEN the door• WALK inside the room• SIT on a chair• PICKUP a book• READ the book.

Slide courtesy of Brian Pichman

Page 32: Introduction to Coding

Flow Control - Choice• If Then 

if (something is true/conditions are met) {then do this

}• If Then Else• Else: XYZ• Starts the same as “If Then” but allows a result if condition is false

• Else If  if (something is true/conditions are met) {

then do this } elseif (another something is true/conditions are met) {then do this instead

Slide courtesy of Brian Pichman

Page 33: Introduction to Coding

Flow Control - Continual• With continual, instructions are executed based on variables, commands, outputs, etc … as they remain true

• While (or repeat)while (something is true) {do something here

}

• forfor (something is true) {do something here

Slide courtesy of Brian Pichman

Page 34: Introduction to Coding

Flow Control – Putting It Together• 1) Sequence

• Go to the library• Check out a book• Read the book• Return the book 

• 2) Choice• If you have a library card, you can check out books. Otherwise open a library card account.

• 3) Repeat• Continue to read the book till there are no more pages. 

Slide courtesy of Brian Pichman

Page 35: Introduction to Coding

Functions• A function is type of procedure or routine and usually returns a value.• A procedure preforms an operation, but typically doesn’t provide a value.

• Most languages have pre-built or pre-defined functions in its library. • For instance, the “delete” function means to “remove”. You don’t have to code what “remove” does; only what to remove. 

Defining a function in Python

Page 36: Introduction to Coding

Download it for free and get great handouts at http://raptor.martincarlisle.com

RAPTOR is a flowchart-based programming environment.

DEMO

Page 37: Introduction to Coding

FORTRAN• FORmula TRANslation.• Developed at IBM in the mid-1950s.

• First programming language• Designed for scientific and mathematical applications by

scientists and engineers.

Traditional Programming Languages

Slide courtesy of Brian Pichman

COBOL• COmmon Business Oriented Language.• Developed in 1959.• Typically used for business applications.

Page 38: Introduction to Coding

BASIC• Beginner’s All-purpose Symbolic Instruction Code.• Developed at Dartmouth College in mid 1960s.• Developed as a simple language for students to write

programs with which they could interact through terminals.

Traditional Programming Languages (cont’d.)

Slide courtesy of Brian Pichman

C• Developed by Bell Laboratories in the early 1970s.• Provides control and efficiency of assembly language • Often used for system programs.• UNIX is written in C.

Page 39: Introduction to Coding

C++• It is C language with additional features.• Widely used for developing system and application software.• Graphical user interfaces can be developed easily with visual

programming tools.• Windows Based

Object-Oriented Programming Languages

Slide courtesy of Brian Pichman

JAVA• An object-oriented language similar to C++ that eliminates lots

of C++’s problematic features • Allows a web page developer to create programs for applications,

called applets that can be used through a browser.• Objective of JAVA developers is that it be machine, platform and

operating system independent.

Page 40: Introduction to Coding

• Scripting Languages• JavaScript and VBScript• Php and ASP• Perl and Python

• Command Languages• sh, csh, bash, cmd

Special Programming Languages

Slide courtesy of Brian Pichman

Page 41: Introduction to Coding

• HTML• HyperText Markup Language.• Used on the Internet and the World Wide Web (WWW).• Web page developer puts brief codes called tags in the page

to indicate how the page should be formatted.• XML• Extensible Markup Language.• A language for defining other languages.

Special Programming Languages

Slide courtesy of Brian Pichman

Page 42: Introduction to Coding

What do you want to make?

Page 43: Introduction to Coding

Source: https://www.udemy.com/

Page 44: Introduction to Coding

Source: https://www.udemy.com/

Page 45: Introduction to Coding

Source: https://www.udemy.com/

Page 46: Introduction to Coding

Source: https://www.udemy.com/

Page 47: Introduction to Coding

Other ways to learn coding

Page 48: Introduction to Coding

http://getfirebug.com/

See how things on the Web work behind the scenes using …

Page 49: Introduction to Coding

SCRATCH Basics

.mit.edu

 Scratch is a programming language for everyone. Create interactive stories, games, music and art and share them online.

Page 50: Introduction to Coding

Finch Robot, ca. $100

http://www.finchrobot.com/

Page 51: Introduction to Coding

Ozobot, ca. $60 

http://www.ozobot.com/

Page 52: Introduction to Coding

Lego WeDo / Lego Mindstorms 

Page 53: Introduction to Coding

Sphero – ca. $130

http://www.sphero.com/

Page 54: Introduction to Coding

Dash and Dot, ca. $149

https://www.makewonder.com/

Page 55: Introduction to Coding

Interact with the real world using the Tickle App

https://tickleapp.com

Learn to program Arduino, drones, robots, connected toys, and smart home devices, all wirelessly.

Page 56: Introduction to Coding

Hopscotch App

https://www.gethopscotch.com/

Page 57: Introduction to Coding

pinocc.io, ca. $197

Page 58: Introduction to Coding

http://www.slideshare.net/chadmairn

@cmairn

Page 59: Introduction to Coding

Want to Hangout?

gplus.to/chadmairn