note 36888 deleted from faq.languages by sobak
| From: | sobak@php.net | Date: | Sun, 04 Dec 2016 10:58:26 +0000 |
| Subject: | note 36888 deleted from faq.languages by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208153@lists.php.net to get a copy of this message | ||
Note Submitter: Tricrokra
----
I have to note that a very big advantage of PHP over ASP is that PHP has much easier commands...
Take openening of a file in ASP...
First create a file object... I put this into a function because the line is simpy to long and I
called it "Init fileobject"
<%
Initfileobject 'The Sub I created in order not to type that idot line all the time
Set Fil = FileObject.OpenTextFile(Server.MapPath("data")&"\datafile")
datavar = Fil.ReadLine
CloseFile Fil
Set Fil = Nothing
Set FileObject = Nothing
%>
Why always those objects...
The same thing in PHP
<?php
$fil = fopen("data/datafile","r");
$datavar = fgets($fil);
fclose($fil);
?>
That's all...
And that while VBScript is based on BASIC (BEGINNERS Allpurpose Symbolic Instruction Code)...
I code too shortly in PHP to make a full analysis yet, but the complex object structues of VBScript
is something I really put in question, PHP has a much easier syntax when it comes to that...
One of the first things I saw was that PHP is based on C, which is one of the hardest programming
languages in the world. That makes the syntax of for example the "for" statement less to
my desire, which I like better in VBScript (ASP)... If you are an experienced C or C++ programmer, I
think PHP makes automaticly the best choice out of PHP vs ASP.
But I did find out in only 1 hour that the syntax of PHP gives you much less typing than ASP, that
is a fact. I think that for the rest the pick of language is pretty personal.
When it comes to stability. ASP servers crash very much. I don't think ASP itself is the evil
one in this. ASP only runs on Windows servers, and we all know how much Windows crashes. I truely
believe that also picks a part of the puzzle...