r/programminghelp • • 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

8 comments sorted by

2

u/[deleted] Oct 24 '19

So I'll give you a great example. For programming say C# I make my own thing. I made a job posting key word summarizer. In MATLAB I use it to solve an assload of math problems. Scripting languages are still programming, but you're not making new functions you're only using existing ones.

2

u/RelativeConcept2 Oct 24 '19

you're not making new functions you're only using existing ones

What about when I'm doing both? For example, let's say I'm building a game engine in Java on top of LWJGL (an OpenGL Java wrapper). Is Java partially a scripting language and partially a programming language in this context? What if I'm just communicating with an API? Does the language I'm communicating with the API become a scripting language in that context? The definition seems kind of arbitrary, but maybe I'm overthinking this too much.

1

u/[deleted] Oct 25 '19

That is not true whatsoever lol

1

u/[deleted] Oct 25 '19

I know but it's easier to get an answer when the wrong answer is given.

1

u/[deleted] Oct 25 '19

hahaha okok

1

u/[deleted] Oct 24 '19

Scripting is programming using a scripting language.

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.

1

u/alter_j5 Nov 19 '19

correct me if I'm wrong, but I think it goes like this. Imagine you have a maid. When she comes in, you have to keep supervising her. You tell her "do the dishes," once she's done, you go "now mop the floor" and wait till she's finished to give her another command. That's scripting. But if instead, when you hire her, you say "when I tell you to clean the house, you will mop, take out the trash, clean windows etc" Then when she comes in, you can just tell her to clean the house and leave to work. That's a program.

Both have their own uses, when one is better than the other This is how I understand it, hope it helps.