Print Page | Close Window

General file and ASP guidance

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=11231
Printed Date: 31 March 2026 at 1:17pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: General file and ASP guidance
Posted By: WebDever
Subject: General file and ASP guidance
Date Posted: 19 July 2004 at 11:56am

Hi all,

Note: I'm very much a perfectionist

 

I'm never happy with the way I work with ASP and files, for example I never know if when making comments I should type them like:

 

'Comment text

 

OR

 

' Comment text

 

Also when making big comments just like the copyright notice in web wiz guide applications, I don't know whether this looks better:

 

'********************

'** adsdasdasdasadasdsad

'** sadsdasdasdasd

'**********************

 

Than this:

 

'#############################

'## lkjadhlasjdlasjidlasidjoasijd

'## sjdhsldhjakdjhaskjdh

'#############################

 

After trying to work out what the best practice for that, I don't know what’s the best for naming conventions e.g.

incSendEmails.asp OR inc_send_emails.asp OR send_emails_inc.asp OR sendEmailsInc.asp

 

When I have files that are for reusable code should I call them code_bla.asp or maybe when I use files that are just functions should i call them just normal name or should I call them fcn_bla.asp.

 

Last Question: Is there like 20 clear ASP guidelines everybody should try to abide by to stay in good practice?? I know things like Option Explicit and declaring variables at the top of pages etc

 

Please help



-------------
--Ashley



Replies:
Posted By: dpyers
Date Posted: 19 July 2004 at 12:30pm

Regarding comments - identification of the comment in a manner that dosn't mask code is probably more important than technique. White space is as important as the comments.

If it's a large comment - use an "end of commented code" comment
Don't put comments on the same line as code unless it's for teaching purposes. An exception to this rule would be when you put dim statements on separate lines - add some whitespace and comment the dim on the same line.

For naming conventions, Hungarian Notation a.k.a. Prefix Notation is kind of a defacto standard.

I think 4guysfromrolla has a list of good asp techniques.



-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: WebDever
Date Posted: 19 July 2004 at 12:33pm
Okay, thanks for the prompt reply, but what does "Hungarian Notation a.k.a. Prefix Notation is kind of a defacto standard." mean??

-------------
--Ashley


Posted By: dpyers
Date Posted: 19 July 2004 at 12:48pm

You can probably google "Hungarian Notation asp" and get a complete list somewhere.
It's an old C language naming convention that basically attaches 2-4 characters in lower case in front of a variable name to indentify the data type of the variable. Each word in the variable other than the prefix starts with a capital letter - e.g.
strMyString
intMyInterger
objMyObject

It's been extended to incorporate all identifiers - not just data types - e.g.
tblMyTable
subMySubroutine
fncMyFunction
rsMyRecordSet
iMyIndex

It has it's pro's and cons, and some people hate it. It's particulaly useful for teams programming together. Supposedly it's deprecated by MS for ASP.NET as they tend to use a more explicit name structure to id things anyway, but I still see a lot of vb/asp.net code written with it.

In .NET The convention is called Camel - each word is capitalized with no prefixes. In an OO language, theoretically there are just objects, not data types. But a lot of people still use the prefixes to note how the object is used.

EDIT: Hears a list of the data type prefixes

String str
Boolean bool
Integer int
Double dbl
Object obj
Array arr



-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net