(no title)
bioneuralnet | 2 years ago
Instead, if you focus on not repeating the important “knowledge” of your code (algorithms, business rules, etc), it’s easier to avoid the trap of over-abstracting.
bioneuralnet | 2 years ago
Instead, if you focus on not repeating the important “knowledge” of your code (algorithms, business rules, etc), it’s easier to avoid the trap of over-abstracting.
joshstrange|2 years ago
Better put, if you have logic A, B, C, D and 2 code paths:
Code path 1: ABD
Code path 2: ACD
Then you should have:
Function 1: ABD
Function 2: ACD
Not
MegaFunction: A (if X then B) (if !X then C) D
Too many people see a common “A” and “D” and rush to have a common function that if/else’s the B/C.