Programmers like writing code but few love reviewing it. Although code review is mandatory at many companies, enjoying it is not. Here are some tips I’ve accumulated for getting people to review your code. The underlying idea behind these suggestions is that the person asking for review should spend extra time and effort making the pull request easy to review. In general, you can do this by discussing code changes beforehand, making them small, and describing them clearly.
At this point you may be wondering who died and made me king of code review (spoiler: nobody). This advice is based on my experience doing code review for other engineers at Twitter. I’ve reviewed thousands of pull requests, posted hundreds of my own, and observed what works and doesn’t across several teams. Some of the tips may apply to pull requests to open-source projects, but I don’t have much experience there so no guarantees.
I primarily use Phabricator and ReviewBoard, but I use the term “pull request” because I think that’s a well understood term for code proposed for review.
If you talk to the people who own code before you make a change, they’ll be more likely to review it. This makes sense purely from a social perspective: they become invested in your change and doing a code review is just the final step in the process. You’ll save time in review because these people will already have some context on what you’re trying to do. You may even save time before review because you can consider different designs before you implement one.
The problem with skipping this step is that it’s important to separate the design of the change from the implementation. Once you post code for review you generally have a strong bias towards the design that you just implemented. It’s hard to hear “start over” and it’s hard for reviewers to say it as well.
(Cross-posted from Medium, a site that people actually visit).
Around this time last year I spent a lot of time walking around, thinking about all the things I wanted to teach my daughter: how a toilet works, how to handle a 4-way stop, how to bake cookies. One year later, the only thing I have taught my daughter about toilets is please stop playing with that now, sweetheart, that’s not a toy. Babies shouldn’t eat cookies. And driving is thankfully limited to a push toy which has nonetheless had its share of collisions. On the other hand, I can recite Time For Bed and Wherever You Are My Love Will Find You from memory. Raffi is racing up the charts of our household weekly top 40. I share the shower every morning with a giant inflatable duck. It has been a challenge and yet still joyful. Here’s an assorted collection of observations and advice from someone who just finished his first trip around the sun as a parent.
I can't believe it has been a year already. Happy birthday, Sam! (cake) pic.twitter.com/ZtxvIYs222— Ryan Greenberg (@greenberg) January 7, 2016
Speaking of advice, I try not to give too much to new parents. They have surfeit of books, family, friends, and occasionally complete strangers telling them what they should and shouldn’t do. I don’t want to be one more voice in that cacophony. The first months with a new child is a struggle, and you have to do whatever it takes to get through them. Sure, there are probably some universals when it comes to babies, but as someone who has done it just once, I’m not a likely candidate to know what they are. I’m happy to tell you what I think, but only if you want to know. Let’s just assume for the rest of this article that you want to know.
Instead of "You should do this," I think much advice would be better received as "I did this, it worked for me, it might work for you."— Ryan Greenberg (@greenberg) November 24, 2015
That said, please vaccinate your kids.
Yesterday afternoon I was out with some friends, having a beer at Jupiter, a restaurant in Downtown Berkeley. As I took a drink, I saw a beautiful colorscape at the bottom of my glass.
I looked up and realized the color was a reflection of a billboard on the side of the building, advertising the very hefeweizen I was drinking.
I tilted my glass and tried to get a better shot.
This one is almost unrecognizable as a glass of beer, but I love the colors.
Pilots will tell you that the most dangerous part of flying is takeoff and landing. This is correct, though it’s most dangerous for people who aren’t busy flying the plane. Shortly before takeoff the doors to the aircraft are closed. From this point on the FAA requires passengers to shut off their electronic devices—the primary means of entertaining oneself in the 21st century—until the aircraft has reached its cruising altitude. Your Kindle off, there’s nothing to read. Your iPad off, there are no angry birds to avenge. Your eyes drift towards the seatback pocket, the only remaining source of entertainment until 10,000 feet. Safety card? Boring. Motion sickness bag? Gross. Oh, hello there, SkyMall.
This is the story of how I stole my bike.
In 2008 I moved to Berkeley, California to start grad school. There are a lot of things that are nice about Berkeley, but driving is not one of them. The city makes having a car painful. Finding parking downtown is a nightmare and enforcement officers can spot an expired meter 2 miles away. Comparatively, biking is glorious. There are racks for parking everywhere. The city has designated certain streets Bicycle Boulevards, which run parallel to major streets, just a block removed from heavy traffic.
Even though I was on a student budget, I knew I wanted a bike to get around. Eventually I found my new steed, a Kona Dew Deluxe. After tax it set me back $706.86, which is a lot of money but I justified the price to myself because my last bike lasted almost 10 years.
For 36 days, life was good.
In 2007 I created my Twitter account in an Internet cafe in Santiago, Chile because I read on some blog that it was a big deal at SXSW. I spent some time deliberating between the username
@ryangreenberg (which I use on a number of other services) and
@greenberg. Eventually I decided on
@greenberg because it seemed like being short was a big deal on Twitter. Just a few minutes ago I posted my 3,000th tweet on Twitter. Four years and a few thousand tweets later, not only am I still tweeting, but along the way I somehow ended up working for the company. What a ride.
Here’s a Harper’s Index-style look at my first 3,000 tweets:
And here are a few of my favorites.
My shortest tweet—four characters—is how I let friends and family know my then-girlfriend’s response when I asked her to marry me:
Yes.— Ryan Greenberg (@greenberg) May 23, 2009
And the next year when we tied the knot:
Hey @caitearly, I’m on campus. Let me know if you want to hang out or get married or whatever.— Ryan Greenberg (@greenberg) October 2, 2010
A couple graduations:
It’s official: the sister is a college graduate. Congratulations!— Ryan Greenberg (@greenberg) May 18, 2008
And starting work at Twitter:
I’m going to start tweeting like it’s my job. And I’m delighted that, as of today, it is. Hi @twitter!— Ryan Greenberg (@greenberg) June 14, 2010
I’m looking forward to the next kilotweet. If you are too, follow @greenberg over on Twitter.
Last week the FBI seized the file exchange site MegaUpload through a court order. Previously, users could exchange files too large to email through the service. Now visitors to the site see this message:
The significance of a website seized by law enforcement is heightened in light of the controversial SOPA and PIPA legislation currently being considered in Congress. Given the high stakes—the open exchange of information in a free society, government interference with the Internet—I feel compelled to let the people at the FBI know what I think.
Guys, this is embarrassing. Really amateur hour. Seriously, look at this again:
Where have I seen a better looking image? I mean, other than every movie ever made that shows a computer screen?
I don’t even know where to start. Fine, the seals. Any one of these seals by itself is like starting the drive from your own five-yard line. The three together is handing the ball to the other team and carrying them into the end zone. You’re not into football metaphors? OK, a seal crammed full of text like “National Intellectual Rights Coordination Center” is the design equivalent of dividing by zero. All three is taking the limit of bad design as it approaches zero and it evaluates to negative infinity. Math isn’t your thing? No sweat—what I said doesn’t make sense anyway. The point is, the seals are ugly.
But they’re your logos, you say? I feel badly saying this, but they look like someone just slapped them together at 4PM on Friday after a lunchtime happy hour. Take the right one. It says, “Protection is our trademark.” I’m not a IP genius, but it seems to me like if protection really is your trademark, and you want people to take it seriously, you need to use that symbol. Like “Protection is our trademark™” or maybe “PROTECTION™”. But since you’re not actually selling anything or engaging in trade, maybe it would be more accurate to say that protection is your service mark. You don’t see that little SM enough.
As if the seals weren’t texty enough already, someone put “FBI ANTI-PIRACY WARNING” on top of the middle one. Is that part of the seal? Operating under the dubious assumption that there’s any design merit to this logo in the first place, the last thing you want to do is cover up your logo. Can you imagine Nike labeling clothes with its swoosh but then covering half of it up with “GARMENT CARE INSTRUCTIONS”?
Who picked the color scheme for the background? Had this person eaten a hot dog recently? That’s the only way I can figure it out. You can’t even read the complete word “seized” once in this tiled background.
The cited list of alleged crimes at the bottom is a nice touch, but, guys, what are we doing with the typography here? A big block of bold, italic, centered text. I read the first line and I think, “This is heavy stuff—they’re being changed with Conspiracy to Commit” and then I get confused until I realize that it’s Conspiracy to Commit … Copyright Infringement (18 U.S.C. § 371). I know how to continue reading on the next line, but you’re taking some serious liberties with awkward line breaks.
Let’s check out the source of the page:
<html> <title>NOTICE</title> <body> <img src="banner.jpg"/> </body> </html>
What we need to focus on is what a colossal missed opportunity this is for you. MegaUpload is down and the notice on the site is getting tons of exposure and when you go there it’s like you’re stuck watching the beginning of a movie forever, or at least that’s what it seems like for those people who paid for the movie and have to watch the FBI reminder to pay for the movie.
You must plan these operations, right? I mean, it’s not like you just randomly seize private property on a whim. This is a failure of project management. You can’t just bring in a designer at the last minute and expect them to polish your design turd. This is your chance to shine. Go wild. Animation, maybe a Matrix-style flow of numbers in the background. Ominous type. Here are some ideas:
There are probably jQuery plugins that do all these effects already and you could use those as framework to build on. So dust off your copy of Photoshop. Use the mosaic filter. Add some lens flares. Watch Sneakers and Hackers and The Net and The Matrix and Tron and WarGames. Stay away from Papyrus. Then go and take down MegaUpload and put up something amazing. This is your moment: seize it.
I took this photo of a red panda at the San Diego zoo last month. Notice anything funny about it?
Every person looking at the panda, this photographer included, is seeing it through the lens of a camera. Or on a smartphone LCD screen. It makes you wonder why we are so intent on capturing a moment for posterity that we may never have really seen in person.
So you know how some musicians won’t have any new good songs in awhile and then they’ll release a greatest hits album just to cash in? Anyway, no reason.
Last week yet another friend told me he’s traveling to Chile, news that makes me simultaneously jealous but excited that he’ll get to experience one of my favorite places. Whenever I hear about someone visiting Chile I want to dispense all of the peculiar observations and advice—much of which is probably now outdated—that I accumulated in the years that I was there. I’ve written a bunch of one-off emails with shameless linking to my blog, so I thought I might as well collect those links here.
Owing to the country’s slim figure, traveling in Chile is mostly movement along a single axis: north or south. Busses run up and down the country in three classes, normal, semi-cama, and cama, with increasing prices and degrees of seat recline-ability. I wasn’t living in Chile to travel, but I was fortunate to end up seeing many destinations anyway. Here are a few I wrote about:
Many people also rave about San Pedro de Atacama, a small town by the Valle de la Luna in the Norte Grande.
If you are planning on visiting Chile for more than a few weeks and you speak Spanish, you absolutely must get a copy of How to Survive in the Chilean Jungle. It’s the definitive guide to the cornucopia of Chilean slang and expressions.
These aren’t real language lessons. They’re just my screw-ups. Maybe they’ll make you feel better about your own. Whatever you do, no matter how old you are, remember that you only have one ano.
If you’re going to Chile, I hope you find something interesting here to get your excited for your trip.