scott.tolksdorf@gmail.com
Been coding for 15 years, professionally for 10
Computational Math at UW
Web Lead at Thalmic Labs
Likes to build neat things
Intro - What is coding? What are languages?
Tools and Tips
Project 1: Automating your computer with Autohotkey
Fundamentals of Programming - Functions, variables, data structures oh my!
Project 2: Crunching data with Python
Project 3: Loving APIs with Javascript
Good intro to coding
Take home some sample projects
Get exposed to how programming can help you
Answer some burning questions
Have fun and build cool things
You won't be a programmer in a day
It can't solve everything
Not covering anything advanced, like R
Not overly easy, prepare to have some frustrations
https://github.com/stolksdorf/BGSAWorkshop
Suitable text editor (Sublime, textmate, notepad++)
Autohotkey installed (Windows only)
Python Installed
Google and Stackoverflow are your friends
Rubber ducking
Syntax is ruthless, have a friend help
Test often
Variable names and comments
//variables are buckets where you store data
testResult = 0
testResult = testResult + 5
//Strings are just text
myName = "Scott Tolksdorf"
//Numbers are, well, numbers
currentAge = 26
//Booleans can only ever be True or False
isTeachingAWorkshop = true
//Nil, undefined, or null (language dependent) is used when a variable has never been given a value
theLoniestVariable
errorTime = theLoniestVariable + 6
//Arrays are ordered lists of other variables
myFavNumbers = [3, 13, 42]
mixedTypes = [true, "this is neat", 45]
mixedTypes[1] == "this is neat"
mixedTypes.push("new value")
//Objects are used for key-value data, like a phonebook, or an encyclopedia
scott = {
name : "Scott Tolksdorf",
age : 26,
isCurrentlyTalkingAboutObjects : true
}
print scott.name
scott.age + 6
//Combining collections and atomic types allows you to create useful structures
potluckInfo = {
date : '5/28/2015',
attendants : [
{
name : "Bill",
hasPlusOne : true,
contributing : ['dessert', 'plates']
},
{
name : "Sally",
hasPlusOne : false,
contributing : ['main']
}
]
}
potluckInfo.attendants[1].name // -> Sally
//Functions allow you wrap up code and call it
sendGreeting = function(){
print "Hello World"
}
sendGreeting()
add = function(x,y){
return x + y
}
add(4,5) // -> 9
add(add(1,3), 5) // -> 9
//Looping (for, each, map) allows us to run code over items in a collection
sum = function(listOfNumbers){
result = 0
for(num in listOfNumbers){
result = result + num
}
return result
}
print sum([1,2,3]) // -> 6
That was fun.