Lesson 1

A cup of code

Software Requirements

Javascript Platform - Node

IDE - Atom

A Better Console - ConEmu

The Best - GitHub

Digital Engineering

Using a program is a lot like

  • Riding a bike
  • Driving a car
  • Toasting some bread

Digital Engineering

Programming is a lot like

  • Building a bike
  • Building a car
  • Building a toaster

Making A sandwich

Write down the steps to make a PBJ

Think like a programmer

1. Take a slice of bread
2. Spread peanut butter
3. Spread jelly
4. Put a slice of bread on top

Making A sandwich

Being Exact

1. Remove 1 slice of bread from loaf

2. Open jar of 'peanut butter'
3. Insert knife into 'peanut butter'
4. Scoop a knife-full of 'peanut butter' out of jar
5. Press 'peanut butter' side of knife softly onto face of bread
6. Spread 'peanut butter' evenly across slice of bread

7. Repeat steps 2 through 7 for 'jelly', once, on same surface as 
peanut butter

8. Remove 1 slice of bread from loaf
9. Place newly removed slice of bread onto face of PBJ 

What Do You Mean?

Lets code a toaster

Inputs:
Bread



Outputs:
Toast
Function:
When slider pressed down, turn on heat

After:
A certain length of time, pop up toast

Coading A TOASTER

class Toaster{

    this.bread = false;
    this.timer = 10;
    this.heat = "off";

    constructor(bread){
        this.bread = bread;

        when("push lever", toast());
    }

    toast(){
        this.heat = "on"
    
        after(this.timer, ejectToast());
    }

    ejectToast(){
        this.heat = "off";
        this.bread = false;
    }

    setTimer(timer){
        this.timer = timer;
    }

}

Programming Is Important

Why do people program?

It lets us tell a computer what to do...

Please show me directions to the nearest strip club,
Please fold these proteins so I dont get 'insert disease here'
Please create a map of my house so I dont get lost

So that it can solve problems for us.

I want to drive fast in the rain/on snow
I want to recieve 20lbs of cheese puffs the day after I order it online
I want to watch a show on-demand, while taking a crap

The world of software

Different types of environments

Desktop Applications

Mobile "Apps"

Car Traction Control, Microwave, Home Theromstat

IMDB, Evernote, Youtube,
Flappybird, WhatsApp

Embeded Systems

Photoshop, Chrome, VLC, Skype, etc

Web Applications

Youtube, Wolfram|Alpha, Netflix, Pandora

The world of software

Different types of languages

Machine languages

Tedious and error-prone.

Operand Code - addition and subtraction
​Operands - identity what (in memory) needs to be processed

High-Level Languages

Abstraction of machine code

Readable by humans
Offers organization and structure
Various different ways of doing the same/similar things 
100011 00011 01000 00000 00001 000100
becomes
Take 3 add 17 log result
100011 00011 01000 00000 00001 000100

The world of software

Compiled vs Intrepreted

All high level languages must be broken down into machine code.

Compiled means this process takes place BEFORE we run our program.

Intrepreted means this process takes place AS/WHILE we run our code

Compiled

'C/C++'        //Most desktop applications/games
'Go'           //API Services and Web servers
'Haskell'      //Complex Math (Folding@Home)
'Objective-C'  //iOS Applications
'Python'       //Useful Program Glue

(Usually) faster at run time. Can have complex debugging process, takes time to compile. 

Interpreted

'JavaScript'   //Every website since 2010
'PHP'          //Wordpress
'Ruby'         //Back-end web servers
'Perl'         //Application security
'Lua'          //Useful Program Glue

Not ideal for doing the same thing N number of times. Easier to bug smash (generally)

Which language to learn?

What do you want to do?

Create desktop apps...

C/C++, VisualBasic, JavaScript

Create mobile apps...

Objective-C, Swift, JavaScript

Server-side apps...

PHP, Ruby, Go, JavaScript

Websites & Web apps...

JavaScript, PHP, Ruby, Java

Work with data...

Lua, Haskell, C, JavaScript

Build a robot slave army...

Haskell, C, BASIC, Erlang

Which language to learn?

JavaScript is everywhere

The language of the internet (HTML5, CSS3, JavaScript) is 

expanding, as most applications are moving into the cloud.

Adobe Creative Cloud, 
Google Docs,
Dropbox,
PlayRetroGames.com

Their main language? JavaScript

JavaScript

It’s Easy to Get Started

JavaScript is the easiest language to start learning with since there’s nothing to install or complex “runtime” environments to configure.

Becoming a Builder: Archaeology vs. Architecture

It’s just more fun to start immediately crafting your own ideas rather than digging through the “best practices” of previous generations.

Its used everywhere

From servers built on NodeJS, to mobile HTML5 apps, to website front-ends, JavaScript is used almost everywhere to do anything you could want to do.

JavaScript - Resources

Watch - An Intro To JS

Lesson 1 - What is programming?

By Mathew Kleppin

Lesson 1 - What is programming?

Enter the world of programming

  • 579