Hardscrabble 🍫

By Maxwell Jacobson

See also: the archives and an RSS feed

Didn't Ricky Gervais get in trouble for saying that? On MongoDB

January 11, 2014

Remember when Ricky Gervais got in trouble for using the word “Mong” a lot to mean “stupid” and a lot of people were mad at him because it’s an offensive thing to say? Anyway, I’ve been using MongoDB and Mongoid at work and I sometimes worry that the very name is kind of rude, but other than that I mostly like it.

My only database experience prior to this was with personal / school projects exclusively using SQLite3 and mostly with ActiveRecord as the interface to that database. Not coincidentally, this is the default Rails stack.

I want to make a simple rails project, a To Do List app becase duh, twice, once with ActiveRecord and once with Mongoid, and just see what kind of observations I have. OK I’m going to do that now. I’m going to use Rails 4.0.2.

First, with ActiveRecord

Getting started by running these commands:

  • gem install rails – install the latest version of the Ruby on Rails gem
  • rails new todo_list – create a new rails project called “todo_list”
  • cd todo_list – change directories into that new project’s folder
  • bin/rails generate model category name:string
  • bin/rails generate model task name:string complete:boolean category_id:integer
  • bin/rake db:migrate – to create a database “db/development.sqlite3” and update its schema. We’ll come back to this when we talk about Mongoid because it’s way different.

Then editing my freshly generated models to look like so:

# app/models/task.rb
class Task < ActiveRecord::Base
  belongs_to :category
end

and

# app/models/category.rb
class Category < ActiveRecord::Base
  has_many :tasks
end

That should be enough that we can now run bin/rails console and create some data:

# we're in the rails console now
c = Category.new #=> #<Category id: nil, name: nil, created_at: nil, updated_at: nil>
c.name = "Things to buy" #=> "Things to buy"
c.save #=> true
c #=> #<Category id: 1, name: "Things to buy", created_at: "2014-01-11 22:10:47", updated_at: "2014-01-11 22:10:47">
c.tasks #=> #<ActiveRecord::Associations::CollectionProxy []>
c.tasks.build(name: "Buy some spinach") #=> #<Task id: nil, name: "Buy some spinach", complete: nil, category_id: 1, created_at: nil, updated_at: nil>
Task.count #=> 0
c.save #=> true
Task.count #=> 1
c.tasks #=> #<ActiveRecord::Associations::CollectionProxy [#<Task id: 1, name: "Buy some spinach", complete: nil, category_id: 1, created_at: "2014-01-11 22:22:24", updated_at: "2014-01-11 22:22:24">]>
Task.all.class #=> ActiveRecord::Relation::ActiveRecord_Relation_Task

So that whole way works fine. It’s nice.

Again, with Mongoid

The Mongoid Installation page is kind of intimidating:

There are a few things you need to have in your toolbox before tackling a web application using Mongoid.

  • A good to advanced knowledge of Ruby.
  • Have good knowledge of your web framework if using one.
  • A thorough understanding of MongoDB.

This may seem like a “thank you Captain Obvious” moment, however if you believe that you can just hop over to Mongoid because you read a blog post on how cool Ruby and MongoDB were, you are in for a world of pain.

Mongoid leverages many aspects of the Ruby programming language that are not for beginner use, and sending the core team into a frenzy tracking down a bug for a common Ruby mistake is a waste of our time, and all of the other users of the framework as well.

When I started using MongoDB I was kind of freaked because it promised to be so different. But honestly it’s not that different. In a SQL database you need to write your queries using SQL, right? That stuff is so hard to write and inscrutable to read, at least for this blogger. MongoDB queries are written in JavaScript. That’s a major upgrade in my book, even if it were otherwise the same underlying technology. And then, if you’re using Mongoid, you can make another great upgrade by writing your queries in Ruby.

