Writing software inherently involves resolving ambiguity. Often, there are two competing forces and you need to strike a balance. Knowing how to make such a tradeoff comes from accumulating experience, from developing taste. A tradeoff I often balance is between writing DRY code and admitting that YAGNI.
When I was in my first internship at the end of college, my friend who got me the job was a big proponent of DRY. Once I learned the definition, writing code any other way seemed totally dumb. "The whole idea of programming is to automate drudgery," I remember another colleague telling a more impressionable me. "Never write anything twice!" I nodded along, enlightened.
I remember reading The Elements of Style in high school, feeling empowered with all sorts of tactics to express thoughts in the written word better. Many years later, I would read about a published author on social media who once loved Elements too. He said it took him years of writing to unlearn its lessons.
You can't edit what you didn't write. You can't optimize code that's not written yet. DRY feels like a distraction from solving the actual problem.