Tuesday, September 13, 2011

Core differences between a Scripting and a Programming Language.

         In this era of computers, where there are a handfull of programming and scripting languages, Its really important to know basic differences between programming and scripting languages. This is a post where i would like to discuss on some of the myths about scripting Language and how it differs from any programming language that we use. Aim of this post is to make the reader familiar about the potential differences between, How, Why, When and What about the above mentioned 2 strata of Languages.


         To make the reader familiar with a wide spectra of languages avail, here is a list of different kinds of languages :




            -----Programming----- 
             |                                |
  Scripting(JS/VBS)   Compiling(C++/VB) 




The Last 2 links above makes u more familiar with basic definitions of these respective languages. Hence, In brief it can be just said that - "A Scripting Language is a Programming Language that is not compiled regularly!!". The differences b/w these languages in the respective criteria is discussed as follows:


1. Syntax : Both seem to have in common is Sequence (the order of your code), Selection (If and Select/Switch type statements), and Iteration (Loops)...so the line is very blurry in terms of syntax of both languages.


2. Compilation The classic definition is it is a program if it is compiled and it is a script if it is interpreted. If you can open the interpreted file in Notepad and it's readable then it's a script.  If the compiled file when opened in a notepad is a bunch of  weirdy boxy characters everywhere, it's probably a program that compiles itself in a compiler.


3. Flexibility : This is a core difference where Scripting Language highlights itself, Essentially it comes down to ease and flexibility of change. Scripts change quickly and easily whereas programs require more effort.


4. Weak and strong typing Weak typing allows a value of one type to be treated as another, for example treating a string as a number. Strong typing prevents the above. An attempt to perform an operation on the wrong type of value raises an error. An alternative definition for "weakly typed" refers to scripting languages, such as Perl and JavaScript, which permit a large number of implicit type conversions. Thus it can be said as most of the scripting are weakly typed and Programming languages are strongly typed.



5. Light-weight-ness : Its always upheld and assumed that scripting languages are very lightweight and robust as compared with programming languages. Because, the code is not compiled the overhead for compilation is reduced in scripting languages. 




Conclusion : 
                   In reality, though there is no prominent change in programming structure and pattern between both, the working, execution and practical usability between these two languages differs a lot. Scripting Languages are used in applications where logical programming is much important than system resource / system programming. Some of the most important examples of scripting languages usage are : Javascript, PHP, VBScript, Perl, Python etc.. Though there are many exceptions where even scripting languages are compiled, In general terms the defn goes conventionally. I hope this post makes u guyz familiar with what it means to script and program?

No comments:

Post a Comment