3 ms·
Both of your examples are fine, as it is pretty clear what each method does. In such cases, the golden rule is "if you do it more than once, create a new funct
by Noughmad 14y ago
Both of your examples are fine, as it is pretty clear what each method does.
In such cases, the golden rule is "if you do it more than once, create a new function". I don't know what kind of things you program if you have 100-line functions with no code sharing.