Of the three prerequisite bullet points listed on that page, I think I only disagree with the third one. If you’re completely unfamiliar with MongoDB but fairly familiar with Rails, Ruby, and ActiveRecord I think you can make the leap. That’s what I did. I started out by using Mongoid as if it were ActiveRecord, which is mostly totally possible. Then you can keep exploring the docs and branch out if you want.

One setup prerequisite is that you have MongoDB installed on your system. I think I have it on my laptop. I actually have no idea if I have it. Let’s find out.

Getting started by running these commands:

  • gem install rails – install the latest version of the Ruby on Rails gem
  • rails new todo_list --skip-active-record – create a new rails project called “todo_list” without ActiveRecord1
  • cd todo_list – change directories into that new project’s folder

Now, before I generate my models I need to indicate that this project is going to use Mongoid. To do this I’m going to add the following to my Gemfile:

# Use MongoDB as the database
gem "mongoid", "4.0.0.alpha2"

I’m using the alpha version of Mongoid 4 because… well, I’m sticking with the basics, so why not?

Now let’s continue with these commands:

  • bundle install – fetch the Mongoid code from RubyGems for our project
  • bin/rails generate mongoid:config – create a configuration file; this generator didn’t exist a moment ago, I think that’s cool
  • bin/rails generate model category name:string --timestamps – create the category model; almost exactly the same command as before, but using a new Mongoid generator, which doesn’t include created and updated timestamps by default
  • bin/rails generate model task name:string complete:boolean --timestamps – create the task model

This is the step in the ActiveRecord version where we ran bin/rake db:migrate. We don’t have to do that now. No migration files have been created. The database is flexible. How does that make you feel? If that sounds totally awesome, MongoDB might be for you. If that freaks you out, probably not.

Let’s take a look at the model files that were just created for us:

# app/models/task.rb
class Task
  include Mongoid::Document
  include Mongoid::Timestamps
  field :name, type: String
  field :complete, type: Mongoid::Boolean
  belongs_to :category # actually this line isn't from the generator, I just added it
end

And:

# app/models/category.rb
class Category
  include Mongoid::Document
  include Mongoid::Timestamps
  field :name, type: String
  has_many :tasks # same as the belongs_to above
end

First kind of interesting difference: instead of your models inheriting functionality from ActiveRecord via subclassing, our models now include functionality from the Mongoid::Document module. Among other things, this gives the class a field method. We use this to define the attributes that this model should have. Unlike ActiveRecord models, which know the attributes they can have by introspecting on their corresponding table in the database2, Mongoid models typically have a list right in the class definition of the name and type of its attributes. Later, when we call category.name = "Homework", Mongoid is dynamically figuring out what we mean based on our list of fields; it gives categories a name= and name method. This centralization appeals to me on an organizational level.

And an interesting similarity: has_many and belongs_to work pretty much exactly the same way. If you’re used to thinking relationally, you can use that here too.

So let’s try to create some data and see how that goes. Into the bin/rails console let’s go.

category = Category.new #=> #<Category _id: 52d1d2036d61633a9b000000, created_at: nil, updated_at: nil, name: nil>
category.name = "Homework" #=> "Homework"
category.save #=> true
category._id #=> BSON::ObjectId('52d1d29c6d61633b1b000000')
category.id #=> BSON::ObjectId('52d1d29c6d61633b1b000000')
category.tasks #=> []
category.tasks.class #=> Mongoid::Relations::Targets::Enumerable
category.tasks.build(name: "Study Mongoid") #=> #<Task _id: 52d1d62d6d61633c05000000, created_at: nil, updated_at: nil, name: "Study Mongoid", complete: nil, category_id: BSON::ObjectId('52d1d29c6d61633b1b000000')>
Task.count #=> 0
category.save #=> true
Task.count #=> 0
category.tasks.last.save #=> true
Task.count #=> 1
category.tasks.create(name: "Study Rails 4") #=> #<Task _id: 52d1d8596d61633cba040000, created_at: 2014-01-11 23:48:41 UTC, updated_at: 2014-01-11 23:48:41 UTC, name: "Study Rails 4", complete: nil, category_id: BSON::ObjectId('52d1d7696d61633cba010000')>
Task.count #=> 2
Task.all.class #=> Mongoid::Criteria

