Re: [WebDNA] WebDNA vs. PHP code examples

This WebDNA talk-list message is from

2008


It keeps the original formatting.
numero = 101128
interpreted = N
texte = WebDNA really shines the further you get into database stuff. Because databases are a part of the software, the field names just flow right into the syntax. It gives the programmer a much better connection to the data than is possible any other way. Pat On Oct 12, 2008, at 6:45 PM, Donovan Brooke wrote: > Will Starck wrote: > > If anyone has any code snippet examples of a few lines of code in > WebDNA vs. > > something much longer that would be required in PHP code you post > them > > please? > > > > Thanks, > > > > Will Starck > > ------------------- > > NovaDerm Skincare Science > > http://www.novaderm.com > > wjs@novaderm.com > > 817-717-7377 > > > Hi Will, > I don't know if you will find code examples that show a > much "longer" form in PHP... maybe, rather, when all is added up. I > think > PHP and WebDNA have a lot of the same tag function that will be more > or less about the same length. > > I personally think WebDNA development is *time* is "shorter" because > of > it's intuitive syntax and it's innate data access (search) tools. > > However, lets compare (using W3 examples): > > Show something on condition------------------- > > PHP:: > $d=date("D"); > if ($d=="Fri") > echo "Have a nice weekend!"; > ?> > > WebDNA:: > [text]d=[date %a][/text] > [showif [d]=Fri] > Have a nice weekend! > [/showif] > > Another similar example....... > > PHP:: > $d=date("D"); > if ($d=="Fri") > echo "Have a nice weekend!"; > else > echo "Have a nice day!"; > ?> > > WebDNA:: > [text]d=[date %a][/text] > [if "[d]" = "Fri"] > [then] > Have a nice weekend! > [/then] > [else] > Have a nice day! > [/else] > [/if] > > > So both are around the same length. Which is more intuitive? > (Maybe a C++ guy will pick the PHP version) ;-) > > Here's more: > > Include something------------------- > > PHP:: > > > WebDNA:: > [include header.inc] > > > Date Stuff------------------- > > PHP:: > echo date("Y/m/d"); > echo "
"; > echo date("Y.m.d"); > echo "
"; > echo date("Y-m-d"); > ?> > > WebDNA:: > [date %Y/%m/%d]
> [date %Y.%m.%d]
> [date %Y-%m-%d]
> > > Functions-------------------- > > PHP:: > function writeMyName() > { > echo "Kai Jim Refsnes"; > } > > echo "Hello world!
"; > echo "My name is "; > writeMyName(); > echo ".
That's right, "; > writeMyName(); > echo " is my name."; > ?> > > > WebDNA:: > [function name=writeMyName] > [return]Kai Jim Refsnes[/return] > [/function] > > Hello world!
> My name is [writeMyName].
> That's right, [writeMyName] is my name. > > > I can go on, but the "intuitive difference" is the same throughout > all the tags... and yes, I think, overall, PHP would be more lengthy > when all is said and done. > However, I think the bigger difference is that the intuitive syntax, > coupled with WebDNA's search abilities are really where the > development > time is saved. > > Regarding PHP searching.. PHP most often uses MySQL for it's data > access. > Anyone who codes seriously in PHP will end up having to know MySQL. > Of course, > this may not be a bad thing. I am a big proponent of MySQL, and WebDNA > will continue to improve it's integration with MySQL and other > database > architectures. However, in my opinion, using MySQL > in many situations is just overkill. In fact, there are hundreds of > every day examples where using MySQL would be overkill.. especially > within the > WebDNA environment. I liken this > to firing up the Harley to go 2 blocks to the convenient store. > Its just over kill! ;-) > > Take a look at this W3 link about PHP and MySQL: > http://www.w3schools.com/php/php_ref_mysql.asp > > It's definately a learning curve. > > However, lets compare a simple delete record: > > PHP:: > $con = mysql_connect("localhost","mysql_user","mysql_pwd"); > if (!$con) > { > die("Could not connect: " . mysql_error()); > } > > mysql_select_db("mydb"); > mysql_query("DELETE FROM mytable WHERE id < 5"); > $rc = mysql_affected_rows(); > echo "Records deleted: " . $rc; > > mysql_close($con); > ?> > > > WebDNA:: > [delete db=mydb.db&lsIDdatarq=5] > Records deleted! > > :-) > > So I agree with Olin, PHP simply can't touch WebDNA's native and > convenient search abilities.. > (both [table..] and db= searching) > > Anway, after using WebDNA just about weekly for the last 10 years .. > (since > my first class with John Hill) ;-).. I can say that, to me, WebDNA > is a great > counterpart to creativity. The syntax is not so machine-like, yet it > still has significant power. A programmer can really get into the > zone and > make things happen with this language. I certainly know the drawbacks > of using WebDNA when compared to PHP (mostly having to do with > recognition, > and integration etc..).. but know that we are targeting > those drawbacks! Hopefully soon, these things won't be a significant > difference > to factor in. > > Hope that helps! > > Donovan (didn't spell check this one! ;-) > > > > > -- > Donovan D. Brooke PH/FAX: 1 (608) 291-2024 > ---------------------------------------------- > VP > WebDNA Software Corporation > 16192 Coastal Highway > Lewes, DE 19958 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] WebDNA vs. PHP code examples (Patrick McCormick 2008)
  2. Re: [WebDNA] WebDNA vs. PHP code examples (Donovan Brooke 2008)
  3. Re: [WebDNA] WebDNA vs. PHP code examples (Bob Minor 2008)
  4. [WebDNA] WebDNA vs. PHP code examples ("Will Starck" 2008)
