Is PHP Really a Programming Language?

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 2438 Views - Last Post: 20 August 2007 - 03:43 AM

#1 JLeo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 01-August 07

Is PHP Really a Programming Language?

Post icon  Posted 04 August 2007 - 09:20 AM

In my opinion php is a scripting language because:
- no machine code generated (code is parsed not compiled)
therefore...
- it's executed instantly
- it's actually written in C (a programming language written in a programming language?)
Is This A Good Question/Topic? 0
  • +

Replies To: Is PHP Really a Programming Language?

#2 PennyBoki  Icon User is offline

  • system("revolution");
  • member icon

Reputation: 53
  • View blog
  • Posts: 2,334
  • Joined: 11-December 06

Re: Is PHP Really a Programming Language?

Posted 04 August 2007 - 09:50 AM

View PostJLeo, on 4 Aug, 2007 - 09:20 AM, said:

In my opinion php is a scripting language because:
- no machine code generated (code is parsed not compiled)
therefore...
- it's executed instantly
- it's actually written in C (a programming language written in a programming language?)

for PHP see HERE
as for your last point, what if I tell you that Java is written in C++
Was This Post Helpful? 0
  • +
  • -

#3 JLeo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 01-August 07

Re: Is PHP Really a Programming Language?

Posted 04 August 2007 - 11:39 AM

yes, i know wikipedia...
with java you're partly right although it's more c than c++, and you can compile java code with gcc
i wrote that question for discussion.. ;)

This post has been edited by JLeo: 04 August 2007 - 12:01 PM

Was This Post Helpful? 0
  • +
  • -

#4 William_Wilson  Icon User is offline

  • lost in compilation
  • member icon

Reputation: 205
  • View blog
  • Posts: 4,807
  • Joined: 23-December 05

Re: Is PHP Really a Programming Language?

Posted 04 August 2007 - 04:01 PM

many may disagree, but for the most part scripting languages are blurring the lines between traditional coding languages, and there isn't much you can do to define the difference... If you say objects are the definition, then assembly isn't directly a programming language? and so on with hundreds more examples. I suppose it's just the feeling of availability of a language. When JS was first introduced it was definitely a scripting language, but as the advanced features were introduced with updates and additions, it has become much more. It can't do all of what php, or perl or .net or some other languages in the same boat can, but it has it's place where it is the best option, and to me if it has features or abilities (useful ones that is) that are often the best choice, then yes it is a programming language.

Would you say that Perl is not a programming language then? Based on your reasoning for php, it sounds like you would.
Was This Post Helpful? 0
  • +
  • -

#5 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1638
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Is PHP Really a Programming Language?

Posted 04 August 2007 - 04:54 PM

View PostWilliam_Wilson, on 4 Aug, 2007 - 04:01 PM, said:

many may disagree, but for the most part scripting languages are blurring the lines between traditional coding languages, and there isn't much you can do to define the difference... If you say objects are the definition, then assembly isn't directly a programming language? and so on with hundreds more examples. I suppose it's just the feeling of availability of a language. When JS was first introduced it was definitely a scripting language, but as the advanced features were introduced with updates and additions, it has become much more. It can't do all of what php, or perl or .net or some other languages in the same boat can, but it has it's place where it is the best option, and to me if it has features or abilities (useful ones that is) that are often the best choice, then yes it is a programming language.

Would you say that Perl is not a programming language then? Based on your reasoning for php, it sounds like you would.


You made some real good points there :^:

I for one would classify PHP as a "programming language" and I would Perl as well (though, like you said, some peoples definitions would say both are simply a scripting language)
Was This Post Helpful? 0
  • +
  • -

#6 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Is PHP Really a Programming Language?

Posted 05 August 2007 - 06:37 AM

The difference between programming and scripting languages used to be that one was compiled and the other was interpreted. Obviously that's not the case anymore since the advent of languages like Java and C# which are interpreted to produce an intermediate language and are only compiled into machine code at run-time. Another tell-tale sign of a scripting language was that it was both interpreted and not "fully-featured." Fully-featured can mean different things to different people, but you can define it loosely as having most of the features that are present in the most popular languages of the day, like OO, type-fastness and type-casting, multi-threading, file and network utility, etc. To me, this definition does a good job of splitting out the scripting from programming languages, but I wouldn't say it's rock solid because what features do you consider to be definitive? I guess what it boils down to is that, how you use a language defines what type it is for you. For instance, if you're a web developer working on old-style JSPs with scriptlets, you might think of Java as a scripting language because you're using it inside a web page. On the other hand, you might be using Perl to create stand-alone applications and even compiling it to binary using one of the available compilers. In this case, you might consider Perl a programming language. I think that the lines are blurring to the point that calling something a programming or scripting language is becoming less correct and it's becoming more correct to talk about using a language in a programming or scripting context.
Was This Post Helpful? 0
  • +
  • -

