What is a "real" programming language?

The teacher recently said: “PHP is not a real programming language,” but it only gave, in my opinion, a weak excuse:

  • It is not compiled.
  • This is a script.
  • It does not start on every platform.

Is PHP not a “real” programming language? What is a "real" programming language? Should the language compile for serious consideration?

Background

I did an induction lesson in my A-Level class in school two days ago - ndash; we use Java during the first course of the course. I am not familiar with Java, but I have a pretty good idea of ​​the general principles of programming (variables, functions, object orientation, loops, etc.).

Our first task - the teacher ran fast. She did not bother to explain any concepts, how they work, or what you would use them realistically for, and seemed to be very pleased to observe how most students (who were generally new to programming) wriggled on their places without a vague idea of ​​what she was talking about. Looking back, I think it went incredibly fast to figure out who could “handle” using the Computing A-Level, as students still have a chance to change their subjects before the start of September.

The first and only task was to write a Java command line application to convert binary code to denimer (decimal). To do this, we had a two-hour session for the taster, and after explaining how the binary system works, we had to start, despite the fact that in general no one has a vague idea of ​​where to start. An hour later, some were farther than others, but no one really did anything. The teacher herself was so confused that she called another teacher from the next room. He came to help people and see where to go next.

Without boasting, I probably had the most experience in the class and became the farthest in the exercise. He asked me if I had previous experience; I said yes, especially in PHP, and jokingly commented that I could write something to convert binary code to multiple lines of PHP, while a Java application quickly grew into several screens of code.

He replied: “PHP is not a real programming language!” ...! After some discussion, he gave three reasons above. However, I pointed out that you can run PHP on any platform running Apache, but I don’t think that it really knows what Apache is and does not have it!

+62
terminology programming-languages php
Jul 11 2018-10-10T00:
source share
15 answers

First we need to know what a programming language is. At a minimum, a programming language is something that is read by a computer and instructs it to perform certain operations. Many people also expected the general-purpose programming language to be Turing complete . However, there may be situations where a domain-specific language is not complete Turing, but is still a useful programming language for that particular domain. Programming languages ​​can be compiled or interpreted, and they can work on many platforms or in only one specific one. Different needs require different programming languages. Obviously, PHP is a programming language.

My definition of a “real” programming language will be any programming language that has at least one practical application in the real world. This contradicts the esoteric programming language , which usually has no practical use. Since PHP is widely used to solve real-world problems, it easily satisfies this requirement for a real programming language, although it may not be a particularly beautiful language.

PHP is a pragmatic language. It was created from a specific need in order to be able to quickly create web pages (the name was originally intended for personal home pages), and the language was expanded as necessary. Since a theoretical background or strong design principles based on its creation (there is not even a formal specification of the language), it is no less pure than many other more modern languages. Functions such as the correct handling of foreign / Unicode characters are explicitly added subsequently and are not fully integrated with the rest of the language. This untidiness and lack of theoretical rigor make many people (especially scientists) not like the language, and this may be the reason why your teacher does not consider PHP a “real” language.

However, PHP is good at what it was designed for, and many sites use it, even very large sites such as Facebook, Yahoo! and Wikipedia.

+91
Jul 11 '10 at 8:10
source share

It is not compiled

It could be .

Scenario

Oh! A cunning technique for repeating an argument after paraphrasing it to sound like another argument.

It does not start on every platform.

Java does not work.

It looks like you have a really bad teacher there.

+55
Jul 11 '10 at 8:32
source share

Of course, PHP is a programming language. He probably meant that this is not a “real” programming language in the same sense that “real” men do not eat cyber .

+30
Jul 11 '10 at 9:55
source share

define: programming language

According to this, PHP seems to be a programming language. Is this a real programming language completely subjective. Is he a good language is also subjective. Of course, it is most often not used as the application programming language, but it can be used to develop shell applications through the CLI . I have never done this, so my understanding of this is sketchy, but it is possible.

Now, PHP is a "script" (I suppose that means a scripting language), and does it work on every platform? You judge:

