DEV Community

Sameer Katija
Sameer Katija

Posted on • Edited on • Originally published at sameerkatija.Medium

What is the difference between Scripting languages and programming languages?

If you are learning to code or already an experienced programmer, then you might have heard of scripting language and programming language. Although many of us use scripting and programming synonymously, in-depth they both have differences. All scripting languages are programming languages but not all programming languages are scripting languages.

Scripting languages and programming languages, both are high-level languages and are used to instruct the machines. If these both are used for the same purpose, then why do we need both of them? Today in this article we will try to breakdown both a scripting language and programming language and will try to understand them and their purpose.

As far as their language structure is concerned, they both are the same as I mentioned above all scripting languages are programming languages. The major difference is that scripting languages don’t require pre-compilation, instead, they are interpreted. Some of the interpreted languages are Javascript, PHP, and shell. While Programming languages are c++, C#, and java.

Difference between compilation and interpretation.

Now let’s discuss what is compilation and interpretation. Complier takes the source code and converts it all to gather in machine code. then the linker will take all the object codes and will link them together and generate an executable file. This executable file is platform-dependent and will learn on the platform for which it has been generated.

Interpreter does the same job, it also converts the source code to object code but, it does it line-by-line at runtime. Whenever it will interpret any line of code, it will also execute that.

Advantages and disadvantages of Compilation

Everything comes with advantages as well as disadvantages. The major advantage of compilation is that it is fast. As it takes all the code and compiles it all together, so it is fast.

The disadvantages of compilation are that they are platform-dependent and require an extra step for compilation.
The executable requires to run on a mac and on a Linux will be different. We also need an extra step to compile our code and sometimes, it can be time-consuming for some cases like debugging.

Advantages and disadvantages of Interpretation

The advantages of Interpreter are that it is cross-platform and doesn't require an extra step for compilation.

The disadvantage of Interpreter is that it is slow because the conversion to machine code happens on the go.

use case of both.

Programming languages are more powerful and are used to design more complex application which can run independently.
On the other hand, scripting languages are easy to learn and provide fast implications. They are mainly used to automate a series of tasks.

Conclusion

Now, as we know what is a scripting language and programming language. We should never again use these both synonymously. These both are important according to their use-cases and there may be some languages that have both compiler and interpreter available for them Like, python.

Top comments (0)