Cowboy Coding and the Pink Sombrero

By Joshua Siler on Jun. 28, 2011

Technology

"Cowboy coding" is the phrase we use around here to describe the practice of changing code directly on production servers. It’s not really a best practice, and we generally discourage it, but every once in a while it becomes necessary...

Development and deployment here normally consist of a disciplined process that includes code reviews in development, a staging server for business owner signoff and QA, and finally a push to production. Any change to the code requires going through all these steps again. It’s time-tested and works well, ensuring that we push out quality code and avoid errors.

That said, it takes time, and time costs money. Our clients are looking for us to be responsive; when they want the headline changed to a different shade of green on their website (just after launch, of course,) they don’t want to hear it's going to take two days. In those cases, it makes sense to jump onto the servers and make that one line CSS change--and make everyone happy immediately.

Even when it makes sense, cowboy coding is not something we take lightly. Anyone editing code on a production server is required to wear this pink sombrero for the duration of the work.

Having the pink sombrero on acts as a strong check and balance. Inevitably, the act of donning this flamboyant headwear causes a crowd to form. Lively discussion ensues:

"What do you have to edit? Do we really have to do this? Are we sure there will be no side effects?"

And it works. Purists might tell you that you should NEVER edit code in production, and that makes sense in a lot of environments. But we build marketing websites, where speed and responsiveness count as much or more than perfect reliability.

For the record, the last time this happened was a last-minute change nine days ago -- after we went live -- for our own website, and the change came from me.

I’m the worst client.

If you enjoyed this post, I'd appreciate a vote to bring Pink Sombrero to SXSW. For more Pink Sombrero, check out Part 2 Avoiding the Pink Sombrero: Potential Failure Modes of Automated Deployment.

  • Share