Re: [WebDNA] Anyone use this coding style for readability...
This WebDNA talk-list message is from 2010
It keeps the original formatting.
numero = 105464
interpreted = N
texte = More and more I avoid using [raw] too. Mine often are used=20with forms and look like:[text secure=3Df]a=3D[/text]Then, if no a is passed, I don't get ugly [a] code showing=20up; just a nice clean nothing. Yours would be like[text secure=3Df]c_id=3Dundefined[/text][showif [c_id]=3Dundefined]Customer id is=20not=A0defined.[/showif]TerryOn Fri, 2 Jul 2010 21:50:21 -0500 Kenneth Grome
wrote:> I don't use your question mark convention, but I don't=20>use [x]=3D[raw][x][/raw] either. Instead I preset my=20>variables at the top of the page like this:>=20> [text secure=3Df]a=3Db[/text]>=20> Using 'secure=3Df' allows incoming formvariables to=20>override the 'a' value and change it. Then I can use a=20>simple comparison to see if the 'a' value has been=20>changed:>=20> [showif b=3D[a]]no change[/showif]> [showif b![a]]changed[/showif]>=20> Sincerely,> Kenneth Grome>=20>=20>=20>=20>=20>=20>> Here's a simplified example:>>=20>> [text=20>>secure=3DT]customer_id_undefined?=3D"[c_id]"=3D"[raw][c_id][/raw]"[/tex=t]>>=20>> [showif [customer_id_undefined?]]Customer id is not=20>>defined.[/showif]>>=20>>=20>> I find this question mark condition naming improves=20>>readability rather>> than having:>>=20>> "[c_id]"=3D"[raw][c_id][/raw]">>=20>> throughout my code. It also "DRY"s it up.>>=20>> Any pitfalls to this that you can see?>>=20>> Thanks,>> Bill>> --------------------------------------------------------->> This message is sent to you because you are subscribed=20>>to>> the mailing list .>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us>>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed=20>to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us=A0
Associated Messages, from the most recent to the oldest:
More and more I avoid using [raw] too. Mine often are used=20with forms and look like:[text secure=3Df]a=3D[/text]Then, if no a is passed, I don't get ugly [a] code showing=20up; just a nice clean nothing. Yours would be like[text secure=3Df]c_id=3Dundefined[/text][showif [c_id]=3Dundefined]Customer id is=20not=A0defined.[/showif]TerryOn Fri, 2 Jul 2010 21:50:21 -0500 Kenneth Grome wrote:> I don't use your question mark convention, but I don't=20>use [x]=3D[raw][x][/raw] either. Instead I preset my=20>variables at the top of the page like this:>=20> [text secure=3Df]a=3Db[/text]>=20> Using 'secure=3Df' allows incoming formvariables to=20>override the 'a' value and change it. Then I can use a=20>simple comparison to see if the 'a' value has been=20>changed:>=20> [showif b=3D[a]]no change[/showif]> [showif b![a]]changed[/showif]>=20> Sincerely,> Kenneth Grome>=20>=20>=20>=20>=20>=20>> Here's a simplified example:>>=20>> [text=20>>secure=3DT]customer_id_undefined?=3D"[c_id]"=3D"[raw][c_id][/raw]"[/tex=t]>>=20>> [showif [customer_id_undefined?]]Customer id is not=20>>defined.[/showif]>>=20>>=20>> I find this question mark condition naming improves=20>>readability rather>> than having:>>=20>> "[c_id]"=3D"[raw][c_id][/raw]">>=20>> throughout my code. It also "DRY"s it up.>>=20>> Any pitfalls to this that you can see?>>=20>> Thanks,>> Bill>> --------------------------------------------------------->> This message is sent to you because you are subscribed=20>>to>> the mailing list .>> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us>> Bug Reporting: support@webdna.us>>=20> ---------------------------------------------------------> This message is sent to you because you are subscribed=20>to> the mailing list .> To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us> Bug Reporting: support@webdna.us=A0
"Terry Wilson"
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:
[WriteFile] problems (1997)
Mime Headers for Mail (1998)
re: Large databases in WebCat (1997)
Using [Showif] tag. Mac (1997)
[WebDNA] Script choking on POP download (2010)
WebCat2b13MacPlugIn - syntax to convert date (1997)
WebCat cannot handle compatible search parameters? (1997)
Quitting WebMerchant ? (1997)
WebCatalog 2.0 b 15 mac (1997)
all records returned. (1997)
Share Bulletin Board? (1998)
WebCommerce: Folder organization ? (1997)
WCS Newbie question (1997)
Major Security Hole (1998)
autosensing lanague selection (1997)
IIS4 (1998)
Reminder for beta testers (2000)
Multi Actions (1999)
Not really WebCat (1997)
Server IP address-thanks (2004)