First of all: I guess I did have MongoDB installed and running on my system, who knew?

OK so functionally it’s almost exactly the same right? But there are some interesting differences:

  • the unique id attribute is now called _id instead of id (this comes from MongoDB, not Mongoid, though Mongoid helpfully aliases id to _id in case you forget) and is totally long and weird looking
  • that thing where queries are assembled and chainable and not invoked until the last moment is called a “Criteria” and not a “Relation”

These two Rails apps are available here: https://github.com/hardscrabble/comparing_mongoid_and_active_record

This is a really brief introduction to the basics of Mongoid. I want to dig in more. My laptop battery is at 6%. More to come.

  1. Confession: On my first attempt at this I skipped this flag and it created the application with ActiveRecord and I was trying to replace it and then I was like, hmm, maybe there’s a better way to do this. Unfortunately, there’s no rails new --database=mongodb like there’s a rails new --database=postgresql, among others 

  2. probably my favorite phrase I learned at Flatiron School was “introspecting on the database” 

New Year's Resolutions

January 6, 2014

Last year was good. I think I resolved to take programming seriously. I went to The Flatiron School and now I’m working at CipherHealth. I’ve learned a shit load and had a lot of fun.

Things I want to learn in 2014

  • Objective-C / iOS programming
  • Ember.js
  • Node.js
  • What the fuck a javascript promise is
  • How the hell source maps work
  • BASIC MUSIC PLAYING
  • How the health care industry works
  • VimScript

Things I want to make in 2014

Things I want to do in 2014

  • Move back to NYC
  • Write a god damn poem

Things I want to read (in 2014)

  • Less Twitter
  • Infinite Jest I guess?

sidenotes

December 27, 2013

EDIT April 2015: I took it off the site because it was kind of bad 🙂

background

There’s a hubbub1 going around about a fun plugin for popover footnotes called Bigfoot.

I think it’s cool. I definitely prefer that reading experience.

this new thing

Some people on Twitter said they prefer Grantland’s sidenotes, except for their behavior on mobile, where they basically don’t work. They imagined a solution that involves swiping/dragging, and enlisted me to work on it.

I’m not sure how to capture that kind of touch event and I’m curious to find out I guess.

I’m starting by recreating Grantland’s sidenotes, and then I’m going to go watch The Hobbit with my dad.

One thing that’s cool about the popular plugin is that it’s easy to drop in and use. What I’ve added to my site isn’t, because it makes assumptions about the structure of your HTML layout. I bet it could be abstracted in a way that’s broadly usable but I’m not sure how. Happy to take input on that!2

assumptions it makes

Here are the assumptions I’m currently making:

That your HTML layout looks something like this:

<div class="post">
  <div class="body">...</div>
  <div class="sidenotes"><ol></ol></div>
  <div class="clearfix"></div>
</div>

And your CSS (Sass here) looks something like this:

.post
  .body
    width: 70%
    float: left
  .sidenotes
    width: 25%
    float: left
  .clearfix
    clear: both

I’m also assuming that your footnotes look a lot like the ones generated by my favored markdown-to-html processor, kramdown, which … I have no idea if that’ll be a dealbreaker for interoperablity.

Here’s what the code looks like3:

$ ->
  # grab the sidenotes divs
  $sidenotes_container = $(".sidenotes")

  # grab the sidenotes list
  $sidenotes = $sidenotes_container.find "ol"

  # iterate over the footnotes at the bottom of the post
  # and work some magic on them
  $(".footnotes li").each (index, item) ->
    # wrap the footnote in a jQuery object
    $footnote = $(item)

    # move the footnote from the bottom to the right
    $footnote.remove().appendTo $sidenotes

    # remove the little arrow that links back to the source
    $footnote.find(".reversefootnote").remove()

    # find the source link from within the body of the post
    $source = $(".footnote").eq(index)

    # grab the previous sidenote, if there is one
    $previous_sidenote = $footnote.prev()
    $previous_sidenote = if $previous_sidenote.length then $previous_sidenote else undefined

    # let's set the vertical position of the current sidenote
    # if the previous one is kind of long, we need to push this one down
    # if not, it should be aligned with the source link
    $footnote.offset ->
      aligned_top = $source.offset().top
      if $previous_sidenote? and $previous_sidenote.offset().top + $previous_sidenote.height() >= aligned_top
        top: $previous_sidenote.offset().top + $previous_sidenote.height() + 5
      else
        top: aligned_top

gripes / todos

  • looks bad on mobile, and when resizing the windows. Should have some responsiveness, possibly including that swiping thing @smarterbits imagined
  • when you click a footnote link, nothing seems to happen. maybe the related sidenote should pulse briefly to attract the eye
  • I don’t like how posts without sidenotes kind of look unbalanced now. This makes me want to have at least one footnote per post? Weird.
  • vertical positions are screwed up when a post includes an embedded tweet, because the tweet’s height grows as Twitter’s JavaScript reformats the HTML from a vanilla blockquote to a whole thing, by which time my code has already set a height for all the sidenotes
  1. I noticed it linked by Dr. Drang, who praised it for being “webby”, and Marco Arment who praised it for being like Instapaper. 

  2. truthfully I’m eager to make some kind of open source thing that people use and collaboratively improve. 

  3. I’m archiving it and not linking to the source either here or on GitHub because it’s very liable to change and I want to archive its current state for reference or more likely nostalgia. Actually, I could link to the sidenotes.coffee file as it was at this specific commit, but I haven’t pushed it yet. I was planning to push the footnotes changes and this post, together, but now I want to push the changes first. OK I did. If you prefer GitHub’s syntax highlighting, the file is here. If you prefer the compiled JavaScript, it’s here. OK, now I can safely remove this sidenotes nonsense later on when I grow tired of it. 

iBooks for Mavericks

December 9, 2013

OS X 10.9 Mavericks brought us an awesome eBook reader for the desktop in iBooks. Since updating, I’ve gotten into the idea of keeping and managing a library of digital books on my computer, mostly in the open ePub format. I get these books from the excellent Project Gutenberg and publishers like Manning Publications (which has taken a bunch of my money recently due to its generous holiday sales).

I really love being able to keep and read books on my desktop. And it’s cool that they sync to iOS devices, pretty similarly to how iTunes syncs your music. This was possible before Mavericks, but it was all baked into iTunes, and it’s much better as a standalone app. I’d like to see Apple move further in this direction of breaking iTunes down into modules, maybe even introducing some kind of standalone syncing app so iTunes can really just be for managing and playing music, as it semantically desires to be.

Though it introduces the major, terrific feature of ePub rendering, iBooks unfortunately removed several features that its iTunes-embedded predecessor had, such as the ability to edit metadata and also, peevishly, the ability to right click and reveal the files on disk.

Another unfortunate negative to the app is it’s kind of terrible at organizing your books in any way except one flat list, sorted by most-recently-read or title. It offers these categories by default “Purchased”, which refers only to books purchased through Apple’s iBooks store and not the several books I purchased from other sellers, “Books” which refers to files in the ePub format exclusively with no regard to whether they even are books, and “PDFs” which refers to files in the PDF format even if they’re books.

There is some preliminary support for categorization in the ability to add files to “collections”, which removes them from their default category of “Books” or “PDFs”, as though they stop being those things.

A file can only be in one collection.

I think it’s impossible to delete collections, which is kind of too bad because I just clicked the lower-left “+” button 10 times.

My many iBooks collections

Once a book is in a collection, right clicking it gives you the option to “Delete” it, which actually doesn’t delete it, it returns it from the collection into either “Books” or “PDFs” (from where they can be removed from the app entirely). Books which you’ve purchased from the iBooks Store but haven’t downloaded don’t have the “Delete” option, but they do have the “Add to Collection” option, so I don’t think I can move this back out of my collections:

This books is forevermore collected

Actually it’s only true that you can (easily) remove books from “Books” and “PDFs” if they weren’t purchased from the iBooks store. Good luck deleting a book you bought from the iBooks store. It’s kind of possible but not really.

Moving a PDF and an ePub into the same collection seems to be the only way to get them to mix, which is the only reason I can think of to use collections. Unfortunately PDFs are second-class citizens because reading them kicks you over to Preview, which means you have to wait for Preview to open.

Right clicking a book also offers “Share”, an empty dropright menu.

Those filtering buttons along the top are permanently grey and unclickable for me?

Anyway I really like iBooks because I’m excited about reading ePubs on my Mac.

Has Chris Pratt Been Enchanted?

December 8, 2013

I can’t think of Chris Pratt, the very funny actor who plays Andy on Parks and Rec, without thinking about this tweet, by that show’s creator, Mike Schur:

This tweet accompanied the news that Pratt was cast in the lead role of Marvel’s upcoming, probably huge superhero movie Guardians of the Galaxy. Obviously Schur has some bias, being friends and colleagues with the guy, but I can’t help but agree. I think Chris Pratt has been enchanted.

Andy wasn’t supposed to be a regular on Parks and Rec but they kept him.

He’s like, really funny on Twitter.

He’s married to Anna Farris and they seem really happy.

He apparently has no trouble losing weight and becoming muscular in a cinematic way.

No like, really, Hollywood is happy to cast him as the funny guy, one of the guys in Oscar-bait like Zero Dark Thirty.

Who is Chris Pratt? There seems to be no undercurrent of anxiety like drives some artists, he’s too busy soliciting his fans to tell him the best moment in their life, and dishing out positive affirmations:

His simple positivity almost reminds me of artists like Steve Roggenbuck or Ryland Maserang without the poetry?

He’s charming, politically neutral, and probably, I think, enchanted. I’d buy that stock.

this is my suitcase

November 30, 2013

We are not “breaking up”, because we all still love each other. Mary Lynn writes great music. I still write music all over. We all still exist and we all still create. We are simply putting a lid on This Is My Suitcase to capture everything we’ve done; We are merely writing a really good ending to our own wild story.

– Joseph Anthony Camerlengo

I don’t remember where I first heard of This Is My Suitcase, but I think it was on the absolute punk forums, probably in some thread for links to zips of weird albums from bands no one has heard of, many of which I downloaded and sifted through and deleted. One of them was “Missent to Thailand”. I have a vague memory of listening to it in an airport and being shocked by how much I liked this weird out of tune pop about being in love. I subscribed to the RSS feed of their Myspace blog (!?) and watched their careers as they almost went mainstream (I think Fall Out Boy were fans and tried to help them out, but it didn’t go anywhere) but they never quite left Ohio, where I think they’re local hometown hero types.

But of course, this is the internet, so this weirdo in New York got to become quite a fan of theirs. I had a few other bands or filmmakers or artists whose careers I casually followed through various feeds, who I never would have known about without the internet. Some I forgot about, and some I lost the bead on1, others. And I’m really grateful for all of that, because it’s got some of that magic of what I imagine earlier generations found in digging through crates of records or whatever.

I’m bummed I never saw them live, but they kind of only existed on the internet anyway? To me.

When I made my short film “I’m So Happy I’m Ecstatic” I knew I needed to include one of their songs. I’m really glad it’s in there.

I don’t remember exactly when I started, but I guess I’ve been listening to them a while. (myspace rears again in that tweet)

Their last album, “In The Wake Of Atrophy: a poignant album for heartsick humans”, came out yesterday. It’s available to stream or buy on bandcamp. The first music video for My Organs Are Our Organs just came out too.

