Poll / Debate: Is Php A Programming Language Or A Scripting Language?

Pages: 1, 2
free web hosting

Read Latest Entries..: (Post #12) by cybernaut on Feb 16 2008, 07:02 AM. (Line Breaks Removed)
I say both. Scripting is also a programming language.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Poll / Debate: Is Php A Programming Language Or A Scripting Language?

dserban
There is an ongoing discussion about the nature of PHP that is taking place in the shoutbox, and I think it should be moved into a topic in its own right.

People seem to be divided into 3 camps.

Some people are saying things like:
"but php is a programming language..."
"it is a full-fledged programming language; it's actually quite similar to c++, and also offers classes, which I consider a powerful feature"

Then again others are saying:
"by official definition I would imagine, I don't like thinking of it as one"
"someone i know is making a php bnc, but in all other cases, Php is scripting to me"

The third group of people chime in with:
"well, sure it's a programming language, but it's still a scripting language. Traditional programming languages allow stand-alone applications, which PHP doesn't yet"

I would like to start this formal discussion with an example of how you can run a PHP piece of code from the command line, outside of the context of a web rendering engine.

When you download and decompress PHP, you end up with a directory that looks like this:
CONSOLE
C:\Apache\Apache\php>dir

Directory of C:ApacheApachephp

08/15/2007 11:24 AM <DIR> .
08/15/2007 11:24 AM <DIR> ..
05/23/2006 08:00 AM <DIR> cli
05/23/2006 08:00 AM <DIR> dlls
05/23/2006 08:00 AM <DIR> extensions
02/16/2003 12:02 AM 32,881 install.txt
02/15/2003 11:20 PM 3,276 license.txt
02/15/2003 11:20 PM 36,823 magic.mime
05/23/2006 08:00 AM <DIR> mibs
02/15/2003 11:20 PM 142,387 news.txt
05/23/2006 08:00 AM <DIR> openssl
05/23/2006 08:00 AM <DIR> pdf-related
02/16/2003 12:02 AM 45,056 php.exe
02/15/2003 11:20 PM 3,872 php.gif
02/15/2003 11:20 PM 38,898 php.ini-dist
02/15/2003 11:20 PM 39,502 php.ini-recommended
02/15/2003 11:20 PM 7,952 php4embed.lib
02/15/2003 11:58 PM 1,282,048 php4ts.dll
02/15/2003 11:20 PM 169,956 php4ts.lib
05/23/2006 08:00 AM <DIR> sapi
08/15/2007 11:23 AM 47 standalone.php
07/13/2006 03:58 PM <DIR> uploadtemp
12 File(s) 1,802,698 bytes
10 Dir(s) 278,102,016 bytes free

C:\Apache\Apache\php>

Please note the existence of the executable php.exe.
I created a little PHP piece of code in a file called standalone.php:
CONSOLE
C:\Apache\Apache\php>type standalone.php
<? echo "I am a standalone PHP application." ?>
C:\Apache\Apache\php>

Let's imagine for a moment that Apache isn't installed on my PC and let's try to execute that PHP piece of code:
CONSOLE
C:\Apache\Apache\php>php standalone.php
Content type: text/html
X-Powered-By: PHP/4.3.1

I am a standalone PHP application.
C:\Apache\Apache\php>

There is a way to suppress the extra fluff at the beginning of the output, by specifying the "-q" (for quiet) flag:
CONSOLE
C:\Apache\Apache\php>php -q standalone.php
I am a standalone PHP application.
C:\Apache\Apache\php>


Edit: I just realized now, after looking over my posting again, that putting stuff inside the console tag interprets the backslash as an escape character, so wherever you see C:ApacheApachephp - it was originally
CODE
C:\Apache\Apache\php

 

 

 


Reply

Jeigh
I already knew it had the ability to make standalone software when I said I still don't think of it as a true coding language. The vast majority of people use php solely for scripting and will never create a stand alone php application and in the context that the discussion started I was making a reference to someone who WOULD only be using it for scripting as he had just discovered it and was using it in the backend of his website.

I'm sure others have opinions, but personally I feel it's a mix but still is rarely if ever used for stand alone apps. It shines as script.

Reply

TavoxPeru
I think it is a mix of both, the majority of people use it for web development but you can also create stand alone applications, and remember that with the use of the GTK you can also create graphical applications.

Best regards,

Reply

Ronel
QUOTE(TavoxPeru @ Aug 15 2007, 06:26 PM) *
I think it is a mix of both, the majority of people use it for web development but you can also create stand alone applications, and remember that with the use of the GTK you can also create graphical applications.

Best regards,


I think its very true!

And it thinks me of installing it right now!

Reply

wutske
You didn't create a standalone application, you've created a script that is interpreted by another program (php). Thus PHP is a scripting language.
As long as you don't complile prior to running your application, you can say that a language is a scripting language.

Reply

dserban
Well I think I am going to disagree with your statement. You are narrowing down the criteria too much.

There are two categorizations we are talking about:
1) programming language versus scripting language
2) compiled versus interpreted

