Wednesday, March 23, 2011

Scripting vs Programming - Mastering the art of arts!

Why this post?

The line of difference between a script and a program has become very blurry these days to the extent that these terms are used interchangeably. Though there is no hard and tight way to theoretically define what a script is and say how it is different from a program, if you have done a lot of programming and if you are a person who loves to automate things, then you can definitely realize the clear line of difference between scripting and programming. In this article, I try to give my views on what scripting is, how it differs from programming, etc. (Whole of this article just represents my view and there is a good chance that some of it may be wrong).

What is a script?

A script is just a small piece of code, usually written in a non-traditional programming language (like bash or perl) that is used to get a job done. Well, sure you can’t see much of how it differs from the definition of a "program". That is what i try to explain on the due course of this article.

How does it differ from a program?
As i said earlier, there is no concrete set of rules to distinguish a script and a program. The main deciding factors are:
  • the purpose with which its developed
  • the design mechanism underwent on due course of development, and
  • the person who uses it

Scripts are generally very specific to their task. They just do what is to be done, nothing more or nothing less. Whereas programs generally have a broad scope. They are more sophisticated and usually do much more than what they are supposed to do. This is the difference with respect to the first point.

Scripts generally don’t follow any design. Scripts are usually just written, with no design in mind whatsoever. Even if they are complex, they aren’t designed with care and concern. Whereas programs on the other hand are designed to work with a proper flow and fault tolerance. Scripts are usually used by programmers themselves internally, whereas programs are full fledged tools that are used by everyone from geeks to laymen. To state an example, Facebook is a "program" and if you build something that will scrape data off facebook in the format you want, then that could be a "script".

Scripting is usually considered as programming as a part of developing an actual program. For example, the recent android patent issue says Google used a "script" to clean up all the comments and other stuff from the kernel header files. So, scripts can be generally categorized as utility functions that helps you making your "program" development easier.

What’s a scripting language?

Again, a scripting language is a programming language that is generally non-traditional. Scripting language usually provides constructs for doing things in the quickest way possible rather than in the most efficient way possible (For e.g. most of the scripting languages usually have a sort() function to sort the data. Though they may not be the most efficient implementation of sorting data, it gets the job done without fuss). Another aspect is that scripting languages are usually interpreted and not compiled. This gives the assurance that the script dies if anything goes wrong, the script starts over all again, taking advantage of the fact that scripts need not provide any atomicity over what they do.

Uses of scripting

I love automating things i do and hence scripting is a very essential part of my online life. Scripts can help your online life get much easier and better. For example, i have various little chrome content scripts (google chrome’s equivalent of greasemonkey scripts) that helps me make my day-to-day browsing easier and more productive. Also, i extensively use sed and awk scripts to browse through log files generated by the programs i develop. I even have scripts that help me check if there are new episodes of my favorite TV Serials (BBT, HIMYM) available for download and alert me.

When it comes to automating day to day online tasks, scripting is your swiss army knife. You can accomplish things quickly and in the way you want them to be.

Scripting as an art

We all know that programming is more of an art than a science. Developing a perfect program is close to impossible. But scripting too is an art that can aid you in making your programming life much better. Learning a scripting language at the beginning may seem weird, but once you get used to the constructs, it will really be a cake walk and you will find it a lot useful to have it as one of your assets.

To sum up..

Scripting and programming always go together. Scripting aids in automating things that will make a program better than what it is now. Though only a beginner, my humble piece of advice to every programmer out there is "Never hesitate to automate things. You learn a lot while automating silly things! So next time when you come across a silly problem in your work or in your project, try to tackle it with a quick utility script rather trying to fix it manually!"



  1. To learn whole propelled ideas you should learn Hadoop Training in Chennai, the dynamic and exceptionally experienced personnel will show you the strategies to look into information in an effective way.ExcelR Data Science Courses

  2. if you want to learn digital marketing in mumbai. excelr solutions providing best AI course in mumbai.for more details click here

    digital marketing courses in mumbai

  3. Excellent Blog! I would like to thank for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. I wanted to thank you for this websites! Thanks for sharing. Great websites!
    ExcelR digital marketing courses in mumbai

  4. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.

    data science course

  5. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data Science Course

  6. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

  7. Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work!
    Data Science Course in Bangalore

  8. I feel very grateful that I read this. It is very helpful and very informative and I really learned a lot from it.
    Data Science Training in Bangalore