Alex Rivera | Logout

When to use a scripting language?

Asked 2008-12-29T10:01:48.087
28

When should one use a scripting language over a more verbose, compiled language like C++. C# or Java?

And to make the question a little more interesting, let's answer the questions like this:

You should use a scripting language when... BLANK...

When you need A use scripting language X.

When you need B use scripting language Y.

When you need C use scripting language Z.

Edit
Report

3 Answers

22

Adding a scripting language as a component of a larger compiled system is a common pattern: the compiled part of the system is optimized for speed of execution, but is harder to modify (because it must be compiled and reloaded), whereas the scripted part of the system is optimized for flexibility, it will run slower but can be quickly and easily modified by anyone with a text editor.

You would use this pattern if you wanted to make part of the functionality of your application easy to customize.

answered 2008-12-29T11:03:39.913
2

I dont't think theres a general rule when to use a scripting language. Scripting languages are easy so develop but sometimes they are hard do maintenance, especially when the script should run under different platforms (operating systems).

The pros of scripting languages are of course:

  • You can give the user (or customer) the possibility to change something in your script by himself.
  • It's easy to develop - the most scripting languages are not type-safe, what it makes much easier to develop in small applications, of course
  • But - it's platform independent...

Contras are:

  • It' s open source - everyone can see your code and can use your knowlege in their own competiting products...
  • It's slowly at runtime...
answered 2008-12-29T14:22:45.440
0

Scripting language if you plan on either writing once, or keeping it simple. A strongly typed language is much better once your project becomes larger. Think about it, how much time is spent on a large project with inititial development versus integration and maintenance. Would you rather have to maintain a large set of scripts or a strongly typed language enforcing that your types behave?

answered 2010-04-15T21:41:50.133

Your Answer