Saturday, October 29, 2016

Reading Other People's Code is the Worst...But Also the Best

I would say that one of the best recent developments in the world of research is that more and more journals are making it official policy to post data and code associated with published papers. All of the AEA journals have this policy and so does the Review of Economics and Statistics (ReStat). I think making it easier for researchers to replicate papers makes for better published papers to start with and also results in more and better research going forward.

My official advice for graduate students starting new projects: Check the AEA journals and ReStat for papers using your data and download the authors' code. Look through it carefully. Learn from it. I bet you'll see lots of clever tricks for coding things that appear difficult. You'll also see directly how people describe what they do in the published papers. Yes, I know that reading other people's code is extremely painful, but trust me, it's often worth the trouble. Here is ReStat's data archive. You can download data and code for the AEA journals from the AEA website.

And now I'll end with a plea for you to write good code. From our friends at www.xkcd.com:

Code Quality 2

No comments:

Post a Comment