Dont copy code

Well it hits me so often… I’m using copy&paste to build similar code. And then it fires me back, when I made some stupid typo. Finding case of such errors is usually very annoying…

I was adding several fields to table in Rails application. I wrote migrations self.up and used this as a skeleton for remove_column in self.down. Of course I have left one coma to much, and struggled over 20 minutes to find what was wrong…

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.