Saturday, August 30, 2014

MakerSquare Day 4: How to write a test (1/4)

Friday is notable because it's the end of the first week, which means it's the traditional day for a MakerSquare student party. It's interesting to meet the C8 students, the people who were in our spot only six weeks ago, but who seem awfully experienced. Whenever we mention a challenge, they look at each other and nod knowingly. Will we be like that in just a few weeks?

My guess is yes, because it's kind of amazing to think about all the stuff we've been exposed to this week. Friday was, planned or not, a kind of summation day, where we went over some challenges from the week: how to work through algorithm problems, how to design a library*, how to write a test.

As expected, I continue to be roundly beaten at ping pong. I sort of wish we had an A league and a B league; but at the same time, getting beaten by A-league players sure does stretch my skills.

* We designed library from the tests backward: given a bunch of rspec tests, we had to make them all pass by steadily expanding our library's functions. (A failed test comes up in red, a passed test comes up in green; so you'll hear people talking about making the test "go green.") But after thinking about it some more, I think I'm going to spend part of the weekend re-working the library with a few extra classes: a book, a library wrapper, a borrower-card, a library, and a review class. That way I could extend it in various ways: the "book" class could be reused by a book-store; and the library-wrapper class could be used to wrap any other object the library wants to lend.

Friday, August 29, 2014

MakerSquare Day 3: Surrender to the algorithm (1/3)

Theme: Don't worry--except about ping pong

In case you wondered, yes, I take a few notes every day. Or at least, I do when I remember to. The notes for Day 3 include the note "just lots of coding."

Which is like the time I wrote on my calendar "Thursday." I mean, at least I wrote "Thursday" on a Thursday, but... Dear Past Ben: "Thursday" is not a helpful note.

But it's hard to take really interesting notes when you're engrossed in really interesting coding. Which might sound sarcastic to some people--what is "really interesting coding"? But here's something else to add to the list of things I'm nerdy about: science fiction, movies, 19th century history, and Ruby code.

So Day 3 involved practicing with objects: thinking about how many classes you might need to create a really effective library object. Which, honestly, is something I could add to the nerd list: libraries.

That was the morning learning module; the afternoon lesson, after lunch, started with a quick walk around the building before we tackled algorithms. Now, at Bard College, I took a bunch of computer science classes; and I hated algorithms. Hated the subject in the way that you hate things where you don't really remember why you hate, but only remember that you do hate.

So it's an understatement to say that I wasn't looking forward to the subject. Well, that's not quite true; on the first day, we'd heard that our instructor Patrick had an interesting way of working through algorithms, so part of me was looking forward to revisiting algorithms. Maybe now I would like it?

And you know, I kind of did. I mean, we'll see what happens when we get to run-time algorithms--worst-case, best-case, average-case. But here, Patrick's idea of the processor touching each element does make a sort of intuitive sense.

Also, I'm a sucker for any example that uses Legos.

And, let's be honest, no matter how hard algorithms might be, they are not as hard as the ping pong competition in C9.

Thursday, August 28, 2014

MakerSquare Day 2: An Intro to Github and Rspec (1/2)

Theme: Zen and the art of testing

I don't know what will make less sense to people reading this blog: my title or my theme. Or maybe you're a MakerSquare student and you understand it all--as well as the pain behind it.

But for my parents, here's the quick skinny: Git is a version control system that I didn't quite get before but that I'm devoted to now; and Github is a website where you can store all of the versions you've written. So, for instance, let's say you write your code and it works--great! Commit it to Github. 

Then you decide to add some new function and it breaks something in your old code and you don't remember what--well, not that big a problem. Just rollback your program to the last time you committed. In short, Git and Github are great ways to experiment on things without screwing up what you've already got. 

In a similar but completely different vein, rspec is also a very logistical side issue to coding: it's a way to set up a program to test your original code. Which means that, yes, now you have two chances to screw up and twice as much code to debug. But really (say the instructors) it makes a lot more sense to work with rspec rather than to test your program by copying everything over to irb.

