Today is the start of Week 2 at Flatiron. It’s been quite a start to the semester. We spent last week going over Github, Ruby, SQL, and a lot of logic exercises to understand how to think like a computer. It’s interesting because humans understand things organically and semantically, whereas a computer is very literal in its understanding. For example, we as humans make assumptions or calculated decision-making to fill in details about another person or thing. For example, if we see a dog on the street, we assume that it’s a stray dog if it is dirty or has a disheveled appareance. On the other hand, if it is nicely groomed, we may assume that it’s simply lost. Computers have to be given a very specific set of instructions or information regarding something. In the case of the dog, we may have to do something like this: (dog = “stray”).
If dog == “stray” human.do_not_intervene(dog) Elsif dog != “stray” human.intervene(dog) End
That’s a basic if-else statement to illustrate the dog example. Basically, if the dog is a stray, the computer understands this as: “the human should not intervene specifically with the dog.” However, if the dog is not (!=) a stray: “the human should intervene specifically with the dog.”
The logic is simple, but when building programs that have more complex arguments and parameters, it can get a little confusing. Most of my time during the first week was spent experimenting with different loop types and understanding what you can and can’t do with methods, data types (arrays, hashes, strings, etc), and code organization.