Quote:Originally posted by Programmer
The first rule simply says "do no optimize". Your first point is their 2nd rule... "do not optimize -- yet". This means don't do it until you know where you need to, which may include nowhere if it meets the performance targets.
1st rule of fight club: Don't talk about fight club.
2nd rule of fight club: Don't talk about fight club.
#1 The boss is always right.
#2 If the boss is not right, refer to #1
The above statements are duplicates, the 2nd rule is completely unecessary, yet it gives additional power to the 1st rule. Call it poetry
XP Optimization rules translation:
#1 Do not start writing a function by obfuscating your code with useless optimizations, potentially messing up your algorithm. (YouArentGonnaNeedIt)
#2 & #3 When you need to optimize, think about the best strategy first. Is your current algorithm the most efficient? If not, try another one. Make sure your instict is correct by collecting performance data, eg. profile. Only start writing assembly when you are out of options.