Tags: general principles
Least Suprise: Always do the least suprising thing. In other words, make it work intuitively. If a straight line search works, use that, instead of a complex search / hashtable / etc. The next programmer might think you weren't very good, but they will understand the code straight away. Which means you are good.
Last published: Tuesday 13th July 2010
<<Previous Next>>