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=20 with forms and look like: [text secure=3Df]a=3D[/text] Then, if no a is passed, I don't get ugly [a] code showing=20 up; just a nice clean nothing. Yours would be like [text secure=3Df]c_id=3Dundefined[/text] [showif [c_id]=3Dundefined]Customer id is=20 not=A0defined.[/showif] Terry On 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:

    
  1. Re: [WebDNA] Anyone use this coding style for readability... ("Terry Wilson" 2010)
  2. Re: [WebDNA] Anyone use this coding style for readability... (Kenneth Grome 2010)
  3. Re: [WebDNA] Anyone use this coding style for readability... (Govinda 2010)
  4. [WebDNA] Anyone use this coding style for readability... (William DeVaul 2010)
More and more I avoid using [raw] too. Mine often are used=20 with forms and look like: [text secure=3Df]a=3D[/text] Then, if no a is passed, I don't get ugly [a] code showing=20 up; just a nice clean nothing. Yours would be like [text secure=3Df]c_id=3Dundefined[/text] [showif [c_id]=3Dundefined]Customer id is=20 not=A0defined.[/showif] Terry On 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:

Running _every_ page through WebCat-error.html (1997) email [title] (1997) Card clearance, problems - solutions? (1997) REPOST [SUM field=xxxx] (2000) [OT] HTML EMAIL program wanted (1999) Fwd: search engine friendly URLS (Mac) (1998) Search Philosophy (2001) unable to launch acgi in WebCat (1997) FileMaker and WebCat (1999) Fwd: Problems with Webcatalog Plug-in (1997) [click][/click] (1999) Search context not finding recent entries (1998) quotes and truncating? (1997) Getting around DOS filenames (2000) Include from DB (2002) Disappearing HTML/WebDNA (1998) text size limitation (1997) Digest Version (2000) OFF-TOPIC: Check www.godaddy.com for me ... (2003) Emailer setup (1997)