[thelist] Re: getRows() (was: commenting code)

Mike Hardaker mike at angloinfo.com
Fri Feb 16 03:50:50 CST 2001


Generally (and rather crudely) speaking:

<% MyString = foo()
Mystring = "<b>" & MyString & "</b><p>"
Mystring = Mystring & "<b>"
Mystring = Mystring & bar()
Mystring = Mystring & "</b>"
Response.write Mystring %>

Is quite good.


<%response.write "<b>"
MyString = foo()
Response.write MyString
Response.write "</b><p>"
Response.write "<b>"
MyString = bar()
Response.write MyString
Response.write "</b>" %>

Is worse.


<% MyString = foo() %>
<b><%= MyString %></b><p>
<% MyString = bar() %>
<b><%= Mystring %></b>

Is worse still - my rule of thumb is that multiple code blocks are worse
than multiple Response.writes, which in turn are worse than a single one.
This is based, however, on what seems to work best rather than and
heavy-duty performance testing with the proper kit.

Having said that, the slower approaches *can* result in far more readable
code in some cases...


> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of Norman Beresford
> Sent: Friday, February 16, 2001 10:05 AM
> To: thelist at lists.evolt.org
> Subject: Re: [thelist] Re: getRows() (was: commenting code)
> Hi Matt
> Is it actually slower to use GetRows with under 250 rows?
> Just a quick amendment to Madhu's comment about seperating ASP
> and HTML into
> seperate blocks and using response.writes.  My understanding is that
> mutliple calls to the response object slows things down as well.
> It's best
> to build the entire page as a string, and then response.write it all with
> just the one call.  Would I be correct in assuming this?
> Norman
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list