“Make it correct, make it clear, make it concise, make it fast. In that order.”
– Wes Dyer
This is a great quote for new coders. I think every teacher can think of a student that is way to fixated on writing fast code.
But that leads to two problems with newbie coders. Well, probably more than two. But two come to mind.
First, they might spend so much time trying to make the code perfect that they’re never actually able to get a working algorithm. And that’s something that can carry over once they leave the classroom. Code that solves a problem is better than fast code that doesn’t, and way better than fast code that doesn’t even run.
And two, often really efficient code isn’t intuitive to look at. Sure, they might understand what they wrote when it’s turned in. But what about a few weeks or months later? Would their peers be able to look at the code and immediately tell what it’s doing?
Now, I’m not suggesting that students shouldn’t work towards writing efficient code. It’s just that maybe it shouldn’t always be the first priority.