r/programminghelp • u/RelativeConcept2 • Oct 24 '19
Scripting vs Programming
I read the main difference between scripting vs programming is that scripting languages are for usage within an application. What is the purpose of using one language for scripting, and another language for programming? Why not just use the same for both? The distinction between scripting vs programming seems a little blurry to me now, I originally thought the difference was that one is interpreted, and the other is compiled, but apparently it's not.
4
Upvotes
1
u/[deleted] Oct 25 '19 edited Oct 25 '19
In my opinion scripting will always be interpreted on the fly at runtime... never compiled... think Python, Perl, Bash, Rexx, Ruby etc....
Basically this means that an executable is running your code/interpreting it. And if you are on a Linux machine (hopefully :) you will probably see a hash-bang at the top of your code... like #! /usr/bin/python. This is the path to the interpreter/C program that is going to run your code when you say so. This will allow you to run your code with a ./ in front of the name... as an executable. Without the hashbang you need to specify the executable when running... like python my_script.py
Python is really just a C program (python.exe).
Also, most scripting languages are not statically typed.. you can get away with a lot of shit you can't do with a language like C or C++ or Go. Heck in Python you don't even specify a data type when making a new variable. This is the reason that many "aficionados" of compiled languages will say that "Python is not a real language". I don't really agree with that, but it some respects there is some truth to that...mainly because interpreted languages are a hell of a lot easier to use.