logic over language

24
UNDERSTAND PROGRAMMING THROUGH PSUEDO-CODE — RENEE BLUNT Logic Over Language

Upload: purple-rock-scissors

Post on 21-Jan-2017

346 views

Category:

Engineering


0 download

TRANSCRIPT

UNDERSTAND PROGRAMMING THROUGH PSUEDO-CODE — RENEE BLUNT

Logic Over Language

Can I learn the codes?

/// Page 14

Focus on what is important

Coding is About Solving Problems

pseu·donot actually, but having the appearance of

Pass out movie tickets for PRPL movie day

P R O B L E M

For every employee that RSVP’d to the movie, give them a ticket

S O L U T I O N

For every employee that RSVP’d to the movie give them a ticket

S O L U T I O N B R O K E N D O W N

For every employee that RSVP’d to the movie give them a ticket

S O L U T I O N B R O K E N D O W N M O R E

For Loop Conditional

Method

Lemme See Dat Code

J A V A S C R I P T P H P

P Y T H O N C #

for (let prplPerson of prplPeople) {

if(prplPerson.rsvp){ Jackie.giveTicket(prplPerson); }

}

foreach ($prplPeople as $prplPerson) {

if($prplPerson->rsvp){ Jackie::giveTicket($prplPerson); }

}

for prplPerson in prplPeople:

if prplPerson.rsvp:

Jackie.giveTicket(prplPerson)

foreach(PRPLHuman prplPerson in prplPeople) { if(prplPerson.rsvp) { Jackie.giveTicket(prplPerson); } }

There’s MoreB U I L D I N G B L O C K S

•What’s a Jackie? •What’s a PRPL People? •How does a PRPL Person RSVP? •Where do the tickets come from? •Uh, what movie?

Make a Jackie

P L A I N L A N G U A G E C O D E Y L A N G U A G E

Is a PRPL employee Is a human Does stuff: • administrative tasks • organizes events • coordinates movie day • makes funnies

Jackie extends PRPL Employee PRPL Employee extends Human Methods: • doAdminThings • organizeEvent • coordinateMovieDay • makeFunny

vs.

Jackie

Make a PRPL Person

P L A I N L A N G U A G E C O D E Y L A N G U A G E

Is a human Has Stuff: • has a ticket • has a job title Does stuff: • goes to a movie • RSVPs to a movie

PRPL Employee extends Human Properties: • ticket (boolean) • job title (string) Methods: • goToMovie • rsvpToMovie

vs.

PRPL Person

Make a PRPL People

P L A I N L A N G U A G E C O D E Y L A N G U A G E

Holds PRPL people How many PRPL people?

Collection/Array/List

Properties: • count Methods: • getCount

vs.

PRPL People

CHECK CHECK

Is This Thing On?B U I L D I N G B L O C K S

•What’s a Jackie? •What’s a PRPL People? •How does a PRPL Person RSVP? •Where do the tickets come from? •Uh, what movie?

Keep Building

http://bfy.tw/5ymq

F U R T H E R R E A D I N G

Renee Blunt ([email protected])

Thanks!PRPL HQ 189 S. Orange Ave., Suite 2020 Orlando, FL 32801

@prplrckscssrs fb.com/prplrckscssrs

www.prpl.rs

Follow PRPL