#7 JLeo  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 32
  • Joined: 01-August 07

Re: Is PHP Really a Programming Language?

Posted 05 August 2007 - 08:55 AM

You mentioned the JSP sites, where someone could think of java as a scripting language but java server pages are compiled into java code with a special JSP-compiler. And that Java code (servlet) again is compiled into bytecode which defines a programming language (as I see it).

This post has been edited by JLeo: 05 August 2007 - 08:56 AM

Was This Post Helpful? 0
  • +
  • -

#8 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Is PHP Really a Programming Language?

Posted 05 August 2007 - 02:33 PM

View PostJLeo, on 5 Aug, 2007 - 08:55 AM, said:

You mentioned the JSP sites, where someone could think of java as a scripting language but java server pages are compiled into java code with a special JSP-compiler. And that Java code (servlet) again is compiled into bytecode which defines a programming language (as I see it).


Yes, I know how JSPs and Servlets work. I've been a Java developer for many years, so no need for a lesson. Just for the record, I consider Java to be a programming language. But, when I said that someone might consider Java to be a scripting language I was not talking about it from a holistic point of view, but rather that person's perception based on contextual use. I was making a point that programming and scripting languages are meshing to the point that traditional definitions don't always apply or matter anymore.

This post has been edited by alcdotcom: 05 August 2007 - 02:34 PM

Was This Post Helpful? 0
  • +
  • -

#9 serializer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 110
  • Joined: 25-June 07

Re: Is PHP Really a Programming Language?

Posted 14 August 2007 - 07:13 PM

I'd say scripting languages are a subset of programming languages. Certain languages: Perl, PHP, Javascript, are all clearly programming languages; however I also see them as scripting languages, whereas C or Java I wouldn't.

The best distinction I can come up with is this: a scripting language is a programming language which automates tasks / generates code for a secondary language/system/framework. PHP and Perl are used to generate and interpret HTML (Perl in my experience has been used primarily for this kind of taks, and in essence it is a text-processing language). Javascript is used within a webpage to create and manipulate DOM elements. Similarly, Linux shell scripting (which is also a well-featured programming language in its own right) is used to generate command-line commands (as are DOS batch files and Windows scripting, really).

I think this definition could be refined, but does it sound right?

--serializer

This post has been edited by serializer: 14 August 2007 - 07:14 PM

Was This Post Helpful? 0
  • +
  • -

#10 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Is PHP Really a Programming Language?

Posted 15 August 2007 - 11:40 AM

View Postserializer, on 14 Aug, 2007 - 07:13 PM, said:

I'd say scripting languages are a subset of programming languages. Certain languages: Perl, PHP, Javascript, are all clearly programming languages; however I also see them as scripting languages, whereas C or Java I wouldn't.

The best distinction I can come up with is this: a scripting language is a programming language which automates tasks / generates code for a secondary language/system/framework. PHP and Perl are used to generate and interpret HTML (Perl in my experience has been used primarily for this kind of taks, and in essence it is a text-processing language). Javascript is used within a webpage to create and manipulate DOM elements. Similarly, Linux shell scripting (which is also a well-featured programming language in its own right) is used to generate command-line commands (as are DOS batch files and Windows scripting, really).

I think this definition could be refined, but does it sound right?

--serializer


I'm assuming you've read my posts, so you probably already know what I think. But let me play devil's advocate for a minute just for fun. There are numerous Java technologies (Servlets, JSP, Struts, etc.) that are used to generate HTML. If one of your main criteria for a scripting language is that it generates code for a "secondary" language, then how do you explain the scenario I just mentioned? The other criterion, "automates tasks" could be said to be true of any programming language. I could write a C or Java program that performs the same tasks as a shell script or a batch file.
Was This Post Helpful? 0
  • +
  • -

#11 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Is PHP Really a Programming Language?

Posted 15 August 2007 - 11:52 AM

Things have changed in the last 10-15 years and the lines between scripting and programming languages have blurred to the point that distinguishing them is not as easy as it once was. It used to be that, if a language was interpreted, it was a scripting language. Not anymore. Instead of trying to find absolute defining characteristics of a scripting/programming language we could list common characteristics that can be used as a guide. For instance, many languages I consider to be scripting scripting languages:

