Alvin Kato
A silent rebel
We program because of limitations in terms of brain power.
You have done it for a week now
Programming is data and operations on data
Let's code :)
Let's get to know our objectives first
Since data varies its important to categorize data into types
1 + 1
--> 2
"String"
--> String
A symbol or name for referencing a stored value.
ego = "I am the best ruby programmer in the world"
hater = "Shut up you ego centric maniac"
That behaviour is referred to as a method.
"String".reverse
--> gnirtS
puts "Hello world!"
--> Hello World!
In ruby if you want to see all behaviours of a data type, use .methods method
Formats for organizing and storing data in a way so that it can be used efficiently
Text
miami = [ 'Wade', 'Bosh', 'Haslem', 'Cole', 'Chalmers']
heat = ['Dwayne', 'Chris', 'Udonis', 'Norris', 'Mario']
Use arrays when the order of data matters
Text
miami = {'Wade' => 'Dwayne', 'Chris => 'Bosh', 'Haslem' => 'Udonis'}
Use hashes for key, value situations.
No more slides after this :)
By Alvin Kato
Basic intro to ruby and programming