Say difference between Python and C++?
|
closed as not constructive by ChrisF♦ Jul 3 '12 at 21:17
As it currently stands, this question is not a good fit for our Q&A; format. We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, see the FAQ for guidance.
The main difference is in how they are used. Scripts are typically quick and dirty. Say, a bash script to make your life easier. Whereas a 'programming' language is meant to be much more thought out and deliberate. That's not to say that you can't do that with a 'scripting' language. You can make full-blown GUI applications (or web app) with python as well as C++. The thing with 'programming' languages is that they are usually faster, and offer more control over low-level things if you want. 'programming' languages are typically used in scenarios where the code will be around for a long time. If you want to write something quickly and then never use it again, 'scripting' languages are what you want. All of the above is of course subject to a person's expertise in a given language. As long as a language is Turing Complete you can do pretty much anything with it. The only thing that controls what you can do with it is libraries and how 'high level' the language is (you can't |
|||||||||
|
None. Scripting languages ARE (a subset of) programming languages. From Wikipedia:
|
|||||
|
Scripting languages are programming languages. The idea that the two types are separate ("versus") comes from people who are trapped in the mindset that a language cannot be both convenient and powerful. Mostly, these people have a C or C++ background, and they've worked hard to stay as close as possible to their language of origin (Java, C#). It's natural that they choose to denigrate whatever the new, popular language is this way. "Scripting language" isn't a very useful term any more, but it does have some meaning. In my opinion, if you call a language a "scripting language", it should be a complement. It means that the language is suitable for scripting, rather than that it is not suitable for something else. (+1 for all the answers naming concrete features; I think that supports this point.) |
||||
|
"Programming language" is the general term for all programming languages. "Scripting language" describes how any language is used in some specific context. The main two areas which people usually refer to as "scripting" are:
So you can talk about the scripting language of a specific application, but as general classification, I think it isn't very useful to label a language as a scripting language, unless you are talking about a DSL for which a standalone execution model just doesn't exist. |
||||
|
Scripting and Programming is not how you classify languages. Scripting and Programming is how you classify what you are doing with the language. But in the end , these are loose and overlapping classifications. |
||||
|
There really isn't any technical difference. When you get right down to it, all programs are 'interpreted' by the hardware, so you can't draw a distinction between compiled and interpreted languages. I see it as a difference between uses. Scripts are instructions to a program, say for configuration. Programs are seen by the end-user. Taking a web server as an example, scripts would be used to configure how the server presents a website, while the server (a program) does the actual presenting. A language might be optimized for scripting, but if it is Turing complete, you could write a program in it. On the flip side, I've done "scripting" tasks in C when I wasn't familiar with a batch language. It's not the easiest or cleanest way to do things, but it works. |
||||
|
I would recognize the Wikipedia entry on scripting languages as a reasonably complete and accurate description of scripting languages, which I would consider to be a subset of programming languages. Wikipedia gives some sense as to how the term has developed over the years, and the broad range of languages which it is applied to in common usage. That being said, in my experience "scripting language" is a very fluid term, and I think it doesn't do at all to be pedantic over its definition. For one thing, programming language textbooks themselves do not agree on what the definition should be (I checked three). For another thing, many historic languages in the scripting domain have grown in power, just as their communities have innovated around them, and some have become reasonable programming languages for a wide variety of activities. Javascript I think is a good example of this: consider how node.js and Riak's MapReduce features carry the reach of Javascript well beyond its traditional use in a web browser. Perl's 1.000 man page says this:
and goes on to make comparisons to sed, awk, and shell scripting languages. However, Perl has since grown into a much more complicated language with a substantial library of modules that also extend its reach beyond this initial domain. I sometimes hear the distinction being made (even on this forum) that scripting languages are generally "less capable" than other programming languages. I think this is a poor way to describe the difference between them. IMO it's far more productive to evaluate each so-called scripting language on its own terms, considering both advantages and limitations when compared to other languages, and when evaluated for use in a particular application domain. Dr. Shriram Krishnamurthi's paper "Teaching Programming Languages in a Post-Linnæan Age" confirms a lot of my thoughts on the matter. |
||||
|
Mike's got the right idea - Compiled vs. interpreted, which results in the released package containing either an executable or a script, respectively. This has several consequences:
* I couldn't find a reference, but there's a quote that goes something like "Java isn't cross-platform, it is a platform". |
|||||||||
|
Scripting languages usually don't have explicit mentions of data types (think Perl or Tcl). Programming languages (C, C++, Java) require you to explicitly specify data types. Scripting languages are often interpreted, programming languages compiled. Scripting languages are wildly used in doing glue code, programming languages tend to solve a range of problems, often domain specific. |
|||||
|
My personal definition is that a scripting language is dynamically typed, provides some sort of an |
|||||||||
|
One difference is C++ is a compiled while Python is interpreted. A C++ program is compiled once. After that, it can be run any time. A Python program is compiled every time it is used. |
|||||||||||||
|
Whether they are compiled or not, the distributed version of scripting languages is usually still the source file (.php, .pl, .py, .sh etc) whereas the distributed form of "programming languages" is usually a binary executable (may be bytecodes that runs on top of a VM). |
|||||
|
The Software Engineering Radio podcast has an episode about scripting languages
|
||||
|
Another use of scripting is to link actions together in ways which may need to change over time. So you would write function blocks in, say C/C++, and call them using a script. The function blocks themselves remain constant over time but the way they are called can be easily adapted as needs change by changing the script. |
||||
|
There are no specific data types for variables in scripting languages while in programming languages the variable must have some data type declarations. Moreover, the scripts are directly executed step by step without being compiled whereas most programming languages like Java, C, and C++ are compiled first and then they give output. |
|||||
|
Apart from compiled and interpreted code, the real difference between the two is incase of programming language the compiler can perform optimization of code where scripting language being interpreted runs as a sequence of steps. |
|||||||||
|