Learning to write code