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.PatOn 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:
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.PatOn 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:
WebCat2 - many [carts] on one template page? (1997)
WebCat2 beta 11 - new prefs ... (1997)
Retrospect Backup Misses Empty Folders (2000)
Navigator 4.01 (1997)
Refering page (1998)
little help (2001)
WebDNA for Dummies (2004)
2.1b3 --> way slow (1997)
PCS Emailer's role ? (1997)
Developer Edition - Connection Limit (2006)
Forms Search Questions (1997)
Return records from another (1997)
[WebDNA] Clean URLS job - will pay (2010)
NT Photo manip. util. needed (2000)
RE: Web*SSL and WebCatalog (1997)
showif and cart (1997)
Entry pages (was: WebCatalog MAJOR drawback) (1998)
JS and Webcatalog (2001)
Order not created error (1997)
WebCat2: Formulas.db question (1997)