Week 8

Week 8

I actually took notes as I went this week, which feels weirdly prepared for me... I'm not sure I like it...

Day 36

We’d been warned Rails was a beast by Margo. We’ve been told Rails was a beast by Enrique. It turns out Rails is a beast. One simple Rails new <appname> and suddenly you have a tonne of files cluttering up your sidebar and no idea where they came from or what they do. I mean, a lot of them look like Sinatra files, but appear to work differently. Joy.

You can create a blog with one extra line

rails generate scaffold posts title body:text published:boolean

That’s insane. I mean, that’s obviously insane, right?

There’s just so much magic here. Peter and I have talked before about some things appearing to be a black box which takes an input and spews out something mildly unpredictable without explaining why. This is pretty much the most that. Obviously, the more you use it, the less magic it seems, but for now it’s really very magic. Impressive when someone else does it. Terrifying when you’re given the wand.

Working in a team is still weird. Mostly because it’s never very clear how you should split responsibility. I think the conclusion may have been that we shouldn’t have - we may well have been at our most productive when Megan was at the keyboard and everyone else was watching and trying to contribute. That did at least get us through the gargantuan configuration process (Rails is easy - Rails with custom options… maybe less so…). On the plus side we got to sketch out an app on a whiteboard, which feels great. Again, it makes you feel like you’re part of making an actual product - which is why I’m doing this. I’m also a fan of planning things, apparently. Still, once you actually start playing with it and adding functionality, Rails is kinda fun. It definitely all works, eventually. Apart from that one post request… But, at the end of the day, we could boot up Rails, go to the page for a question, answer it (true or false), and be told if we were right or not. Which is cool. We made a thing today. A small thing, but a thing nonetheless. And that’s enough to make me sleep happy tonight.

Day 37

So, seeing a Rails app developed nicely helps (remember that thing where seeing good code is always great? Well, that). In a way I think it was useful to somewhat fail first - you recognise the errors, for one thing - but there’s always an element of impatience that wants to have everything explained and understood right away. Still, the fog’s clearing and that can only be good. I think.

Still have slight concerns about ActiveRecord - possibly even larger ones. It’s one thing to have the properties of models defined outside of models, it’s another thing to have the files they are in be conventionally uneditable. You seem to end up with no canonical list of the proper tie you’ve given your models (other than opening up the database). I mean, I’m sure there’s a way to rake something, but it’s weird not having the code there. Having a separate migration for each column in a table means that you end up with multiple files defining one model. You also appear to have to code from the command line, which I’m not sure I’m entirely happy with. Given my normal way to understand what I wrote five minutes beforehand is to desperately cycle through all the open tabs in Sublime, it’s a little disconcerting to have the answer not really be there. Like all these things, I’m sure I’ll get use to it - it’s not as if this is the first time I’ve had to re-evaluate the way I work around here…

Day 38

Rails still puts power in odd places. Apparently JS-heavy apps do that even more so. Suddenly all the data is being called in by javascript as JSON. Sure, the JSON responses are generated by a controller action somewhere, but there’s still a disconnect. I guess it feels less and less like a disconnect the more you learn, but for now it’s a little weird.

Still, when you start to get Rails, it can really sing. We’re writing so much less code to pass each test. Each bit of functionality only requires a small bit of tweaking. Sure, that small tweak may involve five separate files, but it’s reasonably easy to take in and understand. There’s always a thin line between really cool and really worrying when so much is done for you (you want your User to have a secure password? Just declare that it has_secure_password! Taken care of! Promise!), but for the most part it’s nice to have less to worry about. The less I write, the less can go wrong.

Day 39

Now we’re the “senior” cohort, we get to see another group going through roughly the same steps we did six weeks ago. We’ve use the things we learned in the first few days so many times since then that it seems odd that we even didn’t know it. Of course I use the command line to get around my laptop. Of course I use git to track all my projects. Of course inject combines all elements of enum by applying a binary operation, specified by a block or a symbol that names a method or operator. So, it’s great to watch their lectures, remembering that, yes, all of this was new at one point, and now look where we are. Rails is tricky, but so was Ruby at the start. So was Sinatra. So was Code Wars… “Was”… Most of Makers Academy moves too quickly to allow you the time to look back. We cover something, and then you know it and use it every day. Done. You never didn’t know it. It’s really nice to take the time to remember how far we’ve come. Also helps to take your mind off how little we’ve got to go…

Day 40

Today’s test was Ruby revision. And it was amazing. There was something really refreshing about going back to pure Ruby after weeks of web frameworks. It’s the closest I’ve come to the Code Wars glory days in ages. Obviously felt a little rusty, but it all came back quickly enough and it’s nice to feel capable again. Rails often feels a bit like guesswork - you don’t get that with these kinds of small Ruby problems. It also gives you an appreciation for the sheer number of powerful methods Ruby comes with out of the box. Javascript always seems like you have to fight it a little to make it do what you want (that may well be owing to a lack of knowledge on my part…). Ruby always seems eager to help. In fact, it’s often a disappointment when there isn’t a pre-existing method to do exactly what you want. But, for the most part it’s a joy, and I’m pleased to be learning it.

The Node JS workshop, on the other hand, was a struggle… I’ve barely gotten a handle on where everything is in Rails, so being given a directory full of oddly named files in a strange, brackety language is a little disorientating. Especially as it turned out a key file was hidden in a folder I had written off as being solely used for external dependencies… Node feels like something I could very happily return to after the course (indeed, several members of the previous cohort did happily return to try the workshop), but for now it’s almost a distraction. It’s a very different system that requires a different way of thinking. So I’m went back to Ruby, because Ruby is safe. Which is a really weird sentence to end on.