No Two Ways
/I've been marking student projects for a while now and it never ceases to amaze me how, given the same problem, lots of people can come up with different answers. Some are much worse than the one I thought of, others are better. I love this (except for the ones which are way better than my design of course..)
Some of the students want to know what the "right" answer is. But of course there is no right answer. Some are faster, some are smaller, some are easier to use and some are easier to maintain. When you get good at this game you start to recognise the tradeoffs and can even code to make things big and fast (i.e. look up table) or small and slow (i.e. work it out each time). Me, I always write code for maximum clarity these days. The processors can stand a little inefficiency and I rate my time above any computers.
Some of the students want to know what the "right" answer is. But of course there is no right answer. Some are faster, some are smaller, some are easier to use and some are easier to maintain. When you get good at this game you start to recognise the tradeoffs and can even code to make things big and fast (i.e. look up table) or small and slow (i.e. work it out each time). Me, I always write code for maximum clarity these days. The processors can stand a little inefficiency and I rate my time above any computers.