Discussion:
capitalization conventions: bast practices for VBScript?
(too old to reply)
Neil Zanella
2005-03-29 14:33:55 UTC
Permalink
Hello,

I am posting this message because I am curious as to which capitalization
conventions for VBScript are regarded as best practices, given that VBScript
is case insensitive. Basically, I am wondering whether to opt for using mixed
case or all lowercase in my scripts. This reminds me of fortran where the
convention was to use all uppercase, but it seems nowadays there is a
preference for having things lowercase like in C, because it speedier
to type.

Well, any feedback and recommendations welcome,

Best Regards,

Neil
Joe Earnest
2005-03-29 15:16:15 UTC
Permalink
Hi,
Post by Neil Zanella
Hello,
I am posting this message because I am curious as to which capitalization
conventions for VBScript are regarded as best practices, given that VBScript
is case insensitive. Basically, I am wondering whether to opt for using mixed
case or all lowercase in my scripts. This reminds me of fortran where the
convention was to use all uppercase, but it seems nowadays there is a
preference for having things lowercase like in C, because it speedier
to type.
Well, any feedback and recommendations welcome,
Best Regards,
Neil
Thoroughly personal judgment. MS examples and most scripters posting seem
to use some form of "camel casing", where the first character of each name
segment is capitalized, as in MyFunction, MyVariable. This is easier to
read than is fully uppercase or lowercase text. Markup language camel
casing seems not to capitalize the first segment, which ties in with
whatever typing prefixes you are using. This is the technique that I tend
to use: sMyStringVariable= oFso.getParentFolderName(sSomeFileVariable). I
use this for user-defined names and object methods or properties. I fully
lowercase VBS keywords, operators, inherent functions, etc. The color
coding in whatever editor you use is fully adequate to highlight and
differentiate inherent terms, without casing being an issue. Full
lowercasing has some small physical advantage (depending upon your editor),
in that it slams more characters onto a line, if using a variable-pitch
font.

Joe Earnest
mr_unreliable
2005-03-29 23:17:14 UTC
Permalink
hi Neil,

Stan Leszynski is generally credited with developing the naming
convention (the "Leszynski Naming Convention") used by visual basic
programmers.

You can google "Leszynski Naming Convention" and come up with
countless articles, _or_ you can just go straight to Stan-the-Man
himself.

http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccess/html/msdn_20naming.asp

cheers, jw
Post by Neil Zanella
I am posting this message because I am curious as to which capitalization
conventions for VBScript are regarded as best practices
Joe Earnest
2005-03-29 23:31:44 UTC
Permalink
Hi,
Post by mr_unreliable
hi Neil,
Stan Leszynski is generally credited with developing the naming convention
(the "Leszynski Naming Convention") used by visual basic programmers.
You can google "Leszynski Naming Convention" and come up with
countless articles, _or_ you can just go straight to Stan-the-Man
himself.
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccess/html/msdn_20naming.asp
cheers, jw
Post by Neil Zanella
I am posting this message because I am curious as to which capitalization
conventions for VBScript are regarded as best practices
Just to push the envelope on this, here's a quote from some material that
Alex Angelopoulos sent me from a draft article he was writing on naming
conventions:

Suggested naming conventions abound, most variants of Hungarian Notation
(HN), a standard for variable naming developed at Microsoft in the early
1980's for use in workgroup-based C coding. The real story is not this
convention but the concepts researched by it's father, Charles Simonyi. In
graduate research at Xerox PARC he extensively investigated group-based
coding. He focused heavily on how code can be improved by use of certain
shared conventions. To this day one of the clearer benefits of any naming
standard is ensuring that when you look at code you quickly can see what a
variable represents and what a function does.

And here's Eric Lippert's blog on naming conventions adapted to WSH:

http://blogs.msdn.com/ericlippert/archive/2003/09/12/52989.aspx

Unfortunately, EL's link to MS archives for Simonyi's original article
doesn't seem to work.

Regards,
Joe Earnest

Loading...