(Oh boy, I really should link you to a dictionary site because there's lots of special words here. "Irb" is the interactive Ruby shell, where you can run Ruby right in your terminal.)

Today also involved a visit from Savrut of career services, which was very interesting and full of plans for future events: mock interviews, resume reviews, etc.

Also, he said that any tech company thinking of hiring you would find your online presence, so... Hi!

But I am running out of steam here and I still wanted to note something Nick said today that pinged my sense that coding involves a lot of strange Zen overlaps. (Or Derridean deconstruction, if that's the way you want to take it.) Today's comment (paraphrased):

"You want your code to be broad and very specific."

Wednesday, August 27, 2014

MakerSquare Day 1: "We are your seat belt." (1/1)

Theme: Deep ends and safety nets

First, logistics: I'm going to try to schedule my posts to appear the morning after.

Second: Day 1 was riven--riven, I say!--by one big paradox: we were thrown into the deep end, but told we had a safety net. Or maybe the paradox is more like: learning programming can be intensely rewarding or intensely frustrating. Or put another way, instructor Nick drew a chart of our progress, which would involve sudden breakthroughs and grinding plateaus.

Which was then demonstrated for us--or on us--when we had to do some pretty heavy coding in the afternoon (after preparing our computers). There were some abstract data structure questions that weren't very abstract at all: what's the best way to think about a library? What's the best way to model a book? Would you make those as arrays? Or as hashes?

(Rule of thumb: the answer is almost always "hash" unless order matters.)

But the real work was building a program that could take a plain text file with a recipe (well, a shopping list, really) and parse it into a special class for recipes that--gasp!--we created ourselves. This is one of those lessons where... well, you know when you try to print something and the computer says "Cannot find printer" and you point at the printer and yell, "it's right there!" Well, reading is something that comes pretty easily to us, but that computers need some help with.

So Day 1 basically tossed us into the deep end of Ruby.

But, and here's the contradiction at work, we have a safety net, both in the form of the instructors (Nick, Flip, Patrick, with MakerSquare fellow Ben, who lives at the DevHouse where I live) and of the other students. When things get too frustrating or weird or you don't know what you should do or what you already did--ask someone.

As Nick said, "We are your seat belt."

Also, our office has a ping pong table. That probably shouldn't be important, but I kind of already know what our big office hobby is going to be. I mean, seat belts and safety nets are great--but so are pressure release valves like banging a little white ball around.

Monday, August 25, 2014

MakerSquare, Day 0: I arrive, mingle, shop

Theme: Known unknowns.

Tomorrow I begin 12 weeks of intensive programming and web-development at MakerSquare. So today I begin 12 weeks of intensive blogging focused on my experience.

Or semi-intensive blogging. Let's be honest: I have the goal of blogging every day, but I'm sure I will be too busy or brain-fried some days to do more than lay back on my fainting couch (note to self: get fainting couch) and gesture weakly towards some cool new thing to do with Ruby.

So this blog-a-day challenge is already crazy, let's add some extra limits: I only get to write for 15 minutes max per blog-post.

Let's start the timer and see what I can say so far.

On Sunday, I drove four hours without A/C from San Angelo to Austin. It was tremendously hard to leave my dog, who understands that luggage means bad things ("people leaving"), but doesn't understand that I'll be seeing her in just a week. I also luckily happen to be roommateless, which means I get an extra bed to throw clothes/computers on. (Somewhat necessary as I don't have a desk.)

And I'm glad that we had an extra day off, as that gave me some time to hang out with my housemates--all students with my group (C9) or the previous group (C8), with one assistant instructor who went through the course awhile ago; and gave me time to go do shopping and get ready for the week.

Because--to tie up with the theme for today's post--tomorrow is all about the unknowns. I have a vague idea about what the course will be like overall, but I don't really know what the day-by-day stuff will be. The instructors? The other students? Getting to class? There are a lot of unknowns here.

And it's kind of exciting.