sameer iyengar

internet, technology, entrepreneurship, productivity, travel…

Entries from November 9th, 2009

Pair Programming is Awesome

November 9th, 2009 by sameer
Respond

I’ve been meaning to write about this for a while.  Pair programming is awesome.  I was a huge skeptic when it was first pitched to our team, but after trying it a few times, I was completely sold.  It makes you more productive, produces better code and is just more fun all around.

I’m know there has been tons of stuff written about this, but when I read it, I was so skeptical that I thought all those authors were crazy.  But you know I’m not crazy.  So I’m going to tell you why its great.

Pear by hassi on Flickr

Photo from hassi on Flickr.

Benefits of pair programming

Not convinced?  How come?  I already said it was awesome (and I put it in bold).  Here are some benefits –

  1. It keeps you focused. If you’re anything like me, you probably have a tendency to drift when you hit a stopping point.  Maybe check some e-mail or read your favorite blog.  Not anymore.
  2. It helps when you get stuck. Its easy to spend a lot of time trying to figure out something that you’re unfamiliar with.  It always helps to have someone to discuss it with without having to feel bad for interrupting your co-workers all the time.
  3. It avoids stupid mistakes. Have you ever spent 30 frustrating minutes trying to figure out why your change isn’t showing up in the output, only to realize that you forgot to hit save?  Yes, yes, you have.  Your partner is likely to notice those things before you spend unnecessary time pulling your hair out.
  4. It produces better code. It’s less tempting to take shortcuts, write unreadable code and  ”forget” to test things when you’re working with someone.
  5. Its the best way to learn a new code base. The best way to get someone up to speed on a project is to have someone pair program with them.  They’ll spend less time digging around outdated documentation and more time contributing.  I’ve effectively pair programmed with people outside my team who knew absolutely nothing about the project coming in.
  6. Its more fun. This one really depends on the people you’re working with, but its definitely a big upside.

How to set up a pair programming workstation

The set-up is really, really important.  Both people need equal access.  You’ll need:

  • Two keyboards
  • Two mice
  • A long, straight desk (no weird angles)
  • A giant monitor

Its key for each person to have their own keyboard and mouse so that no one is just sitting there passively watching the other person type.

How to pair program

Now that you’ve got a sweet workstation set up, its time to actually do it.  This part is easy, just start writing code.  Switching off can be a bit tricky at first, but soon it’ll become seamless.

If you’re using Test-Driven Development (writing a test before writing a feature), you could have one person write a test that fails, then have the other person make the test pass and write the next test.  Its an easy way to make sure you’re switching off regularly.

One of the big advantages is that its easier for something to do or fix something than to spend time explaining it.  Notice that something is spelled wrong?  Fix it, you have your own keyboard.  Have an idea for how to do something?  Just write it and let the code speak for itself, instead of trying to explain what you’re trying to do.  You can always delete or edit it as necessary.

Potential Downsides

  1. It could take longer than two people working independently. This is true, but I’d argue only if both people know exactly what they’re doing.  More often than not, when you’re working on something new or complex, pair programming will be faster.
  2. You could end up hating your co-worker after spending so much time with them. This is true too.  Definitely switch things up often to avoid this.

Love pair programming? Still not convinced?  Leave a comment.

Category: productivity  programmingNo Comments.

Revenue?

November 7th, 2009 by sameer
Respond

An interesting quote from “The Way I Work“:

Kids are coming out of school thinking, I want to start the next YouTube or Facebook. If a restaurant served more food than everybody else but lost money on every diner, would it be successful? No.
– Jason Fried

Having lots of users wont automatically generate revenue but it does indicate that you’ve got a useful product.  If something is useful, then you can probably make some money from it.  (Though its probably not as easy as slapping some ads on it and waiting for the checks to come in.)

You have to think about what makes the product useful (either to the user or an advertiser or another party).  If you’re looking to run a business, its probably okay to turn away some users in favor of converting the rest to customers.

Category: advertising  entrepreneurshipNo Comments.

New York, Redux

November 7th, 2009 by sameer
Respond

Like I said last time, I never take enough photos.

Columbus circle.  It looked really different in 1907.

Columbus Circle

Shake Shack.  Food tastes better when you eat it outside.

Shake Shake

Category: photosNo Comments.

Happy

November 7th, 2009 by sameer
Respond

Love this image that I found over at Minimal.  I think it looks even better with the colors inverted:

happy

Category: productivityNo Comments.

3 Characteristics of Comment Spam

November 1st, 2009 by sameer
Respond

spam_commentDo you have a blog?  Then you probably get spam comments.  If you’re like me, you probably get a lot more spam comments than real comments (sadly!).

Comment spammers seem to be clever people, here are three interesting patterns I’ve noticed to try to get past an approval system (these are all real examples from the past few days) –

Flattery

These comments will look something like:

Are you a professional journalist? You write very well.

or:

Thank you for this valuable post.  It changed my mind.

Who wouldn’t approve something like that?

Jokes

This is the latest form of comment spam that I’ve seen.  It looks like they’ve built up a large set of bad jokes like:

Did you hear about the cannibal who was expelled from school? He was buttering up his teacher.

or:

How you get down from an elephant? You don’t, you get down from ducks.

At least they make the process of approving comments more entertaining.

Irrelevant Insights

These comments are designed to be vague enough to be insightful in any situation:

Though Apple is expensive, its stocks rise quickly.

Category: bloggingNo Comments.