Week Four: Day 1
Today was a pretty dispiriting day for me, partly from poor/lack of sleep and partly from the course material. I tried to turn the lights off around 10 and mostly succeeded (darn those Duggar repeats on YouTube! It's like a car accident — I can't turn away, despite the horrific scene in front of me), but slept pretty fitfully. I woke up around 5ish as I have the last couple of nights; and because I have my curtains wide open so the sun helps get me up, I also slept really lightly from the darn streetlights casting their obnoxious orange glow onto my walls. I even rearranged my furniture last night, putting my bed near the window so my head would face the opposing wall, but it barely made a difference. Oh wait, there was one improvement: being closer to the window meant I got more of the breeze than I had before, and it's easier to get in from either side because the fireplace and wall unit aren't closing me in anymore.
But never mind the sleep, the material today made me feel stupid and like I'm never going to understand this stuff, like I'll be that rare statistic in this bootcamp who just misses the mark on everything. Tuesday is one of the Coffee & Code mornings, where we show up an hour early to punish ourselves with more code. And in a departure from the usual bits of code we get, we played a game called Ruby Warrior where you have to type code to make your little Super Mario-like warrior through a castle, battling archers and "sludge" monsters along the way.
Except I couldn't get my warrior to move; and when I did (from looking up tips on a website), I got him slaughtered by the sludge monsters ☹ Great start to the morning. Things got worse from thereon-in when we tackled the actual work. Last week, we learned about associations in Rails, which is just a fancy way of saying you write code to link two things together, sort of like linking people and appointments with a clinic doctor instead of having each thing stand separately on its own.
In ActiveRecord for Rails (ActiveRecord is just the "models" part in the "models-view-controller" that's been hammered into our brains when it comes to writing code for apps), there are only six associations (I know they'll mean nothing to most people, but typing them out again helps me remember them):
| belongs_to |
|---|
| has_one |
| has_one :through |
| has_many |
| has_many :through |
| has_and_belongs_to_many |
So, just six associations in Rails. You'd think it'd be pretty easy to learn them and what each of them does, eh? That's what I also thought, until M put up a slide on the projector screens and tested us. It was a summary of an app we worked with last week about pulling out information from a database, like the cheapest track in a certain genre or all the bands/artists that started with a certain letter. And when he asked us which method belong to which category (like tracks or albums), I was at a near-total blank.
We later learned about how to write code to encrypt and protect passwords (note: if a website ever emails you your password and you can see it as a word, un-sign-up from that website right away. It means they store their passwords in plaintext, which makes it easy enough to hack into that Oscar the Grouch can do it). The reading and researching I'd been doing on my own time the last couple of weeks, I thought this lesson would make perfect sense. But as usual, I discovered that there's a lot of stuff going on behind the scenes I was never aware of, let alone had a clue how it worked. Man, computers and the internet are really complex stuff and I'm in awe of everyone who created the stuff we casually browse on a daily basis.
On a bright note, when I was leaving class, I came across this poster taped to a pole.

No comments:
Post a Comment