Author |
Topic  |
ajhvdb
Junior Member
 
Netherlands
392 Posts |
Posted - 27 August 2002 : 17:56:52
|
I'm sorry but while i'm working on a Mod I always use OPTION EXPLICIT
In the previous version I got much more undeclared var errors so I'm assuming you want to get rid of them.
I know sometimes you can't declare a var because of all the different include's.
This is not a bug but maybe if you've the time could you declare and change some source in the standard code. I know it's working now but later on you will need a lot debugging finding errors with different var names.
If I find more things (to do's) like this can I post them also or not?
in file "config.asp" declare:
Dim scriptname, strCookieURL, strUniqueID, blnSetup, strDBNTSQLName, my_Conn, strDBNTUserName Dim strDBNTFUserName, chkCookie
in file "inc_func_common.asp"
around line 258 in function HTMLEncode(pString)
Dim fString around line 267 in function HTMLDecode(pString)
Dim fString around line 276 in function chkString(pString,fField_Type)
Dim fString ChkString = fString -->must be chkString around line 365 in function chkString(pString,fField_Type)
Case "edit" if strAllowHTML <> "1" then fString = HTMLEncode(fString) end if fString = Replace(fString, """", """) ChkString = fString exit function |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
Posted - 27 August 2002 : 19:13:03
|
It has never been our goal to be able to use Option Explicit. Dimming Variables is not a requirement. |
 |
|
@tomic
Senior Member
   
USA
1790 Posts |
Posted - 27 August 2002 : 19:38:28
|
There are reasons to Dim though. I thought doing that could potentially improve performance even if slightly and perhaps more importantly it's been suggested that doing this aides in a transition to .NET
@tomic |
SportsBettingAcumen.com |
 |
|
ajhvdb
Junior Member
 
Netherlands
392 Posts |
Posted - 28 August 2002 : 04:11:29
|
quote: Originally posted by RichardKinser
It has never been our goal to be able to use Option Explicit. Dimming Variables is not a requirement.
As I said some developers updated some of them but Ok I won't report them anymore.
|
 |
|
Davio
Development Team Member
    
Jamaica
12217 Posts |
Posted - 28 August 2002 : 04:20:27
|
Option Explicit is good for debugging. But after you finish debugging you can remove it. Because you don't need it unless you start working on the code again. |
Support Snitz Forums
|
 |
|
e3stone
Average Member
  
USA
885 Posts |
Posted - 12 October 2002 : 14:50:56
|
Option Explicit is good for developers, but after your code is finalized, then it's good to remove the Option Explicit. I've read that it can actually hender performance if you leave it in there. |
<-- Eric --> |
 |
|
Gremlin
General Help Moderator
    
New Zealand
7528 Posts |
Posted - 12 October 2002 : 19:01:34
|
Yes there is a Performance hit, avoid option explicit in production code. |
Kiwihosting.Net - The Forum Hosting Specialists
|
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 12 October 2002 : 20:00:20
|
I always use option explicit. Microsoft, 4guys, 15seconds and many other sites all refer to an increase in asp performance using option explicit.
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
Gremlin
General Help Moderator
    
New Zealand
7528 Posts |
Posted - 12 October 2002 : 20:36:09
|
Everything I've ever read says otherwise actually, there *is* an increase by Dim'ing your variables, but with option explicit the parser has to do an extra pass (or at least a more complex first pass) over the script to ensure everything is dimmed correctly hence the loss in performance.
|
Kiwihosting.Net - The Forum Hosting Specialists
|
Edited by - Gremlin on 12 October 2002 20:37:28 |
 |
|
bjlt
Senior Member
   
1144 Posts |
Posted - 12 October 2002 : 20:52:17
|
quote: Originally posted by RichardKinser
It has never been our goal to be able to use Option Explicit. Dimming Variables is not a requirement.
However, thanks ajhvdb for the report, as proper dimming may improve performance, it's worth to do it sometime by somebody and adjust it in the base code, if not now.
use option explicit in the development while remove it in the final product.
Just my $0.2. |
Edited by - bjlt on 12 October 2002 20:53:52 |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
|
Gremlin
General Help Moderator
    
New Zealand
7528 Posts |
Posted - 12 October 2002 : 21:34:21
|
Could be another case of it was "this way" under ASP2.0 and now its the complete opposite under ASP3.0 as well :)
To be honest I'm just damm lazy and don't use explicit full stop  |
Kiwihosting.Net - The Forum Hosting Specialists
|
 |
|
GauravBhabu
Advanced Member
    
4288 Posts |
Posted - 12 October 2002 : 21:43:04
|
I always prefer to use option explicit. I have several files of snitz already complete with each variable dimmed |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 12 October 2002 : 22:42:25
|
wow...I can't believe my eyes... 
Personally, I've always tried to use Option Explicit whenever I can. Like Doug said, Microsoft and everyone else has always said that it should be used when possible. Not only is it a performance thing, but also helps to avoid some problems later down the road.
I honestly can't recall ever reading anything that recommended not to use Option Explicit for performance reasons. |
 |
|
bjlt
Senior Member
   
1144 Posts |
Posted - 12 October 2002 : 23:46:39
|
I've seen articles say that it's better to remove it in the final production, however I don't know if it's the same for 3.0. Well I think it's good to use it while programming and remove it finally, as you know all variables are declared there's no need for the check and you know nothing will be treated as a variable on the flash. |
 |
|
Gremlin
General Help Moderator
    
New Zealand
7528 Posts |
Posted - 13 October 2002 : 01:20:39
|
Dim'ing a variable still leaves it as a variant type until such time as a value has been assigned to it, unlike Const which does cast the variable type immediately (but then your assigning a value to it immediately as well).
I know pleanty of sites claim performance is better with it switched on, but I've never seen anything to actually back that up, I'm sure theres some truth in it like most things, I didn't believe Context Switching was over 10% faster than pure Response.Write either till I actually tested it myself.
Guess maybe I'm just stubborn.
|
Kiwihosting.Net - The Forum Hosting Specialists
|
Edited by - Gremlin on 13 October 2002 01:21:39 |
 |
|
Topic  |
|