In undertaking web site design/programming projects, I was wondering if it is common for the gurus to keep two sets of files. One for development, and one for production as in jQuery.
The reason is that I have a project which has the Markup & CSS very heavily commented by me. Also the code is indented, spaced and tabbed. For example
Mark Up
<!-- START google translate script link ================================================================== -->
<meta name="google-translate-customization" content="9f841e7780177523-3214ceb76f765f38-gc38c6fe6f9d06436-c"></meta>
<!-- END google translate script link ==================================================================== -->
<!-- START stylesheet link =============================================================================== -->
<link href="styles/main.css" rel="stylesheet" type="text/css" media="all" />
<!-- END stylesheet link ================================================================================= -->
<div id="header_text"><!-- START header_text ============================================================= -->
<h1 id="first-child">Pak United Food Services Ltd.,</h1>
<h1 id="last-child"><a href="http://www.pufs.org/" title="www.pufs.org">PUFS</a></h1>
<span></span>
</div><!-- END header_text =============================================================================== -->
CSS
/* START import ------------------------------------------------------------------------------------------- */
@import url("reset.css");
@import url("feature-carousel.css");
/* END import --------------------------------------------------------------------------------------------- */
/* START wrapper ------------------------------------------------------------------------------------------ */
div#wrapper
{
width: 100%;
font-family: Calibri, Arial, Georgia,Times, 'Times New Roman', serif;
font-size: 16px;
line-height: 22px;
background: url("../images/bg.jpg") repeat scroll 0 0 #1D2426;
}
/* END wrapper -------------------------------------------------------------------------------------------- */
And so on. Surely I should not use these files for deployment. Ideally they should be trimmed with all the comments, spaces, indents, tabs, (even EOL’s?) removed. But once that is done the code will be very unfriendly to read.
So should we have than two file sets?
It is a very very bad idea to have two sets of files. Sooner or later you will make a mistake and one will be out of step with the other.
Why not have a deployment procedure? Part of that procedure could be taking a snapshot of the files and running a script over those files to before deployment to remove spaces etc.