There is no doubt that adherence to a set of specifications in development will help improve the readability of the code and lower maintenance costs later on.
File storage Directory Specification
JS directory contains the JavaScript script file that the page uses, because we may use the Free JavaScript Framework library (Prototype.js, JQuery) provided by the third party, so we create the Lib folder specially, Used to store these script files.
The include directory holds our usual functions, and the Lib directory holds the class files for code reuse.
In addition to the folders listed above, we will also set up a few folders, they will not be published, just for their own use.
Programming Style Specification
1, try to make the ASP code and HTML code apart, in the HTML code does not exist large chunks of ASP code, if you can keep the data in the variable, and in the HTML code in the form of the following call, so modify the page layout will be more convenient.
<% = VariableName %>
2, in a page, try to write ASP code in front of the HTML code, so easy to read and modify.
3, at the top of each page are added pretreatment quality, the following form
<% @LANGUAGE = " VBSCRIPT " CODEPAGE = " 65001 " %>
4 . Add the quality of the mandatory variable declaration at the top of each page to avoid errors caused by misspelled variable names. The following form
<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%><%Option Explicit%>
5, Loop, judgment and other statements using 2 spaces to indent, more complex statements, even if the comments are indicated
6, integer variable i start, single-precision real variable f start, double precision real D start, character s start, integer array type I_array_ start, constant recommended all uppercase, Function procedure name first letter uppercase
7, any object created with CreateObject, should be released at the end of the page, as follows:
<% Set =nothing%>
8 . When the data is open, close the connection at the end of the page.
Above just play a role, summed up their own experience, designed to meet their actual programming norms.
Introduction to ASP (16)-asp Development specification