If you’re a heartsick human (and you are) then you know what to do.

  1. the memory of one myspace band called “isa” continues to haunt / elude me 

Synchronize Our Dictionaries

November 30, 2013

Recently I’ve been melting the butter stick of my brain against the griddle of Reginald Braithwaite, whose twin books on JavaScript and CoffeeScript as functional programming languages, JavaScript Allonge and CoffeeScript Ristretto have been tripping me out hard.

I bought them yesterday for their Black Friday half-off prices and loaded them into iBooks on my Mac and iPad (so glad to have a good ePub reader for Mac) after having their full-text-for-free web pages open for weeks in my browser, teasing me to read them while I do Ruby stuff all day.

In order to talk about how this works, we should agree on a few terms (you may already know them, but let’s check-in together and “synchronize our dictionaries”). The first x, the one in (x) ->, is an argument. The y in (y) -> is another argument. The second x, the one in -> x, is not an argument, it’s an expression referring to a variable. Arguments and variables work the same way whether we’re talking about (x) -> (y) -> x or just plain (x) -> x.

The particulars of this passage aren’t as important as that one phrase I plucked as the title of the blog post which I just really like a lot. Any kind of writing is basically just that. It’s as much about synchronizing your minds as it is synchronizing your language but that’s kind of the same thing.

open blog

November 24, 2013

This blog is open for business. Also it’s open like, it’s on on github, which means you can fork it, read the drafts, submit pull requests, etc.

This isn’t a big deal. It’s true of all jekyll blogs on github. While reading about “open companies” like Balanced and Gittip, I thought that this is also true of my blog.

I kind of want to be a better blogger. I’m pretty proud of how I put together this new blog. It feels sturdy, with well-organized source code.

Today I bought a hoodie at American Apparel and the guy ringing me up asked for my email address because “we’re kind of going green and sending by receipts via email” and I told him it’s max@hardscrabble.net and he asked me to spell it. I said, “it’s max at hard, like difficult, and scrabble, like the game” and the other cashier laughed like, what kind of email address is that? I said, “I just think it’s a fun word” and got the hell out of there.


edit November 2014: I edited a link to point to the new home of the blog’s github repo, which moved from my user to a new organization called hardscrabble

javascript resources

August 16, 2013

Here are some links to free, online resources I found helpful while learning JavaScript.

Start with some introductory materials. My favorite is jQuery Fundamentals. It’s an awesome, brief book by Rebecca Murphey. It starts with the fundamentals of JavaScript and then covers the fundamentals of jQuery. It’s really awesome. Murphey and some friends used to do a video podcast about jQuery called yayQuery which is a cute as hell name. I haven’t really watched any of those though. Focus on the book/site. Try to follow along in the built-in editor / sandbox environment.

Try to understand everything she covers in that guide because it’s all … fundamental … haha.

Check out Airbnb’s JavaScript style guide on github at airbnb/javascript. Beyond (interesting) style-related-stuff like how they recommend you indent your code, it’s also super instructive for learning the language itself because it covers the conventions they recommend for pretty much every aspect of the language, so if there’s something you haven’t been exposed to yet, you’ll find out and learn about the concept in a way that has been thought about carefully.

I liked this recommendation of theirs:

// bad
var sidebar = $('.sidebar');

// good
var $sidebar = $('.sidebar');

because, yeah, totally, if you’re caching a jQuery object why not prefix it with a dollar sign so you remember that’s what it is? There’s a lot of good stuff like that.

This is a funny video about jQuery: Paul Irish : 10 Things I Learned from the jQuery Source. I mean it’s insightful too. It’s just this guy reading the source code and explaining how jQuery works. It makes you feel like you could just read and understand the source code of any major library or framework.

The next thing to do is try making some static sites with jQuery and maybe put them on GitHub Pages. Just create a repo and do your work on a branch called gh-pages. You can just delete your master branch. When you’re ready to show off your work you can push it to GitHub and people can look at the actual site as well as the source code. It’s really cool, this becomes this just because of the branch name. Btw the location of the page is always http://YOUR_GITHUB_USERNAME.github.io/REPO_NAME.

