Being Good in General

I decided recently that I like being a generalist when it comes to programming. I feel like I’ve had the “does someone need to be able to work on both the front-end and back-end of a project in order to be a good programmer?” debate with coworkers every couple of months. At least for me, I figured out the answer to that question has been yes.

I do think it’s cool if someone wants to be an expert at making websites look beautiful and usable, then do that all day. I prefer doing a lot of different things instead. A good day for me would be helping write some Sass, then make some Puppet changes, and think about potential man-in-the-middle attacks.

However, working this way means I’m never going to be the best at anything. I am pretty good at a small set of things (like Ruby), but I am just okay at a lot more things. I’m fine with that. I may not be a Javascript expert, but I can ask intelligent questions and manage to learn something new almost everyday. These days I’ve improved my VIM skills immensely thanks to Matthew Todd.

I’ve applied this thinking to the rest of my life too. I took ballet and tap when I was little, but stopped dancing around my mid-teens. I avoided taking dance classes later in life because I figured the opportunity to be a great dancer had passed. But then I thought “So what? I can still enjoy learning how to dance even if I’ll never be a professional ballerina”. I’ve gone to a bunch of different dance classes for the past 6 months and it’s more fun now than it was when I was a child, since there’s no pressure to excel at it.

So as of now, I’m a good programmer, I’m a decent knitter, I’m a novice dancer again, I’m a better baker than I was before, and I’m a beginner at yoga, among other things. I look forward to adding more stuff to the list.

June 17, 2012

My Thoughts on Pairing

Some of my coworkers have been talking about what they do and do not like about the Agile development process, specifically pair programming. This motivated me to write about my experiences with pair programming.

Before starting at Square, I was not completely sure I wanted to pair program all the time. I knew I enjoyed working with other people for short periods of time, and that was the way I was used to working. At previous jobs, when I felt I needed help I would often ask someone to work through a problem with me. I also worked at a consulting company for a while, and when I was thrown on a new project I would spend time working with someone else in order to get a good understanding of the code base. Now, after pair programming pretty much all the time for almost a year, I find I enjoy doing it but I can understand why other people would not.

What I like about Pairing

It’s easier to learn about how things work. I felt productive the first week I started working at Square and if I have a question about something, there are at least 2 people I can ask.
I like having someone to bounce ideas off of and talking things out. I always have. Starting in high school I found that explaining something to someone else was the best way to confirm that I understood a concept. Having a pair to talk to and debate with is great.
I don’t really like doing code reviews. I do these sometimes because my coworkers will write some code by themselves and everything needs to be reviewed. I feel more comfortable being responsible for code that I helped write than code I reviewed.
I feel more focused when I pair. It’s so much easier to be distracted by the Internet when I’m coding by myself. When I’m working with someone else, I will work with them without interruption for hours.

What I don’t like about Pairing

Too much social interaction. I’m an introvert, I find talking to people for long stretches of time very hard. I miss being able to sit on a couch and listen to music for a couple hours and bang out a feature. I’ve been able to do this every once in a while, but not very often.
It can be frustrating. Sometimes I have a hard time communicating with other people. Pairing involves a lot of talking and I get frustrated when I can’t get ideas across. Also, there are days where I don’t like being the one not typing or I don’t like being the one typing. If I’m not typing, I feel like I don’t pay attention as much. If I am typing I don’t like having someone else see all the stupid mistakes I make while I’m coding.
I feel stuck with people. When I first started at Square, everyone who paired would rotate pairs amongst each other every couple of days. Now, pair rotation happens less and there are less people I am allowed to pair with because of a change in team structure. I spend a lot of time working with the same people. I enjoy working with these people, but I do miss working with my other coworkers, who I don’t talk to as much as I used to.

Overall, I really like pairing. If I did it for the rest of my career I think I could be happy doing it, given I enjoy working with the people I pair with.

January 02, 2011

Blog looks different

I finally got around to doing a redesign. It is blue.

July 17, 2010

Delegation

It’s been a long while since I’ve done any coding related blogging, so I thought I’d write about something I learned recently.

Delegation is one of those object-oriented programming concepts that I don’t think about as much as say, inheritance or polymorphism, but it’s a sensible thing that makes code cleaner.

Last week I found out about ActiveSupport#delegate, which can be used to delegate an object’s method to another object’s method. Here’s a simple example:

I have coworkers with severe allergies. We’re going to assume that a coworker has one severe allergy for my simple example. This seems to be true so far, no one I’ve worked with has had more than one, send them to the emergency room, allergies.

Here’s the two classes, with Coworker wanting to delegate the instance method severe_allergy_description to SevereAllergy:

class SevereAllergy < ActiveRecord::Base
  def description
    "The reaction to #{name} is #{reaction}."
  end
end
  
class Coworker ActiveRecord::Base
  has_one :severe_allergy
  
  def severe_allergy_description
    severe_allergy.description
  end
end

I’ve seen the above pattern a lot. Instead we could do this:

class Coworker ActiveRecord::Base
  has_one :severe_allergy

  delegate :description :to => :severe_allergy, :prefix => true
end

Let’s use it:

coworker = Coworker.create(:name => "CK")

coworker.create_severe_allergy(:name => "cats", :reaction => "death")
coworker.severe_allergy_description # => "The reaction to cats is death."

I’m pretty surprised I haven’t seen this used before, seeing as it’s been around since Rails 2.2.

Next up, I hope to make the blog prettier to improve my sad css skills, master javascript, familiarize myself with jQuery and make more cookies at work.

March 21, 2010

I'm Officially Employed

It took a while, but the visa issues have been taken care of and I’m happy to say that I’m working at Square. It’s been crazy busy and pretty exciting. I’ve enjoyed being able to work with a bunch of really smart people and Chris again (who is really smart as well).

I’ve been working on a real blog post as well, so that will show up soon. I’m off to bed after a long day.

March 17, 2010