For you expert WebDNA coders (was Re: Interesting speed

This WebDNA talk-list message is from

2003


It keeps the original formatting.
numero = 54395
interpreted = N
texte = Hi all, Ok, the 30% more code for PHP sounds a bit much to me, but then I'm not really a WebDNA expert, so I want your help. Below is code I wrote when I was first learning WebDNA, and have not gone back to make it any better. At the time, I was coming to WebDNA from PHP and Java, so WebDNA was a bit of a shock. The WebDNA code is 28 lines (without the extra lines), the PHP code is 12 lines (16 if you code with {} on their own lines). Of course, I've removed comments. Admittedly, WebDNA allows you to put multiple commands on one line, but in terms of readability and maintainability, I'll *never* do that unless the output calls for it. If you care to fix my WebDNA code for me and make it 12 lines or less, please do. I bet there's a WebDNA coder out there that can do it in 3 or less! :-) Oh, what's the code trying to do? An include file is named in the url using the param page=. This code 1) checks to see if page= is even in the url 2) checks to see if page exists on the file system 3) includes page if it exists, and includes another file if it doesn't. Thanks and with much respect for WebDNA and the WebDNA developer community. -lucas WebDNA: [formvariables name=[url]page[/url]] [if "[url][value][/url]"!""] [then] [FileInfo file=includes/[page].inc] [If "[Exists]"="T"] [Then] [include file=includes/[page].inc] [/Then] [Else] [include file=includes/info_home.inc] [/Else] [/If] [/FileInfo] [/then] [/if] [/formvariables]  [formvariables name=[url]page[/url]] [if "[url][value][/url]"=""] [then] [include file=includes/info_home.inc] [/then] [/if] [/formvariables]  [Showif ![page]] [hideif [page]![Raw][page][/Raw]] [include file=includes/info_home.inc] [/hideif] [/Showif]  PHP: if (isset($_REQUEST['page'])) { $success = @include("includes/$_REQUEST['page'].inc"); if (!$success) { include("includes/info_home.inc"); } else { include("includes/$_REQUEST['page'].inc"); } } else { include("includes/info_home.inc"); } On Friday, November 21, 2003, at 12:06 PM, Andrew Simpson wrote: > In terms of the way it is coded, i tried my best to duplicate the > webcat logic. Because PhP is a much lower level language, there are > more efficient ways of running some of the tests (especially the file > systems stuff) but i have tried my best to code it to give a fairish > comparison. > > These are two completely different technologies so no, you are not > truly comparing Apples with Apples... but the code IS doing exactly > the same stuff in terms of the end result. > > for those of you that are interested, the PhP code does generate about > 140 more lines of code... thats about 30% more than webcat... > > >> Are we comparing Apples to Apples? >> >> Donovan >> >> >> >> Alain Russell wrote: >> >>> So Andrew has made a copy of the speed test in PHP .. >>> Interesting results .. >>> >>> http://utility.blackpepper.co.nz/webdna_speed/php_speed.php >>> http://utility.blackpepper.co.nz/webdna_speed/webdna_speed.html >>> >>> This is the same machine - Dual 2G G5, Dual HDD .. >>> >>> The source code is available for people that know PHP (You'll need to >>> create a username/database etc) >>> http://utility.blackpepper.co.nz/webdna_speed/php_speed.txt >>> >>> Any comment from SMSI on why variables/math etc are so much slower ?? >>> >>> Running v4.5.1 by the way .. >>> >>> Alain >> >> -- >> =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o >> DONOVAN D. BROOKE Eucalyptus Design >> <-Web Development (specializing in eCommerce), -> >> <-Graphic Design, and Pre-Press Consultation -> >> >> ADDRESS:> Donovan Brooke >> DBA Eucalyptus Design >> N2862 Summerville Park Rd. >> Lodi, WI 53555 >> PH:> 1.608.592.3567 >> Web:> http://www.euca.us >> =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o >> >> >> ------------------------------------------------------------- >> 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/ > > > ------------------------------------------------------------- > 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/ > ------------------------------------------------------------- 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:

    
Hi all, Ok, the 30% more code for PHP sounds a bit much to me, but then I'm not really a WebDNA expert, so I want your help. Below is code I wrote when I was first learning WebDNA, and have not gone back to make it any better. At the time, I was coming to WebDNA from PHP and Java, so WebDNA was a bit of a shock. The WebDNA code is 28 lines (without the extra lines), the PHP code is 12 lines (16 if you code with {} on their own lines). Of course, I've removed comments. Admittedly, WebDNA allows you to put multiple commands on one line, but in terms of readability and maintainability, I'll *never* do that unless the output calls for it. If you care to fix my WebDNA code for me and make it 12 lines or less, please do. I bet there's a WebDNA coder out there that can do it in 3 or less! :-) Oh, what's the code trying to do? An include file is named in the url using the param page=. This code 1) checks to see if page= is even in the url 2) checks to see if page exists on the file system 3) includes page if it exists, and includes another file if it doesn't. Thanks and with much respect for WebDNA and the WebDNA developer community. -lucas WebDNA: [formvariables name=[url]page[/url]] [if "[url][value][/url]"!""] [then] [FileInfo file=includes/[page].inc] [If "[Exists]"="T"] [Then] [include file=includes/[page].inc] [/Then] [Else] [include file=includes/info_home.inc] [/Else] [/If] [/FileInfo] [/then] [/if] [/formvariables]  [formvariables name=[url]page[/url]] [if "[url][value][/url]"=""] [then] [include file=includes/info_home.inc] [/then] [/if] [/formvariables]  [Showif ![page]] [hideif [page]![raw][page][/Raw]] [include file=includes/info_home.inc] [/hideif] [/Showif]  PHP: if (isset($_REQUEST['page'])) { $success = @include("includes/$_REQUEST['page'].inc"); if (!$success) { include("includes/info_home.inc"); } else { include("includes/$_REQUEST['page'].inc"); } } else { include("includes/info_home.inc"); } On Friday, November 21, 2003, at 12:06 PM, Andrew Simpson wrote: > In terms of the way it is coded, i tried my best to duplicate the > webcat logic. Because PhP is a much lower level language, there are > more efficient ways of running some of the tests (especially the file > systems stuff) but i have tried my best to code it to give a fairish > comparison. > > These are two completely different technologies so no, you are not > truly comparing Apples with Apples... but the code IS doing exactly > the same stuff in terms of the end result. > > for those of you that are interested, the PhP code does generate about > 140 more lines of code... thats about 30% more than webcat... > > >> Are we comparing Apples to Apples? >> >> Donovan >> >> >> >> Alain Russell wrote: >> >>> So Andrew has made a copy of the speed test in PHP .. >>> Interesting results .. >>> >>> http://utility.blackpepper.co.nz/webdna_speed/php_speed.php >>> http://utility.blackpepper.co.nz/webdna_speed/webdna_speed.html >>> >>> This is the same machine - Dual 2G G5, Dual HDD .. >>> >>> The source code is available for people that know PHP (You'll need to >>> create a username/database etc) >>> http://utility.blackpepper.co.nz/webdna_speed/php_speed.txt >>> >>> Any comment from SMSI on why variables/math etc are so much slower ?? >>> >>> Running v4.5.1 by the way .. >>> >>> Alain >> >> -- >> =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o >> DONOVAN D. BROOKE Eucalyptus Design >> <-Web Development (specializing in eCommerce), -> >> <-Graphic Design, and Pre-Press Consultation -> >> >> ADDRESS:> Donovan Brooke >> DBA Eucalyptus Design >> N2862 Summerville Park Rd. >> Lodi, WI 53555 >> PH:> 1.608.592.3567 >> Web:> http://www.euca.us >> =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o >> >> >> ------------------------------------------------------------- >> 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/ > > > ------------------------------------------------------------- > 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/ > ------------------------------------------------------------- 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/ Lucas Rockwell

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:

WCS Newbie question (1997) Shopping Cart Questions (1998) AppleShare IP 6.1 (1998) ups quickcost [repost] (1999) [WebDNA] [sendmail] sending two emails (2012) upgrading (1997) displaying New products (using [date]) (1997) OBDC Support (1997) [WebDNA] webdnavps.com - WebDNA-enabled Managed Linode VPS (2014) Faxing orders in place of email (1997) Summing fields (1997) Re:Variable Math (1998) Problems with [Applescript] (1997) WC2b15 - [HTMLx]...[/HTMLx] problems SOLVED! (1997) More on the email templates (1997) [WriteFile] problems (1997) Use of Back and Reload Buttons on ShoppingCart page? (1997) formula inside database to calculate weights (1997) Summing fields (1997) Wanted: More Math Functions (or, Can You Solve This?) (1997)