Hard Code List of Years?
<p>This is the scenario.  You've got a web form and you want to prompt the customer to select their birth year.</p>

<p>a) hard code the values in the dropdown list?
b) Grab valid years from a DB table</p>

<p>I can see a maintenance nightmare with copying a set of years hard coded in .aspx files everywhere.</p>

<p><strong>updated:</strong></p>

<p>for loop is not ideal (maintenance nightmare and error prone).  The user then has to sift through 120 years that haven't even got here yet.</p>

<p>I still like the DB approach:</p>

<pre><code>* Single point of data
* No duplication of code
* Update the table as needed to add more years
* Year table values could be used for some other dropdown for some other purpose entirely for something other than Birth year
</code></pre>

<p>Simple as that.  No need to go updating code everywhere.   I feel for data that is universal like this, we shouldn't be hard coding this shiza into a bunch of pages which is totally going against reuse and error prone...really it's not pratical.  I'd take the hit to the DB for this.</p>

<p><strong>Updated</strong> (again...after thinking about this):</p>

<p>Here's my idea.  Just create a utility or helper method called GetYears that runs that loop and returns a <code>List&lt;int&gt;</code> back and I can bind that to whatever I want (dropdownlist, etc.).  And I like the web.config idea of maintaining that end year.</p>
