5

Where does Scripting ends and Programming begins? ActionScript 3 and JavaScript/JScript are so different...

Cheery
  • 21,751
  • 13
  • 55
  • 80
  • A better question might be "When is a language 'scripting language'?" – chakrit Mar 01 '09 at 09:28
  • 1
    But you are drawing a distinction between programming and scripting when there is none. – Ed S. Mar 01 '09 at 11:15
  • I do it because I know people who divide the programming world into scripters and programmers. –  Mar 01 '09 at 11:31

11 Answers11

20

The distinction was meaningful once, but the line is getting increasingly blurred to the point where I dont think it is useful today.

  • historically, scripting languages are interpreted, programming langauages are compiled. But with the advent of VM's and JIT, the line is increasingly blurred.

  • scripting is when an existing application or tool is manipulated programatically (e.g. office macros), rather than building an app from scratch. Again the line is getting blurred, because libraries and frameworks means that everybody is building on existing tools. Also, API's allow you to use traditional compiled languages to manipulate applications, eg. in Office you can now automate using .net, which I supppose means you can write Excel macros in managed C++.

  • languages tend to outgrow their niche. Perl was concieved as a scripting language for text manipulation, but has since grown into a full-fledged programming language.

  • scripting languages have traditionally been higher-level with features like garbage collection and implicit typing which allowed the developer to focus on the task rather than the metal. Real programming languages like C forced you to be more concerned about memory management and machine architecture. Again, the line is being blurred by newer languages. For example, C# has high-level features like garbage-collection and dynamic types, and low-level features like pointers.

For these reasons scripting has been seen as more accessible, where programming has been seen as more demanding and hard-core. Therefore the term scripting can be used disparagingly, like in "JavaScript is just a scripting languague, not a real programming language" or "he is just a scripter, not a real programmer".

JacquesB
  • 39,558
  • 12
  • 64
  • 79
7

Is there a difference? Youre just writing software in different languages for different run-time environments.

Tomas
  • 1,635
  • 2
  • 18
  • 26
  • So, why the same software-vendors name their creatures adding the string "Script" to the name of the language? JavaScript, ActionScript, etc.? Aren't they implicitly telling you there is a difference? –  Mar 01 '09 at 09:51
  • I'd call unit test scripts 'scripts' for the program, but usually both are written in the same language and same runtime. – Pete Kirkham Mar 01 '09 at 10:47
5

The German Wikipedia says:

Aus architektonischer Sicht werden Skriptsprachen verwendet, um aus bestehenden Komponenten ein Anwendungsprogramm zu bauen. Die Komponenten selbst werden in einer Programmiersprache entwickelt.

Translation:

From an architectural point of view, script languages are used to build an application program from existing components. The components themselves are developed using programming languages.

Script languages use components that are already there to make programs. These components are written in programming languages. :)

Think about shell scripting... There you use little programs "mostly" written in C.

Tomalak
  • 306,836
  • 62
  • 485
  • 598
n00ki3
  • 13,009
  • 15
  • 52
  • 65
5

It reminds me of an old definition of the difference between prose and poetry which went something like:

There once was a lady from Glass
Who went into water up to her knees.

That's prose. If she had gone deeper, it would have been poetry.

It strikes me that the difference between scripting and programming is a matter of degree, not what language you are using. I've seen people write some pretty sophisticated programs using the bash shell, and others write trivial things using C. Which is the programmer and which is the scripter?

When you're able to write something that's more than a quick hack or something knocked together to get the immediate job done, when you've written something with an eye towards craftsmanship and maintainability, then you've written a program.

Community
  • 1
  • 1
Evan
  • 17,560
  • 8
  • 39
  • 48
3

Programming is programming.

People often differentiate between scripting languages and compiled languages, but the distinction isn't that useful IMO.

I.e. can compile many scripting languages and interpret many compiled languages.

Andrew Barrett
  • 19,041
  • 4
  • 43
  • 50
3

This question is similar to these past questions:

Community
  • 1
  • 1
coobird
  • 151,986
  • 34
  • 204
  • 225
3

A script, in common usage, is a sequence of actions ("enter stage left"), like a recipe.

For example, a testing script is a simple sequence of actions to perform. It has zero cyclometric complexity.

Programs are more general, and can do anything. They should be modular and designed for reuse.

As software expands, scripts become more complex, but at heart they are imperative recipes, designed for a single purpose.

In one of the wargaming simulations I've worked on, one of the big selling points was that it wasn't scripted, but each entity in the simulation was an autonomous actor which responded to events.

Whether or not the runtime is interpreted, compiled, jited or whatever doesn't matter. Awk scripts were compiled. Lisp programs were often interpreted. Often the unit test scripts for a program are written in the same language as the program.

If I had to point to a language difference, it would be the presence of a module system. Apart from C, all 'proper' programming languages have a module system. JavaScript is getting a module system as part of the ServerJS working group, and is obviously mature enough for applications programming, so is now neither anything to do with Java nor exclusively a scripting language.

Pete Kirkham
  • 46,814
  • 5
  • 86
  • 159
1

The difference should really be made between scripted (interpreted) and compiled code. Programming, I think, is just the general term of giving instructions to a computer or machine.

Christophe Herreman
  • 15,366
  • 7
  • 55
  • 86
1

Programming Languages: Languages that are compiled before they are deployed.

Scripting Languages: Languages that are code when they are deployed and are interpreted on the fly when they are requested.

In the end it's all the same sh*t, they are all programming languages

fmsf
  • 33,514
  • 48
  • 140
  • 190
0

Two definitions that I find particularly useless are:

  • Programming depends on the code's being compiled before deployment
  • Scripting means that the code is "only" used to connect components

I was initially tempted to draw the line around the intention with which the code was written. I would have called one-off with limited lifetime and scope a script and everything else a program. But then, I have written quite a few such programs in C ... and I wouldn't call anything in C as scripted.

My current working definition is this: Scripted code tend to be limited in scope, small, and (hopefully) simple to understand and replace. Everything else is programmed. :-)

hillu
  • 8,816
  • 4
  • 22
  • 27
0

Remember that most modern scripting languages have frameworks or backends with some built-in compiling to pre-build and cache the scripts. (see PHP with some optimizers like Zend or eAccelerator, template engines...)

Modern scripting languages like Actionscript3, PHP, Javascript allowing most of modern design pattern (like MVC) and some OOP paradigms - and some advanced designs like "closures". So you have all for "programming". Rich Internet Applications (RIA) needs a lot of programming skills, the same with RIA running as a desktop application (Flash/Flex with Adobe Air). This has nothing todo anymore with some easy scripting embedded in a website. This are complex applications needing a lot programming skills.

Because most of the scripting languages uses some "backend" to get/retrieve data from databases, this applications are often not easy to develop because of much side effects. People must have knowledge with server stuff to setup their development environment, other scripting languages like PHP for the backends and so so on. Implement some same thing with C++ and a good framework like Qt, wxWidgets are sometimes easier and needs not much more programming skills.

Scripting and programming are for me the same. Yes, you could say "writing a onclick handler for a button on a website is scripting... writing a videoplayer or game with Flex/Flash and Actionscript3 is programming"?

There a differences between a scripting language and a compiled language (host access, sandbox, performance...). But its all programming.

devarni
  • 1,802
  • 1
  • 17
  • 13