100% agree. As I’ve said before - many people think DRY (“don’t repeat yourself”) means syntax or structure, when it really means concepts.https://twitter.com/rtfeldman/status/1092885754265489408 …
-
Show this thread
-
If you have to add a conditional in your reused code, you shouldn’t be reusing itpic.twitter.com/dTNWErJf6K
3 replies 31 retweets 96 likesShow this thread -
Replying to @sarahmei
depends on the conditional. Branching on changes in logic -- bad, don't do that. Branching for changes in data... make that a parameter or some other refactor
1 reply 0 retweets 1 like -
(sometimes it's not clear that you're branching on data! Maybe the data is a result of a bunch of branched logic.)
1 reply 0 retweets 0 likes -
Replying to @ywwg
Hmm. I find the line between code & data is fuzzy in many codebases - i.e., a hash gets passed in with a bunch of optional params that alter behavior. Code or data? Sorta both???
1 reply 0 retweets 0 likes -
Replying to @sarahmei
exactly. But that's why we get paid the big bucks, to figure out refactors that clarify these issues :)
1 reply 0 retweets 0 likes
I just did a refactor that was able to pull conditionals out of the implementation this way, that's why it came to mind
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.