hansn wrote:I would probably implement this using classes. I always prefer to have a name for my values in stead of accessing them simply by list index. I also think it would simplify your sorting issue a lot.
The problem is that people just learning their first programming languages are not in a good position to learn a complex, though awesome, paradigm like OOP. It's an advanced topic that requires as much study if not more than a first language, and goes on top of the knowledge of that language and some experience of problem solving in programming. Besides that, if you've had some experience doing something a more primitive way like is going on here, when you're shown OOP, you can have some appreciate for it.
I'd consider myself an OOP evangelist, but you should definitely be careful about throwing it around. At my alma mater, it's typically a second year course, and for good reason. (I'd argue that might even be a bit soon to really
do it right, but time doesn't permit doing it any later than they already do.)