English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

what is the difference between a scripting language like
PHP and coding language like c++?!

2006-07-06 18:58:47 · 7 answers · asked by Anonymous in Computers & Internet Programming & Design

7 answers

Generally speaking, a scripting language (like PHP and Javascript) is interpreted at runtime - meaning that the text you type in to write the code is converted to machine language computer instructions at the time you run the program.

What you're calling a coding language (C++, Java) is a compiled language, meaning that you take the text instructions and use a compiler to transform human readable code into machine language computer instructions before you run the program (turning it into an .exe or Java class file).

Programs written in C++ and Java generally run faster than scripting language programs because compiled languages are converted to machine language before your run the program, instead of being converted as the program is being run.

2006-07-06 19:10:59 · answer #1 · answered by Epistomolus 4 · 0 0

The primary difference is that scripting languages, such as php and perl are interpreted while languages like c++ are compiled.

Basically, both php and C++ are what is called "high level" languages. They are readable to human beings, but your computer only understands instructions that consists of 0s and 1s. The techniques to bridge this gap fall into two broad categories: compilation and interpretation. Here is a good link that explains the two

http://www.j-paine.org/students/lectures/lect6/node20.html

Besides this, scripting languages tend to work at higher level than system programming languages, that is, the language is more detached from the physical implementation and provide higher level abstrations. For example, associative array is a built-in feature in php. Another example, you don't have to explicitly decare a variable to be interger or string type -- the same variable can hold both and the right value will be used based on the context.

In general, scripting languages offer great flexibility and short development time. On the flip side, system languages like C++ tend to provide better efficiency and more precise control of the hardware.

2006-07-07 02:20:32 · answer #2 · answered by yqiao99 1 · 0 0

Scripting languages (commonly called scripting programming languages or script languages) are computer programming languages created to shorten the traditional edit-compile-link-run process. The name comes from a written script such as a screenplay, where dialog is repeated verbatim for every performance. Early script languages were often called batch languages or job control languages. A script is usually interpreted rather than compiled.

Many such languages are quite sophisticated and have been used to write elaborate programs, which are often still called scripts even though they go well beyond automating simple computer tasks. A script language can be found at almost every level of a computer system. Besides being found at the level of the operating system, they appear in computer games, web applications, word processing documents, network software and more. In many ways, the terms high-level programming language and scripting language have become entwined, and there is no clear delineation between the two.

2006-07-07 02:03:41 · answer #3 · answered by Bolan 6 · 0 0

A scripting language must be translated by a program or process running on a machine when it is activated.
Your example of C++ would be classed as a natively compiled language. It creates an executable file with all attendant instructions included in it so the program runs directly from the hardware and / or operating system. I hope that this helps you understand the difference.

2006-07-07 11:42:18 · answer #4 · answered by griz803 5 · 0 0

It's basically that a "scripting" language is interpreted on the fly, whereas a "coding" language is first compiled into an executable program before you can run it.

You generally use a "scripting" language when you want your programs to be completed faster. On the other hand, you use a "coding" language when you want your programs to run faster. It's a rapid development versus efficiency trade-off.

2006-07-07 02:06:25 · answer #5 · answered by Locoluis 7 · 0 0

You are looking for Python!

It's a powerful language that you are going to like a lot better than PHP or C++. From Wikipedia:

"Python is sometimes referred to as a "scripting language". In practice, it is used as a dynamic programming language for both application development and occasional scripting. Python has been used to develop many large software projects such as the Zope application server and the Mnet and BitTorrent file sharing systems. It is also extensively used by Google."

2006-07-07 02:43:27 · answer #6 · answered by linuxfortravelers 3 · 0 0

How could I explain that question?

If you know some PHP and some C++ you will noticie that they have a common factor. They are instructions, written with codes. In other words, they are pretty much the same.

The main difference lies in their use. Example, C++ is used for applications using libraries. PHP is used for web applications mainly, and, you will not need a compiller to build it. It is more likely, if you do something wrong, it won't work, so you have to be more careful than with C++, since you actually have a compiller in there that will be telling you what is wrong.

Hope this help.

2006-07-07 02:09:51 · answer #7 · answered by eorox 2 · 0 0

fedest.com, questions and answers