Writing as a learning activity