PHP: Hypertext Preprocessor is a widely used general-purpose language that was originally developed for web development to create dynamic web pages. To this end, PHP code is embedded in the source HTML document and is interpreted by the web server with the PHP processor module that generates the web page document. As a general-purpose programming language, PHP code is processed by the interpreter application in command line mode, performing the required operations of the operating system and outputting the program on its standard output channel. It can also function as a graphical application. PHP is available as a processor for most modern web servers and as a standalone interpreter on most operating systems and computing platforms.

Source: http://en.wikipedia.org/wiki/PHP

Is Java even running on every platform? No. Only those for which the JVM exists.

Finally, do I need to compile the language? Many are not. Even Java does not compile in the same way as C or C ++. And then you also need to take a look at Perl, Python, etc.

Personally, I believe that PHP is a real programming language. I started there and easily switched to C / C ++ and Java. I would not use it for the same purpose as Java, and its design is different from Java, but that means little. It was easier for me to learn than Java for me.

+19
Jul 11 '10 at 8:20
source share

Facebook, Digg, Wikipedia, Yahoo. I guess these are not real sites.

+9
Jul 11 2018-10-12T00:
source share

First of all, not compiled and interpreted (what he, of course, meant by a script that is somewhat vague and used for different purposes) are different sides of the same coin and, therefore, for the same reason.

The last reason it doesn't work on every platform is just confusing. It appears to be trying to advertise Java portability, and PHP is simply not Java. However, Java runs on one very specific platform: the JVM. This platform, in turn, runs on many other platforms and thus gives Java its portability, but it is not quite the same as the traditional use of "portable" ones. For example, C is portable and works on everything from the PDP-11 to the latest embedded devices.

However, C does this by setting the rules of its own abstract platform, and compilers convert the C code into an assembly in accordance with these rules. This is how Java compatibility is similar to C: they define rules that translate into instructions for a specific machine (processor); the difference is when this happens.

All problems in computer science can be solved with another level of indirection.
& EPRS; & EPRS; - David Wheeler

In fact, even an assembly or “machine code” is interpreted by the processor in its native actions. (I don’t have a good source for this, but I remember that it is slightly covered by A Crash Course in modern equipment , which is a good presentation anyway.) As the processor speeds up, we hardly notice on our underused boxes whether this program is in asm or launched through the interpreter, but this is where the definition of "real programming language" comes into play.

The only reasonable way to define a “real programming language” is the “language in which you need to do the real work,” but it does affect the definition of “real”. (However, he makes a distinction between esoteric programming languages , because no one does the real work, for example, at Malbolge , for any definition of “real” you could get ten people to agree.) And, compared to today, your choice of programming language was much more limited by their implementation strategies and overhead (such as a runtime interpreter) in the past. However, even today some languages ​​are more "real" than others, for certain applications and expected loads, it all depends on your requirements.

It looks like your teacher only experienced PHP through toy web applications (and perhaps using the “application” is a stretch for what he saw). Toy programs are not real work. PHP definitely has a lot of problems, but I could not say that this is not a real programming language, except for jokes.

Debugging is expected with disgust, reluctantly, and boasts forever. & EPRS; & EPRS; - Dan Kaminsky

There is a definite link between the “real” and the “hard work” (related to the “real work”), and your teacher may have expressed that feeling. It always seemed to me a form of bikeshedding (it’s better there, but I don’t remember), where one estimate of the value of a thing is connected with the effort that had to be invested in it (for example, a bicycle is more important when I presented the input data for the color of the roof and should whether he has a sign). We internally value our own efforts more than others; simply because we are familiar with it, if not for any other reason - ndash; even if that doesn't make sense. PHP, despite its shortcomings, makes some things easy, and this and the programs written on it can, therefore, be perceived as less worthy.

+9
Jul 12 '10 at 5:59
source share

When I was learning PHP, I also did not consider PHP a programming language.

I'm not sure where I chose this idea, but somewhere I found out that the scripting language is not a programming language. Therefore, I applied this thinking to other languages ​​such as JavaScript and SQL.

Since then, I changed my mind and realized now that there is a range of languages ​​that goes from a high level (e.g. PHP, Javascript) to a low level (e.g. c, assembler) with things like C # and Java, somewhere in the middle .

