Scripting vs. Programming

Word Weaver
3 min readJan 1, 2023

--

If you are new to the field of IT, you are most likely already aware of the terms “scripting” and “programming” and interested in the distinction between them. while each involve writing code to reach a particular result, there are some key differences between them.

At a high level, scripting is the use of scripts to automate tasks. A script is a set of instructions written in a scripting language to be interpreted or completed by another program. Scripts are usually accustomed to automate easy and repetitive tasks that don’t need to be completed using the full power of a programming language. Scripts are usually easier to write than full programs and do not require compilation before they can be run.

One common example of scripting is using a bash script to automate the process of setting up a new development environment on a new computer. A bash script will install all the required dependencies, set up configuration files, and launch the asked programs. Bash scripts are typically utilized in system administration to automate tasks like backups and software installations.

Example of a BASH script:

#!/bin/bash

# update the package manager
sudo apt-get update

# install git
sudo apt-get install git

# install python
sudo apt-get install python3

# install pip, the python package manager
sudo apt-get install python3-pip

# install virtualenv
pip3 install virtualenv

# create a new virtual environment
virtualenv env

# activate the virtual environment
source env/bin/activate

# install project dependencies
pip3 install -r requirements.txt

# run the development server
python3 manage.py runserver

Scripting languages ​​such as Bash, Perl, and PowerShell (Python and Ruby can be used as programming and scripting languages) are often used for tasks like automating tasks, web scraping on your computer, and writing simple programs. Languages like these ​​are usually easier to learn and use rather than programming languages, and are made for tasks that don’t need a lot of complexity or computation.

Programming, on the other hand, involves making programs that are far more advance and are typically compiled into an executable form. Programming languages ​​like Java, C++, and Python are more powerful than scripting languages ​​and are used to create programs that can perform various tasks. Programming requires a better understanding of computer science concepts and is often more time-consuming and difficult than writing scripts.

An example of programming can be making an online or a mobile application. That kinds of programs need additional complex logic and functionality, which are often created using programming languages. In order to build these types of applications, you would like to have a good foundation in concepts like data structures, algorithms, and object-oriented programming.

Example of a Web application:

from flask import Flask, render_template, request
import requests

app = Flask(__name__)

@app.route('/')
def search_form():
return render_template('search_form.html')

@app.route('/search', methods=['POST'])
def search():
query = request.form['query']
url = f'https://www.googleapis.com/books/v1/volumes?q={query}'
response = requests.get(url)
results = response.json()['items']
return render_template('search_results.html', query=query, results=results)

if __name__ == '__main__':
app.run(debug=True)
<form action="/search" method="post">
<input type="text" name="query" placeholder="Search for a book">
<input type="submit" value="Search">
</form>

It even looks more complex right?

So, to summarize the most distinction between scripting and programming, scripting is used to automate simple tasks whereas programming is used to make code a lot more advanced programs. Yet each involve writing code, programming needs a deeper understanding of computer science concepts and is usually way more time-consuming and difficult.

It’s important to notice that there’s tons of overlap between scripting and programming, and plenty of tasks may be accomplished using either method. However, if you would like to make advanced programs or applications, programming is usually the answer. If you only need to automate an easy task, scripting may be a more efficient alternative.

Thanks for reading my article! Hope you enjoyed it, if you have any questions, suggestions or ideas feel free to write them in the comments.

--

--

Word Weaver

Hi, I'm Tim! I'm an experienced IT professional with a wealth of knowledge on computers & tech. Follow my blog for practical tips, industry trends, & more.