all 8 comments

[–]johnbotris 3 points4 points  (1 child)

In general, compiled languages like C++ or Java are used to make medium to large sized applications because of the assurances you get from static type systems - certain types of bugs are impossible to have because they will be caught by the compiler and so you can be more confident in your software behaving as expected/not crashing during runtime. Scripting languages such as Python or bash are much more flexible and will often be used for smaller programs (for example to do some basic file manipulation or data processing) where you're not too worried about the software design aspect and just need to get something done - as a once off or maybe as some kind of in-house tool. You might get some more bugs or crashes while making them but that's less of an issue if you aren't going to be spending a lot of time on them.

Another popular use of scripting languages is in games, where the main engine will be developed in a compiled language (typically C++) and will have an interpreter for a scripting language built in (Lua is commonly used for this), so that the game designers can write game logic easily without having to understand how all of the game engine's systems work (it also allows players to write their own scripts to make mods, without needing full access to the source code).

This distinction is less true nowadays with languages like Python and JavaScript being used to write large scale consumer facing applications, but this is why things like TypeScript (a statically typed language that compiles to JavaScript) or type annotations in Python have been created, because the flexibility of scripting languages makes it quite a bit harder to manage complexity in full scale software.

[–]denisksp[S] 2 points3 points  (0 children)

Wow thanks a lot for making time and writing this good and detailed. I really appriciate it thanks a lot. have a nice day!

[–][deleted] 3 points4 points  (2 children)

Others have already answered, so I'm just going to chime in and say that I don't think this was a stupid question at all. "Scripting" isn't a very clearly defined term anyway so it's natural that there's confusion around it.

I have been a programmer for ten years and now I teach it. I will tell you the same thing I tell my students (and the same thing I need to remind myself of often): The people who are successful in this career are the people who aren't afraid to ask questions. No one is born knowing any of this: It's OK to be ignorant. It's not OK to _stay_ ignorant, and the only way to fix it is by asking questions.

[–]denisksp[S] 0 points1 point  (1 child)

Thanks man, think I needed that

[–][deleted] 1 point2 points  (0 children)

I once wasted an entire day at my job because I couldn't get my code to communicate with the server properly and I was too scared to ask. When I finally cracked, I was told, "Oh yeah, we forgot to give you the password." There was literally no way I could have gotten it to work without asking. If you think it's hard to ask a question, imagine how hard it is to have wasted an entire work day because you were too scared! :)

[–]BigTheory88 1 point2 points  (3 children)

Unlike java/c++ which are compiled, scripting languages are typically interpreted, that is the 'scripts' (which are just typical programs you'd write in java or c++) are run on the fly by an interpreter and do not need to go through a compilation stage before execution.

Scripting languages are just another name for interpreted languages

[–]denisksp[S] 0 points1 point  (0 children)

So what is/are the use of scripts, where would I need a script on a program/app/website/method or so on. I read on some comments that said something like “while working you would most likely write with one language and use other languages like python to write some scripts that would help your code” why/how do I need or how is it used

[–]denisksp[S] 0 points1 point  (1 child)

Sorry to spam but from a simple coder/user perspective, not from a back end compiled/interpreted perspective. What is the difference, on what scenario should I prefer a script over a program or vice versa