Learning to code with scientific examples