+4
Jul 11 '10 at 8:21
source share

Sorry for the OT, but there is so much that is wrong with this picture! I just hope you get out of this class, this department and this school as fast as you can. I promise that you will not have anything close to knowing the semester when February comes. And, if you are like me, you will spend your time in class on frustration, resentment, and rage, while your teacher is wasting time on you.

This woman is not a teacher! Binary decimal value as an introduction to coding? Awful

Is this the University of (ha!) Phoenix?

+4
Jul 12 2018-10-12T00:
source share

You're right. These reasons are too weak. In fact, you don't even need Apache to run PHP.
And the first two reasons are simply repeated, because this is only one reason. So, we can say that "PHP is not compiled", but this does not mean that this is not a real programming language. Java programs also do not compile into machine codes - well, this is not a real language. Q.E.D.

+3
Jul 11 '10 at 8:24
source share

There is no such thing as a real programming language, a real person or the real world. You are a programmer if you can program in PHP.

+2
Jul 12 '10 at 10:10
source share

UPDATE: read carefully before voting, this is not my approach to PHP / Java, I'm trying to see how his teacher sees PHP / Java. Thank.

I think your teacher thought: PHP is a language that is locked inside a web server , mainly used to create web pages.

Java, on the other hand, is a general-purpose language that is also used for web pages, but used in other industries, such as microwave ovens and automobiles, you can write desktop applications in Java, etc.

With this in mind, it’s clear why your teacher said: "PHP is not a real programming language!"

I am not biased, I do not like both Java and PHP :)) but they should use them as

+1
Jul 11 '10 at 10:29
source share

It’s just one of those stupid things that people repeat to make themselves seem smarter and shut you up with sighs, his rude culture. If you ask him to explain, he will either pretend that this is a joke (say “good try” to him) or try to defend your position skillfully (say “oh, I see” to him, and slowly back off)

0
Jul 11 2018-10-10T00:
source share

"So, in the" definition of a programming language ", what makes PHP not" right "?

The real reason is that most people do not use it as a general-purpose programming language.

This is because there have always been languages ​​that are better suited (with one exception: for PHP was created, for web programming). PHP is "another language that doesn't even have the best design features over existing ones." Some examples of problems when comparing with other other languages ​​include: lack of stable and portable GUI tools (at least on Windows / MacOS), lack of threads, lack of speed, etc.

Ultimately, the people who are going to write common PHP applications are mostly people who know PHP well as a programming language. Since there is no reason to write a new application from scratch in PHP: you will find that most experienced or talented programmers will never think about it.

0
Jul 11 2018-10-10T00:
source share

Of course, PHP is a programming language. This is even the complete Turing language, which basically means that its “strength” is equal to the “power” of other programming languages. It is "real" both in strict (it really exists) and in a metaphorical sense (there are people who make a living using PHP). So it seems that your teacher is somehow biased.

However, I see some point regarding your teacher. PHP and Java come from completely different layers. Despite its usefulness, PHP is very chaotic. Compare the standard class library in Java with the standard PHP function library - the latter looks just like a huge set of unrelated tools. Moreover, there are many PHP lessons on the Internet that are, to put it mildly, mediocre. As you learn to program, it is best to learn using good tools, and Java is a much better tool for learning programming than PHP.

PS. Google for "PHP sucks" to get tons of information why PHP is not the best tool in the world.

0
Jul 11 2018-10-11T00:
source share

Just to put an argument in a different direction to everyone else ...

I'm a little uncomfortable thinking of PHP as a programming language, because I'm not sure if you are done with the program. You do not leave your PHP application, but request a PHP page and load and process it to create an output page with side effects such as changes to the DB, etc.

None of this means that PHP can be technically described as a programming language, but I find it reasonable to separate it from Java / C ++, where a program can be run with some concept of state. Each PHP file is, of course, its own "program", because you can request any PHP page ... there is no entry point to the PHP web application, except for the agreement to call the correct pages.

-3
Jul 11 2018-10-10T00:
source share



All Articles