Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Code Speed
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

brandonh6k
Starting Member

2 Posts

Posted - 18 March 2003 :  16:43:48  Show Profile  Visit brandonh6k's Homepage
First off... Been using Snitz for a while and love it.

But I have a question:

I was looking over the code for Snitz and was wondering why everything is written out using Response.Write statements instead of escaping out of ASP script.

i.e.

...
Response.Write "some text"
...

instead of

...
%>
some text
<%
...

Escaping from ASP script is about twice as fast as using Response.Write.

Just curious... :)


Brandon Hunt

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 18 March 2003 :  17:03:00  Show Profile
quote:
Originally posted by brandonh6k
Escaping from ASP script is about twice as fast as using Response.Write.
That depends on the version of ASP.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 18 March 2003 :  17:13:07  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
quote:
Originally posted by Nikkol

quote:
Originally posted by brandonh6k
Escaping from ASP script is about twice as fast as using Response.Write.
That depends on the version of ASP.


And also how much you're switching in and out. If you do it as much as we do here on the forums, the speed change is negligible (versions prior to 3.4 did context switching)

Dave Maxwell
Barbershop Harmony Freak
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 18 March 2003 :  23:00:48  Show Profile  Visit Gremlin's Homepage
Under the stress testing I did a while back even heavy switching came out 20% or so faster actually Dave, having said that YMMV with each application I guess.

I think its hard for people to get out of the habbit as well, for ages we were told best practice was to reduce context switching, unfortunately now the opposite is true but people are still kinda "stuck in their ways" even when it can be demonstrated that switching has performance benefits.

Kiwihosting.Net - The Forum Hosting Specialists

Edited by - Gremlin on 18 March 2003 23:04:32
Go to Top of Page

PeeWee.Inc
Senior Member

United Kingdom
1893 Posts

Posted - 19 March 2003 :  14:20:20  Show Profile  Visit PeeWee.Inc's Homepage
It looks alot neater when it's in Response.Write

De Priofundus Calmo Ad Te Damine
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 19 March 2003 :  21:10:08  Show Profile  Visit Gremlin's Homepage
We've had discussions about it in the past and kinda agreed to dissagree I'm one of the few who actally think switching looks neater :)

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

Steve D.
Average Member

USA
640 Posts

Posted - 19 March 2003 :  23:13:05  Show Profile  Visit Steve D.'s Homepage  Send Steve D. a Yahoo! Message
I agree with Gremlin. I've gotten used to Response.writes, but they aren't neater from a ease of use standpoint.

Swing Dancing Video Clips - It's All Swing! Forum
Go to Top of Page

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 20 March 2003 :  04:12:08  Show Profile
I think that it depends on what the code does.

If there are lots of nested If then else end if statements then using Response.Write is easier to read.

If there are not many if statements then the inline html is easier.
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 20 March 2003 :  06:29:21  Show Profile  Visit Gremlin's Homepage
The trick is to really separate out as much of your display logic from your processing logic as possible. Do all the ASP work at the top of the page and assign the results to variables this way most of the time your context switching then involves little more than a <% = VariableName %> here and there between your HTML, sure there are times when this just won't do though but theres still ways around having convoluted if/then/else structures sitting right in the middle of a bunch of HTML.

Kiwihosting.Net - The Forum Hosting Specialists
Go to Top of Page

brandonh6k
Starting Member

2 Posts

Posted - 21 March 2003 :  19:15:10  Show Profile  Visit brandonh6k's Homepage
Ah, well. I figured it was a stylistic decision... :)

My personal preference is to switch rather than using response.write but, like most things, it's just a matter of taste.

Thanks everyone.

Brandon Hunt
Go to Top of Page

botNET
Starting Member

33 Posts

Posted - 25 March 2003 :  09:57:52  Show Profile
and with contextswitching it is easier to integrate the forum with a new site-design.

A good mix of context-switching and Response.Write would be the best ;o

/botNET
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07