Re: Coding Standards - are there any ?
This WebDNA talk-list message is from 2003
It keeps the original formatting.
numero = 48552
interpreted = N
texte = I actually have VERY strong feelings on this.I've tried to stick to strict naming conventions to avoid confusion in an essentially non-typed language:d_ should precede all database field namesm_ for math varst_ for text varss_ for skin vars (i.e if I allow for simple dynamic substitution of HTML layout properties)l_ for localized strings ---- I try to put all static strings in a separate include file to make localization simpler._ precedes all vars submitted through formsWhy is this important?#1 reason: scoping. It is very possible to end up having a form variable, a math/text variable, a database variable, and a tag all have the same name ([date] is a very common example...[cart] could be another...so could [subtotal] or many others....).Not only does this convention thus become self documenting, it also avoids common scoping issues before they even happen.I am a very strong believer in Hungarian notation (or variations of it) and always use it in my non WebDNA coding. After getting bitten a number of times with scoping issues in the past, I now adhere to this convention 100% of the time.Now, there is intrinsically no real reason to differentiate between a math var and a text var since it is possible to use one as the other, I still do for the sake of consistency.I'm very interested in hearing further comments on this..-howardAt 12:21 PM 3/10/2003, John Peacock wrote:>Tom Duke wrote:>> fFIELDNAME>> vVARIABLENAME>> rRECORDID>>That is similar to what is typically referred to as Hungarian notation for >C++:>>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsgen/html/hunganotat.asp>http://ootips.org/hungarian-notation.html>>Pay close attention to the Ugly section of the second link; don't rely on >the notation to be anything more than a comment when the code was >originally written that the variable had this characteristic.>>John>>-->John Peacock>Director of Information Research and Technology>Rowman & Littlefield Publishing Group>4501 Forbes Boulevard>Suite H>Lanham, MD 20706>301-459-3366 x.5010>fax 301-429-5748>>>------------------------------------------------------------->This message is sent to you because you are subscribed to> the mailing list
.>To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >>Web Archive of this list is at: http://webdna.smithmicro.com/Howard Wolosky------------------------howard@wolosky.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
I actually have VERY strong feelings on this.I've tried to stick to strict naming conventions to avoid confusion in an essentially non-typed language:d_ should precede all database field namesm_ for math varst_ for text varss_ for skin vars (i.e if I allow for simple dynamic substitution of HTML layout properties)l_ for localized strings ---- I try to put all static strings in a separate include file to make localization simpler._ precedes all vars submitted through formsWhy is this important?#1 reason: scoping. It is very possible to end up having a form variable, a math/text variable, a database variable, and a tag all have the same name ([date] is a very common example...[cart] could be another...so could [subtotal] or many others....).Not only does this convention thus become self documenting, it also avoids common scoping issues before they even happen.I am a very strong believer in Hungarian notation (or variations of it) and always use it in my non WebDNA coding. After getting bitten a number of times with scoping issues in the past, I now adhere to this convention 100% of the time.Now, there is intrinsically no real reason to differentiate between a math var and a text var since it is possible to use one as the other, I still do for the sake of consistency.I'm very interested in hearing further comments on this..-howardAt 12:21 PM 3/10/2003, John Peacock wrote:>Tom Duke wrote:>> fFIELDNAME>> vVARIABLENAME>> rRECORDID>>That is similar to what is typically referred to as Hungarian notation for >C++:>>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvsgen/html/hunganotat.asp>http://ootips.org/hungarian-notation.html>>Pay close attention to the Ugly section of the second link; don't rely on >the notation to be anything more than a comment when the code was >originally written that the variable had this characteristic.>>John>>-->John Peacock>Director of Information Research and Technology>Rowman & Littlefield Publishing Group>4501 Forbes Boulevard>Suite H>Lanham, MD 20706>301-459-3366 x.5010>fax 301-429-5748>>>------------------------------------------------------------->This message is sent to you because you are subscribed to> the mailing list .>To unsubscribe, E-mail to: >To switch to the DIGEST mode, E-mail to >>Web Archive of this list is at: http://webdna.smithmicro.com/Howard Wolosky------------------------howard@wolosky.com-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Howard Wolosky
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
WebCat2b13MacPlugIn - More limits on [include] (1997)
Multi-processor Mac info ... (1997)
Emailer setup (1997)
Cold Fusion Buster (1997)
Bug? (1997)
[quantity] quantity[lineindex] (2000)
Cookies and webcat (1997)
[WebDNA] [BULK] WebDNA 6.2 or 7.x Hosting (might be) Needed (2011)
Emailer (WebCat2) (1997)
Going to anchors within a template page (1997)
[OT] 'Email this story to a friend' (2003)
Uploading a file (2000)
Date Formats (1997)
Default admin bug and how tech support reacted to it. (2000)
shownext problems (1998)
Problem with Shared POP script (2003)
Anyone awake? Newby moves deeper! Sitesearch & Customer DB (2000)
WebCat/CyberStudio Compatibility (1998)
listfiles sort by moddate (2002)
Founditems context returning only 1 item (1997)