Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - General file and ASP guidance
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

General file and ASP guidance

 Post Reply Post Reply
Author
WebDever View Drop Down
Newbie
Newbie


Joined: 28 September 2003
Location: United Kingdom
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebDever Quote  Post ReplyReply Direct Link To This Post Topic: General file and ASP guidance
    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

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
WebDever View Drop Down
Newbie
Newbie


Joined: 28 September 2003
Location: United Kingdom
Status: Offline
Points: 36
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebDever Quote  Post ReplyReply Direct Link To This Post 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??
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post 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



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.