1. 8
  1.  

  2. 9

    Everytime I see DRY mentioned, I die a little. Most of the time, it’s used wrong. DRY is not at all about not writing a string of characters twice. The original definition is:

    “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”

    Especially “buttons are round” and “buttons are blue, unless otherwise stated” can perfectly well be implemented using to seperate CSS statements under DRY. They are seperate information. Their target being the same is a sideshow. Applying DRY properly requires a systems view and can rarely be decided by looking at syntax.

    In the Ruby community, I had far too many discussions about whether

    attr_accessor :foo, :bar, :batz
    

    is DRYer then

    attr_accessor :foo
    attr_accessor :bar
    attr_accessor :batz
    

    It’s completely irrelevant, both encode the same thing, from a systems view.

    1. 6

      Quite right. And there’s nothing more annoying than well-meaning people who, in an attempt to make things DRYer, have to come up with awkward gymnastics in their code to prevent a few lines from looking the same at the cost of debuggability and maintenance.

    2. 5

      So css gzips pretty well… it,s a feature.

      1. 1

        That’s the first thing I thought too. The only other reason CSS would need to be small is maintainability, but since CSS is a hack to begin with, it’s not really worth maintaining when it works well enough with bits of duplicated CSS scattered about.