O'Reilly logo
  • Gustavo Lopez thinks this is interesting:

The knowledge that rims are at [0] should not be duplicated; it should be known in just one place.


Cover of Practical Object-Oriented Design in Ruby: An Agile Primer


['rim','tire size','whatever'] ... your program (in many places should not have) ... array[1] to find the tire_size .... This is called LEAKY and means that it's BAD encapsulation of data ... and breaks the DRY principle... That is, knowing that array[1] is tire MUST be known in more than one place