[quoted text, click to view] "Rob Meade" wrote:
>
> For myself it is *very* common place to have pages in excess
> of 1000 lines, one application I've written recently has a
> main page which then based on user selection might include 1
> of 4 or 5 .asp's into it- thus again generating a mammoth
> total page...
Are you actually seeing line numbers over 1000, or are you counting the
lengths of the #includes?
[quoted text, click to view] > I just wondered what the norm was...
Do you post scripts back to themselves? That would certainly add to the
length. As could the construction of SQL strings instead of SP calls,
depending on complexity.
I can't speak for anyone else, but my scripts tend to be under 300 lines,
with about 20-30% whitespace or documentation, and typically under 100 lines
of server-side code. I often use process-and-redirect scripts, which are
typically quite short.
Most of my process-and-display scripts also #include about 900 lines, of
which the vast majority is corporate branding for common look & feel. That,
in turn, is lessened by the use of client-side .js and .css files (as
opposed to inline). If not for these abstractions, I would certainly exceed
1000 lines on almost every script.
-- ASIDE --------------
One of the most burdensome scripts I can recall was one I made intentionally
large. I had previously agreed to code a "20 question" survey. When the
final copy hit my desk (a week before the deadline and *after* the paper
version had already been printed) it turned out there were 20 *sections* and
132 questions.
Normally I would break such a thing into multiple scripts, but the time
constraints and my sense of being ambushed convinced me to do the whole
thing in one page -- and post back. Even so, it's a slim 600 lines (plus the
boilerplate includes), of which only 20 or so are devoted to storing the
responses and roughly 100 to populating the various sets of OPTION tags.
I certainly think my script is easier to navigate than the survey it
produced (users predictably complained of survey fatigue). I needed an
"emergency" to make it 600 lines. 1000+ sounds like a crime to me. In fact,
I have a colleague who writes 1000-line scripts, and I absolutely HATE
working on those things**. Ugh.
**Confession time. I also hate them because they are unstructured. I
separate processing from presentation as much as possible, whereas my
colleague does not. My HTML sections are continuous, with tokens for the
dynamic content. The only interlacing I do looks something like this...
<INPUT NAME="LastName" VALUE="<%=Page.LastName%>">
or <SELECT NAME="Ethnicity"><%=Page.EthnicityList%></SELECT>
or <TABLE><%=Page.TableRows()%></TABLE>
....where [Page] is the only variable I declare with page scope.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.