Article View: a.a.mis.admin
Article #35Re: Type identifiers use memory?
From: SCEA
Date: Sat, 14 Jun 1997 00:00
Date: Sat, 14 Jun 1997 00:00
47 lines
2771 bytes
2771 bytes
Yes, MS says don't use type identifiers, but they use them all the time. The simple fact is that when you are dealing with code items such as API declarations "Byval StrAbc$" takes up a lot less space than "ByVal StrAbc as string". When you have a list of six or seven parameters (not uncommon), it stretches off the screen. Readability suffers and consequently you get MORE errors from miscalls with wrong types rather than less. As for searching for StrAbc$...just don't. Search for "StrAbc" and you will get both "StrAbc" and "StrAbc$". As a general rule, the only place I would use the type identifiers is in the declaration. They are optional elsewhere (and are a pain to type). Therefore, from an operational standpoint, you still use var names with Str, Int, Lng, etc. and the only difference is in the dim statement. NEVER rely on someone typing abc$ to indicate a string. The $ can be dropped without the compiler complaining. The bottom line is you shouldn't make a flat statement to not use type declaration characters because MS says not to in a document, since they violate their own naming rules whenever it's convenient for them. Chuck Bonner <chuck.bonner@stoneweb.com> wrote in article <01bc7802$f03ba640$8510046f@vms2238>... > Robert, > However, according to the <A > HREF="http://www.microsoft.com/kb/articles/q110/2/64.htm">LONG Microsoft > Consulting Services Naming Conventions for VB</A>, these type identifier > suffixes are not recommended. > > I can confirm from long experience in many development teams that they are > a nuisance. For instance, if you want to find all references to a variable > and you highlight the declaration, "strName$," the search will not find > places where the variable is referred to as "strName." What is the name > of this variable? Does it have a "$" in it or not? The answer is, yes, it > has a "$" in it or not. > > Do yourself and your colleagues a favor. Don't use them. > > -- > Chuck Bonner > Stone & Webster Engineering Corp. > Chuck.Bonner@stoneweb.com > >
Technical Details
Message-ID:
<01bc7858$11663f60$e74331a2@patrick-marshal.interactive.sony.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<01bc7761$4328ed60$0f66ad0a@l6024588> <01bc7802$f03ba640$8510046f@vms2238>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f9608,e3e0b3477ba3f22a X-Google-Attributes: gidf9608,public X-Google-Thread: 110e3b,e3e0b3477ba3f22a X-Google-Attributes: gid110e3b,public X-Google-Thread: ffc75,e3e0b3477ba3f22a X-Google-Attributes: gidffc75,public From: "SCEA" <pmarshal@pacbell.net> Subject: Re: Type identifiers use memory? Date: 1997/06/14 Message-ID: <01bc7858$11663f60$e74331a2@patrick-marshal.interactive.sony.com> X-Deja-AN: 248257125 References: <01bc7761$4328ed60$0f66ad0a@l6024588> <01bc7802$f03ba640$8510046f@vms2238> Organization: SCEA Newsgroups: a.a.mis.admin,comp.lang.basic.visual.misc,microsoft.public.vb.syntax