WebDNA really shines the further you get into database stuff. Because databases are a part of the software, the field names just flow right into the syntax. It gives the programmer a much better connection to the data than is possible any other way. Pat On Oct 12, 2008, at 6:45 PM, Donovan Brooke wrote: > Will Starck wrote: > > If anyone has any code snippet examples of a few lines of code in > WebDNA vs. > > something much longer that would be required in PHP code you post > them > > please? > > > > Thanks, > > > > Will Starck > > ------------------- > > NovaDerm Skincare Science > > http://www.novaderm.com > > wjs@novaderm.com > > 817-717-7377 > > > Hi Will, > I don't know if you will find code examples that show a > much "longer" form in PHP... maybe, rather, when all is added up. I > think > PHP and WebDNA have a lot of the same tag function that will be more > or less about the same length. > > I personally think WebDNA development is *time* is "shorter" because > of > it's intuitive syntax and it's innate data access (search) tools. > > However, lets compare (using W3 examples): > > Show something on condition------------------- > > PHP:: > $d=date("D"); > if ($d=="Fri") > echo "Have a nice weekend!"; > ?> > > WebDNA:: > [text]d=[date %a][/text] > [showif [d]=Fri] > Have a nice weekend! > [/showif] > > Another similar example....... > > PHP:: > $d=date("D"); > if ($d=="Fri") > echo "Have a nice weekend!"; > else > echo "Have a nice day!"; > ?> > > WebDNA:: > [text]d=[date %a][/text] > [if "[d]" = "Fri"] > [then] > Have a nice weekend! > [/then] > [else] > Have a nice day! > [/else] > [/if] > > > So both are around the same length. Which is more intuitive? > (Maybe a C++ guy will pick the PHP version) ;-) > > Here's more: > > Include something------------------- > > PHP:: > > > WebDNA:: > [include header.inc] > > > Date Stuff------------------- > > PHP:: > echo date("Y/m/d"); > echo "
"; > echo date("Y.m.d"); > echo "
"; > echo date("Y-m-d"); > ?> > > WebDNA:: > [date %Y/%m/%d]
> [date %Y.%m.%d]
> [date %Y-%m-%d]
> > > Functions-------------------- > > PHP:: > function writeMyName() > { > echo "Kai Jim Refsnes"; > } > > echo "Hello world!
"; > echo "My name is "; > writeMyName(); > echo ".
That's right, "; > writeMyName(); > echo " is my name."; > ?> > > > WebDNA:: > [function name=writeMyName] > [return]Kai Jim Refsnes[/return] > [/function] > > Hello world!
> My name is [writeMyName].
> That's right, [writeMyName] is my name. > > > I can go on, but the "intuitive difference" is the same throughout > all the tags... and yes, I think, overall, PHP would be more lengthy > when all is said and done. > However, I think the bigger difference is that the intuitive syntax, > coupled with WebDNA's search abilities are really where the > development > time is saved. > > Regarding PHP searching.. PHP most often uses MySQL for it's data > access. > Anyone who codes seriously in PHP will end up having to know MySQL. > Of course, > this may not be a bad thing. I am a big proponent of MySQL, and WebDNA > will continue to improve it's integration with MySQL and other > database > architectures. However, in my opinion, using MySQL > in many situations is just overkill. In fact, there are hundreds of > every day examples where using MySQL would be overkill.. especially > within the > WebDNA environment. I liken this > to firing up the Harley to go 2 blocks to the convenient store. > Its just over kill! ;-) > > Take a look at this W3 link about PHP and MySQL: > http://www.w3schools.com/php/php_ref_mysql.asp > > It's definately a learning curve. > > However, lets compare a simple delete record: > > PHP:: > $con = mysql_connect("localhost","mysql_user","mysql_pwd"); > if (!$con) > { > die("Could not connect: " . mysql_error()); > } > > mysql_select_db("mydb"); > mysql_query("DELETE FROM mytable WHERE id < 5"); > $rc = mysql_affected_rows(); > echo "Records deleted: " . $rc; > > mysql_close($con); > ?> > > > WebDNA:: > [delete db=mydb.db&lsIDdatarq=5] > Records deleted! > > :-) > > So I agree with Olin, PHP simply can't touch WebDNA's native and > convenient search abilities.. > (both [table..] and db= searching) > > Anway, after using WebDNA just about weekly for the last 10 years .. > (since > my first class with John Hill) ;-).. I can say that, to me, WebDNA > is a great > counterpart to creativity. The syntax is not so machine-like, yet it > still has significant power. A programmer can really get into the > zone and > make things happen with this language. I certainly know the drawbacks > of using WebDNA when compared to PHP (mostly having to do with > recognition, > and integration etc..).. but know that we are targeting > those drawbacks! Hopefully soon, these things won't be a significant > difference > to factor in. > > Hope that helps! > > Donovan (didn't spell check this one! ;-) > > > > > -- > Donovan D. Brooke PH/FAX: 1 (608) 291-2024 > ---------------------------------------------- > VP > WebDNA Software Corporation > 16192 Coastal Highway > Lewes, DE 19958 > --------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > archives: http://mail.webdna.us/list/talk@webdna.us > old archives: http://dev.webdna.us/TalkListArchive/ Patrick McCormick

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:

[NT] ie 4.0 required (1997) format crash! (1997) RE: Missing contexts on NT (1997) New Plug-in and Type 11 errors (1997) creating a ShipCosts database (1997) Problems with shopping cart (1997) For those of you not on the WebCatalog Beta... (1997) Dark Horse Comics success story (1997) Math with Time (1997) setting cookies for another domain? (2002) A Global Variable (1997) Running 2 two WebCatalog.acgi's (1996) shippingTotal Challenge (2001) Webten&Webcat (1998) MacAuthorize Problem (1998) emailer (1997) Semi-OT: Update forms not working remotely (2002) emailer (1997) test (2004) displaying New products (Yikes! it's Fixed!) (1997)