Вы находитесь на странице: 1из 4

DIG 3480 (Computer as a Medium)

Prof. H. Adam Lenz


Elements of Coding for Media (better tittle for the class)
No book needed (though Learning a!ascri"t b# $%&eill# is su""lementar#... has a rhino on its co!er)
most of the reading 'ill be online articles
H(ML Pocket &eference 'ouldn%t hurt either
)rade *reakdo'n
+ home'ork assignments
Lab "artici"ation is + "oints (lose , "oint for each lab missed)
Pro-ects . /,+ 0 12 "oints
. o"en note 3uizzes ./+ 0 ,2
Midterm ,2
4inal ,+
5oft'are Needed
6ebugging soft'are
Cisco 7PN client
4ilezilla
(erminal a""
5ublime (e/t or 6ream'ea!er
5lides are online ('ebcourses8 files8 lectures)
Notes
a!ascri"t
a client side "rotot#"e9based scri"ting language that is d#namic8 'eakl# t#"ed and has first9 class
functions
uses the document ob-ect model
Processing
"rogramming language
*uilding on the a!a "rogramming language
:hat is the bro'ser
a 'eb bro'ser is a "rogram that reads html ser!ed to it from a file8 or in most cases a ser!er
#ou need to kno' some html in order to interact 'ith it
*asic H(ML
H(ML is a marku" language used to dis"la# te/t8 images8 and other elements in a bro'ser
:hat is C$6E;
Programming
<sed to create a lo'er le!el Program8 'hich uses com"uter resources to function
Scripting
<sed to create a scri"t 'hich controls the beha!iors of a "rogram
ust like an actor reads a scri"t
=ntro to Programming and 5cri"ting
Programming Languages
C > C??
a!a (different than a!ascri"t)
*A5=C
$b-ecti!e9C
Processing
5cri"ting Languages
EMCA5cri"t (Euro"ean Com"uter Manufacturers Association)
a!ascri"t
Action5cri"t
A""le5cri"t
PHP
P#thon
Perl
5o 'hat%s the difference;
(he interaction 'ith the end user is the same
s#nta/ is different
but first 'e must tackle the bigger issue... Logic
Logical 4lo'
5e"arating the "arts of a "rogram into "ieces that are ordered in a defines and "redictable control flo'
Control flo' the order that "arts of the "rogram are e/ecuted
(o the user
this all -ust looks like a m#stical black bo/
(he "arts Com"onents of structured "rogramming
5tatements a single line of code
*locks multi"le statements.
5e3uences statements are e/ecuted in the order it is recei!ed (to"9to9bottom)
Com"le/ se3uences blocks are e/ecuted in the order it is recei!ed (to"9to9bottom)
*ranches also kno'n as conditionals. (he "rogram needs to make a decision about 'hat code gets
e/ecuted ne/t
Loo" code is e/ecuted re"eatedl# until some condition is met
4unctions a mini "rogram that runs inside of #our code. <sed to store statements that need to be
e/ecuted multi"le times throughout a "rogram8 but not necessaril# consecuti!el# e/ecuted
6on%t code first8 Pseudo9Code
:hat is a!a5cri"t stuff again;
Made in ,@@+
Created b# *rendan Eich
N$( A7A
A5 had to ook like a!aonl# less so8 be a!a%s dumb kid brother or bo#9hostage sidekick. Plus = had
to be done in ten da#s or something 'orse than 5 'ould ha!e ha""ened.B
=dentifiers and 7ariables
=dentifiers 0 'ords that are used to declare !ariables and constants8 these are created b# #ou
5hould be descri"ti!e of 'hat the# mean and 'hat contain
(he# are case9sensiti!e
Can%t contain s"aces
Can%t start 'ith numbers
6eclaration the act of attaching meaning to an identifier
7ariable 5co"e
!ariable !ars ! Pro"erties
)lobal !ars ! local !ars
4lag !ars
Public ! Pri!ate
5im"le data t#"es 5(&=N)5 in 5
zero or more characters
letters8 numbers "unctuation8 s"aces
strings are enclosed in 3uotes
in 5 single or double -ust be consistent
ANC(H=N) enclosed in 3uotes is also a string
5im"le data t#"es N<M*E&5 in 5
integers 'hole numbers (no decimals)
floats rational numbers (decimals)
Numbers are not enclosed in 3uotes
*ooleans
the most sim"le of all data
true or false 0 2 or ,
can get confusing
strings and numbers can be e!aluated as booleans
Naming Con!entions for 7ariables and More
&emember no s"acesDDDDD
Hungarian Notation 'ords are s"lit 'ith underscore
camelCase the first 'ord is an identifiers starts 'ith a lo'ercase letter
$"erators
arithmetic
?9E>
Concatenations
'hen used 'ith t'o strings8 ? combines the t'o strings
$rder of $"eration
Please E/cuse m# 6ear Aunt 5all# "arentheses8 e/"onents8 multi"lication8 di!ision8 addition8
subtraction
<nar#
??increment o"erator
99decrement o"erator
E3ualit# and Conditionals
<sing if8 else if8 or else8 'e must define something to be true or false
returns booleans
=dentit#
000 are t'o !alues identical;
$nl# if their data t#"es and !alues are e3ual
Logical And
FF 9 And
'ill check if both !alues are true
Logical 9 $r
GG 9 $r
*ut 'hat about the user;
Plan for #our users to not think like #ou
if a user can break it the# 'ill
use console.log to see errors in a 5 console

Вам также может понравиться