Some things to make:

  • a calculator
  • a todo list
  • a page that pulls in JSON data from some API and renders it on a page. maybe make a page where you can enter a github handle and it will fetch the JSON at, eg, https://github.com/maxjacobson.json and print some of the data to the page. Or any other API. Maybe one from a web app you made.

Maybe also install node. Just brew install node and then you have node. Now you can run JavaScript programs from your command line with just like node whatever.js. They don’t even have to be web apps. Just little programs! Maybe Project Euler problems. Definitely solve some of those problems. Do as many as you can. I should do more of those. Damn. Just write some out in JavaScript. Use console.log wherever you would use puts in Ruby.

By this point in the blog post you should feel like you’re pretty good at JavaScript. I feel like you are. Maybe take Rebecca Murphey’s JS Assessment which is kind of like a less meditative version of Ruby Koans used in job interviews to assess your level of JavaScript knowledge. I found this super hard and educational. I got less than halfway through. I want to revisit this.

Take a detour into CoffeeScript with me. The main reason I like JavaScript is CoffeeScript. I like it a lot. Install it with sudo npm install -g coffee-script (npm is “node package manager” and it’s a lot like RubyGems. The main difference is that by default, without the -g flag, it doesn’t install globally on your computer, it installs into the current directory in a subdirectory called “node_modules”). If the syntax appeals to you, try rewriting an earlier project or program from JavaScript to CoffeeScript. You can run it with coffee whatever.coffee or compile it into JavaScript by running coffee -c whatever.coffee which will create whatever.js for you.

CoffeeScript is kind of confusing at first but I really like it. It’s like, why use this. It took me a while to figure out how to use CoffeeScript with jQuery but it’s actually super simple, here’s a basic example:

$(document).ready ->
  $("#shout").on "click", ->
    alert "YO WHAT UP"

Which could be written even more compactly as:

$ -> $("#shout").on "click", -> alert "YO WHAT UP"

Which is kind of ridiculous and unreadable but cool that it’s valid?

I guess all that’s left is to keep going and start learning how to build complicated software in this cool language. I want to learn a JS framework next and can’t figure out where to start. But that… is a tale for another blog post.

the woods

July 22, 2013

Kings of Summer

A few months ago I saw a newish movie called “The Kings of Summer”, which is about a trio of teenage boys who get fed up with their loving parents, move into the woods, build a ramshackle house, and live in it. They’re trying to make a statement. I think it’s something like, “We’re men. Stop treating us like kids; we can live off the land.”

programmers, drawn to the woods

As I’ve been learning to program within the Ruby on Rails web application framework I’ve, at times, felt like those kids suffocated by their loving parents:

Rails Mom

And drawn to that ugly pile of sticks in that clearing in the woods. Not because it’s better, but because it’s more mine.

I’m drawn to the woods when I read blog posts like this and want to replace OS X with Linux and Sublime Text 2 with Vim.

I was drawn to the woods when I got this eyebrow-raising keyboard I type fast as hell on.

I’m drawn to the woods when I read about Node JS even though I’m in the middle of a program learning Rails.

Summer is a pretty good movie. I like the way it pokes fun at these kids’ naïve concept of what it means to be an adult. At one point the protagonist is proud to grow a mustache. But in the end, they go home to their parents, and it’s the most grown-up thing they do all movie.

I’m slowly coming around to the Rails idea of “convention over configuration”. Not that I was opposed to it or anything, but I didn’t immediately appreciate or understand it. Learning and using Rails still feels a little like moving into a fully-furnished apartment where the previous tenant and I wouldn’t have necessarily hung out. But it’s got AC and a well-stocked fridge and who am I to complain?

Going to the woods is fine. You might find and bring something amazing back with you, like Rails or For Emma, Forever Ago. I really don’t mean to bolster any societal hegemony. Just try not to get lost.