Re:Programming like a Pirate (Alt+Shift+M)
by Noughmad on Tuesday December 04, 2012 @11:53AM
(#4871802)
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.
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.