As a general rule of thumb I don't hardcode anything that could be user configurable or is likely to change on a regular basis. All program configuration is stored away in a config file. YMMV on this but this is a policy that is enforced here at work and seems to work out quite well for us to be honest.

In my shop we have a development group and an application support group. The application support group are not programmers but are quite technically savvy and are responsible for program configuration. It's quite nice for them to be able to modify a config file if there are any minor tweaks needed (i.e a different directory, a different URL, maintaining an email distro list etc). That way we don't have to release a new version of the program when one of these minor tweaks is needed.

Config files start making a lot of sense if you have quite a strict ticketing->development->QA->release process like we do here at work. If some of those configuration type items were hardcoded, it might take one or two weeks just to get a new release out.

As I said, YMMV but config files seem to work out rather nicely for my development group.

-- vek --

In reply to Re: config file vs. __DATA__ by vek
in thread config file vs. __DATA__ by Popcorn Dave

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.