All Posts in

July 18, 2014 - Comments Off on Selling Brooklyn

Selling Brooklyn

My version of the internet, that is, my specific collection of friends and blogs, has been particularly outraged by a video called "Brooklyn Girls" by Catey Shaw. For those that don't know, "Brooklyn Girls" is one of those deeply irritating, manicured pop songs that eats its way into your brain until you are bouncing your empty head like a bobble-head toy. Its tune is designed to target the market of Katy Perry, Rebecca Black, or Carly Rae Jepsen, but is inflected with the types of folksy signifiers that inspire people like Zooey Deschanel to continue to growing their bangs.   Needless to say,  its a shitty song.  Yet its a shitty song that, if you didn't speak any english, would undoubtedly get lost in tweenage chorus of shitty songs. So whats the deal? What inspires all this hate?  Well, Lets talk a bit about the lyrics and the video.

"There’s a palace of bricks in 11206 where all the fly Brooklyn chicks reside, combat boots in the summer, subway train rollin’ under, see her on the Lower East Side. In her walk, there’s a fire, and she’s got her own style. You’ll get lost in her mystery, and tonight she owns the city."

Meanwhile the video cycles through a kaleidoscope of images and clips of Instagram-worthy Bushwick loft parties, septum-pierced alternative girls, bearded skateboarders drinking Kombucha, and lots and lots of graffiti. Heres a link, because a video is worth a billion words:

Obviously, with my liberal arts degree collecting dust in the corner of my room, I can identify a ton of issues here: Her shallow attempts to celebrate womanhood by defining "strength" through various commodities, all purchasable at your nearest Urban Outfitters, her defining an entire borough by the experience of a very specific group of middle-class white folks in North Brooklyn, her lack of understanding of Geography. But ultimately I believe that this intellectual-hate-sturbating is not the reasons why this video is viral, though there is plenty of it to go around.

 

Catey Shaw is selling a lifestyle in the same way that rappers, breweries, or Dove commercials might; and to the delight of TJ Maxx or Urban Outfitters, for most of the country Brooklyn might as well be what Shaw describes. Nothing is new about what Shaw is doing. The outrage seems to stem from the fact that the culture she is most aligned with hates to even be identified as a culture. It is no coincidence that the culture she is celebrating is full of the very people who are in the forefront of the vitriol. From Vice to The Gothamist to me (I lived in Bushwick and I wear Vans), the onslaught of Internet psycho-babble is, like a mutiny, coming from her very own crew.

Our next podcast is about what makes content viral. Like Rebecca Black's "Friday", Shaw might be relegated to the order of things that are just so silly that we have to keep watching. But in my estimation tonight at a bar in Williamsburg a DJ will play this song somewhat ironically, and many won't get the joke. Brooklyn Girls

May 16, 2014 - Comments Off on What We Talk About When We Talk About Testing

What We Talk About When We Talk About Testing

Until recently I considered writing tests for my applications much like reading Dickens in high school: boring, repetitive, hard to understand, and yet for some reason a total necessity.  What's more, I wrote tests about as frequently as I read Dickens - and I've never read any Dickens.  My meandering point here is that Test Driven Development (TDD) seems to be the standard of the rails community, yet I don't know a single person who actually does it.  With that it mind, I decided to develop our last client's application with tests written to the best of my ability.  At first I thought I was burying my productivity in the minutia of each test, but I ended up learning quite a few things, including the value of testing.

Tools

I guess the first thing to do here is to describe my tools.  To test with Rails I used RSPEC, Factory Girl, and Capybara.

RSpec is a testing tool for Ruby.  Baked into the gem is a rich command line program with detailed error reporting. The beauty of Ruby, and RSpec, is that it enables you to write human readable tests that tell a story. For instance:

it 'has a list of employees' do

employee = Employee.new('John', 'Smith')

company = Company.new([student])

expect(company.employees).to include(student)

end

 

Though testing with RSPEC ensures that our models behave the way we expect, there is a serious problem with this approach: It takes forever. Testing any sort of interesting behavior not only involves extensive amounts of setup to your environment, but a tremendous amount of code to create various instances of your model. This is where Factory Girl comes in.  Factory Girl allows a tester to create factories that create multiple records for a model with some generic attributes that are able to be overridden as needed.  This means that creating a unique record is as simple as:

FactoryGirl.create(:employee, name: "Jon Snow").

My last tool in my little testing toolkit is Capybara. Where RSpec is a way to test your models, Capybara allows your application to test external behavior. In other words Capybara provides a simple way to test user stories and general behavior. Heres an example:

'When I sign in' do

visit user_sign_up_path

fill_in 'Login', :with => 'DavidBowie@spidersfrommars.net'

fill_in 'Password', :with => 'whereWereTheSpiders?'

click_link 'Sign in'

end

 

 

So What's The Point

When I started, I assumed that testing would help to prevent bugs. While this is likely the case, I found that using TDD did something far more valuable. By letting tests to drive the code, developers are forced to conceptualize their application before a single semi-colon is ever written. This forces developers to step through their own logic, which in my case, is full of inconsistencies and little things that I had not thought through fully...likely because I have never read Dickens.

Published by: dhruvmehrotra in The Programming Mechanism
Tags: , , ,