3 ms·
I really think the concerns about bad code are overblown. I had a friend in college who, for a CS class's final project, wrote an entire game in Java within a s
by mistercow 14y ago
I really think the concerns about bad code are overblown. I had a friend in college who, for a CS class's final project, wrote an entire game in Java within a single, enormous function body. I still don't know how he even managed to do it, but it basically worked and he passed the class. He sort of understood how functions worked, but he found them confusing, so he didn't use them.
This wasn't at some community college or anything. This was at Georgia Tech.
That's an extreme case, and I certainly am not saying that just because it happened in a respected engineering school, that makes it acceptable. But my point is that in entry level courses (like the ones where you'd be implementing a clip function), even professors grade on getting the job done. Code quality just doesn't enter the picture at that level.
The thing is, trying to teach good code directly is pointless. Your less bright students will accept the dogma and never actually understand how to apply it usefully. Your brightest students will see it as a bunch of useless bullshit that's holding them back.
If you want to teach good code, here's how you do it: Make a student write and maintain a large project. Make them keep it running for two years, while you make them add more and more features. Keep checking it against an automated test suite which they do not have access to, and grade them on its correctness. Give them the resources to learn about best practices, but never tell them they have to use them.
Then, at the end of two years, let them rewrite it from scratch. Then you will see a student who has learned the value of good coding practices.