1. are often not strongly typed
2. are often interpreted
3. are not often truly object-oriented (e.g. can't enforce encapsulation)

There are more and probably some exceptions to these. But I think you could use this as a guide.

This post has been edited by alcdotcom: 15 August 2007 - 11:52 AM

Was This Post Helpful? 0
  • +
  • -

#12 serializer  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 110
  • Joined: 25-June 07

Re: Is PHP Really a Programming Language?

Posted 15 August 2007 - 09:47 PM

View Postalcdotcom, on 15 Aug, 2007 - 11:40 AM, said:

I'm assuming you've read my posts, so you probably already know what I think. But let me play devil's advocate for a minute just for fun. There are numerous Java technologies (Servlets, JSP, Struts, etc.) that are used to generate HTML. If one of your main criteria for a scripting language is that it generates code for a "secondary" language, then how do you explain the scenario I just mentioned? The other criterion, "automates tasks" could be said to be true of any programming language. I could write a C or Java program that performs the same tasks as a shell script or a batch file.


To that I'd say Servlets, JSP, Struts, are scripting languages/frameworks based around Java, whereas Java itself is a programming language :) I'm also trying to consider the type of tasks a particular language is most suited for.

We could also look at the word "scripting": a script is a document that lists gives instructions one by one; a play script, lines for an actor to read one after another; a manuscript, words one after another to be read in sequence. This would ally to the weakly typed / interpreted line of thinking.

Here's an interesting link: Ousterhout's dichotomy. He divides programming lanuages into application languages vs. scripting languages.

I think a distinction based on context (i.e. the situation in which the language is being used) is more useful than a loose grouping based on the properties of the language, especially when there are so many exceptions and variations in the criterion.

Arrgh! I probably shoulda left this one well alone ;) ...

--serializer
Was This Post Helpful? 0
  • +
  • -

#13 1lacca  Icon User is offline

  • code.rascal
  • member icon

Reputation: 44
  • View blog
  • Posts: 3,822
  • Joined: 11-August 05

Re: Is PHP Really a Programming Language?

Posted 15 August 2007 - 11:14 PM

Actually, does it matter? We are here to use these technologies, let these thinking to arts majors, who can't program :P

I think if you really want to define it, I would stick with the compiled vs interpreted way, so if it is interpreted it's a scripting language (Java byte code is binary, since it is compiled, and there are even processors that implement the JVM's instructions). This means that some languages can fall into both categories: Perl can be interpreted nad compiled, too.
Was This Post Helpful? 0
  • +
  • -

#14 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Is PHP Really a Programming Language?

Posted 16 August 2007 - 03:03 AM

View Postserializer, on 15 Aug, 2007 - 09:47 PM, said:

To that I'd say Servlets, JSP, Struts, are scripting languages/frameworks based around Java, whereas Java itself is a programming language :) I'm also trying to consider the type of tasks a particular language is most suited for.

A Servlet is a Java class. Struts also directly uses Java classes. These are not based "around" Java like JSP is.

serializer, on 15 Aug, 2007 - 09:47 PM, said:

Here's an interesting link: Ousterhout's dichotomy. He divides programming lanuages into application languages vs. scripting languages.

Good read. Sounds like he's saying a lot of what I already said.

serializer, on 15 Aug, 2007 - 09:47 PM, said:

I think a distinction based on context (i.e. the situation in which the language is being used) is more useful than a loose grouping based on the properties of the language, especially when there are so many exceptions and variations in the criterion.

I made this exact point a few posts back to illustrate the blurring of programming vs. scripting languages.
Was This Post Helpful? 0
  • +
  • -

#15 Programmist  Icon User is offline

  • CTO
  • member icon

Reputation: 252
  • View blog
  • Posts: 1,833
  • Joined: 02-January 06

Re: Is PHP Really a Programming Language?

Posted 16 August 2007 - 03:09 AM

View Post1lacca, on 15 Aug, 2007 - 11:14 PM, said:

Actually, does it matter? We are here to use these technologies, let these thinking to arts majors, who can't program :P

I think it's mostly an academic discussion meant to make us think more than anything. The distinction between programming and scripting languages may not really have much relevance to your typical non-management developers. But I think that any discussion that makes us think about the jargon that we throw around has merit. And, ok, it's fun too. :)

This post has been edited by alcdotcom: 16 August 2007 - 03:11 AM

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2