3 ms·
The tendency is to lock in the first abstraction line that you thought of..which rarely ages well with future experience. My rule of thumb is that something ne
by btilly 9y ago
The tendency is to lock in the first abstraction line that you thought of..which rarely ages well with future experience.
My rule of thumb is that something needs to be a function if it is called 3x, doesn't if it is only called from one place, and if it happens 2x it is a judgement call whether to leave cross-referencing comments between the spots or to factor it out into a function. (If it is unlikely that I will need a third and the common code is difficult to extract, I will leave comments.)