Top "Dry" questions

Don't Repeat Yourself, a software development philosophy which aims at reducing redundancy and code repetition.

How to avoid code duplication implementing const and non-const iterators?

I'm implementing a custom container with an STL-like interface. I have to provide a regular iterator and a const iterator. …

c++ iterator constants dry
Template function as a template argument

I've just got confused how to implement something in a generic way in C++. It's a bit convoluted, so let …

c++ templates dry generic-programming
How to customize to_json response in Rails 3

I am using respond_with and everything is hooked up right to get data correctly. I want to customize the …

ruby-on-rails ruby-on-rails-3 response dry respond-with
Load YAML nested with Jinja2 in Python

I have a YAML file (all.yaml) that looks like: ... var1: val1 var2: val2 var3: {{var1}}-{{var2}}.txt ... If …

python jinja2 dry pyyaml computed-properties
Localized project with several targets with localized app names

I have recently merged together 5 of my stand-alone projects into one project to have a common code base. So now …

ios xcode localization dry info-plist
In Specflow can I run one test as a step of another?

TL;DR; How can I create a specflow test that calls another test as its first step? Given I already …

c# unit-testing automated-tests dry specflow
Best way to handle view and helper-only constants in Rails

I have a constant that is only used in views, but it's used in different ways in different places. It's …

ruby-on-rails view constants dry helper
In which folder should I put "global" shared partial templates?

I am using Ruby on Rails 3.0.7 and I am planning to use partial templates. All classes in my application would …

ruby-on-rails ruby ruby-on-rails-3 templates dry
JSLint "eval is evil." alternatives

I am have some JavaScript functions that run on both the client (browser) and the server (within a Java Rhino …

javascript eval dry jslint
DRYing Views in Rails (number_to_currency)

I have code similar to: number_to_currency(line_item.price, :unit => "£") littering my views in various models. Since …

ruby-on-rails views dry