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:
Signal Raised (1997)
[sendmail] (2000)
RED QUESTION MARK (1999)
Deleting Orders (1998)
Shopping carts and reloading pages (1997)
international time (1997)
can webcat create directories on NT? (1997)
Permissions (2000)
Bizarre behavior texta behavior (2004)
Admin User - Users.db (1999)
Maximum variable size? (2006)
Stopping bad HTML propagation ? (1997)
WebCatalog f2 Installation (1997)
Web Catalog 2 demo (1997)
[returnraw] and form variables (1998)
Template Cache problem -- new plugin for ya' (2000)
customizing the color of user's pages (1997)
WebCatalog on Linux (2000)
[OT] Bad Hard Drive? (2003)
The code, one more time. (2003)