In my opinion, those are independent or ... (trying to find a better word to describe it) orthogonal criteria (yes it sounds more like geometry, I know).

You can have:
- compiled programming languages
- interpreted programming languages
- interpreted scripting languages

I'm trying to think of a compiled scripting language, but none comes to mind.

Reply

Jeigh
dserban makes quite a valid point. Prolog, for example, springs to my mind. It is in fact a full featured logic based programming language but it is fully interpreted if I'm not mistaken. I know all the work I've done with it I used it as a live interpreter and never even came across a way to make a pre-compiled application type scenario.

I still say php is barely a programming language though haha, people use it for scripting 99% of the time so to me it'll always be a scripting language that has the ability to be used for more tongue.gif

Reply

turbopowerdmaxsteel
The main difference between a programming language and a scripting language is that the former may be compiled into binary code and executed while the latter needs to be interpreted each time. I guess that makes, PHP a scripting language, no matter how powerful or object oriented it is.

QUOTE
Scripts remain in their original form and are interpreted command-by-command each time they are run.
The name 'script' is derived from the written script of the performing arts, in which dialogue is set down to be interpreted by actors and actresses--the programs.

Source: Wikipedia


Reply

TavoxPeru
QUOTE(wutske @ Aug 16 2007, 06:38 AM) *
You didn't create a standalone application, you've created a script that is interpreted by another program (php). Thus PHP is a scripting language.
As long as you don't complile prior to running your application, you can say that a language is a scripting language.

Ok, i think it is true in a certain way but i don't completely agree with you because there exists compilers for PHP, the one i remember in this moment is the Roadsend PHP Compiler, this is what it says on its main page:

QUOTE
Roadsend PHP Compiler is a free, open source native compiler for the PHP language. It compiles PHP source code to stand alone, native binaries which do not require an interpreter. Roadsend Compiler can build online web applications with Fast/CGI, offline web applications with an embedded web server (MicroServer), desktop GUI applications with PHP-GTK, and console applications. It is available on Linux, Windows, and FreeBSD.

For more information visit the Roadsend PHP Compiler website.

Best regards,

 

 

 


Reply

sublimino
its a hypertext processor doncha know smile.gif

Reply

Latest Entries

cybernaut
I say both. Scripting is also a programming language.

Reply

uNiT
I'm going to say PHP itself is a scripting language, however like in the example before me, there are ways to make it become a programming language through applications such as roadsend.

But generally speaking, it comes down to the fact that PHP cannot usually be run without being interpreted. It is read, not compiled.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Similar Topics

Keywords : poll, debate, php, programming, language, scripting, language,

  1. Php Script Help
    help with scripting of php (1)
  2. Your Favorite Php Framework?
    Poll (0)
    Frameworks implement the Model-View-Controller design pattern in PHP. The Model part is most often
    the database data model and relational design. The View part is the presentation layer, which is
    strictly separated from the database layer. The Controller part controls the execution flow and acts
    as a middleman / mediator between Model and View. The most popular PHP frameworks are: CakePHP -
    http://www.cakephp.org/ A structured framework that enables PHP users at all levels to rapidly
    develop robust web applications, without any loss to flexibility. Symphony - http:/....
  3. Where Do I Find Some Free Php Scripts For Quiz / Poll?
    (3)
    I need to find two pre-existing PHP applications and install them on my site: 1. A quiz-type
    knowledge testing application. 2. A simple poll with a world-readable IP-based voting log. The quiz
    script should provide the option to create questions of the following types: - single-choice (5 or
    more radio buttons) - multiple choice (5 or more checkboxes) - true / false - answer by entering
    free text (case insensitive) and create a test for someone to take, by selecting individual
    questions or categories of questions. Has anyone successfully used these kind of application....
  4. Php - Object Oriented Programming
    (1)
    Hi, I just recently found out PHP's capabilities of being OOP. Since I had learned Java's
    methods, I've adapted its methods and applied it to PHP. Since then, I've been avoiding
    procedural PHP scripting and moved to OOP instead. Like Java, I have divided the codes in classes. I
    have a commented package namespace to show which project it's from. It's almost like Java.
    I want to know, does anyone use PHP's OOP in different way? Well I believe you can form PHP in
    C++ way.....
  5. First Time Programming In Php
    quick question (5)
    This is my first time actually programming with PHP. I used to only use it's dynamic inclusion
    abilities so i never really learnt about the functions of objects and such. Alright, on to the
    question. How would i fetch the text inside a span tag using php? Sorry, I'm not too sure how to
    explain this... so let me give an example instead: CODE <span
    id="span1">comment1</span> <span
    id="span2">comment2</span> Is it possible to get only the 'comment1'
    and 'comment2' out of the span1 and span2 usi....

    1. Looking for poll, debate, php, programming, language, scripting, language,

Searching Video's for poll, debate, php, programming, language, scripting, language,
advertisement




Poll / Debate: Is Php A Programming Language Or A Scripting Language?



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE