How does using Scripting and calling functions of scripting API differ from programming using C++ in UDK or Unity?in scripting we use the scripting API to interact with the engine and use functions provided by this API to get things done by the engine?
Scripting is a subset of programming. Programming in udk means you are also creating functions, mathematical expressions, logic and conditions etc yourself. When you say you are using a scripting language then basically it means you are calling functions, creating objects, setting the resources and much more batch work and sometimes AI too. Python, perl and java script are mostly used when you are doing the scripting work and are much easier to use.
Scripting and programming are used interchangeably in certain contexts, but they are certainly distinct. The clearest difference is that scripting is a type of programming in which you are controlling the behavior of complex objects. With scripting, you do not generally specify the structure of the application, but rather you manipulate the objects within an existing structure of another program (e.g. the UDK or Unity runtime engine). Of course, scripts can often set up their own internal structure, but they ultimately rely on another program for the low-level structure.
Some programming languages are referred to as "scripting languages". They are typified by being parsed and run by a program (the interpreter). You can see that this is another case of the script controlling objects (interpreter intermediate data objects, including things like bytecode) within a structure that already exists.
Another way to think about it is to see scripts as part of a data-driven program, whereas native programming (e.g. C++) is used to generate the actual machine code for that program. These lines can be blurred, of course!
Scripting usually referred to programs, which are processed by interpreter (virtual machine).
Programming usually referred to programs, which are compiled to machine code.
I think there is no reason to discriminate scripting and programming, since both scripting and programming environments are usually Turing-complete, so they are equally powerful.
Scripting is very different for various reasons from programming using C++ and very similar in the same time.
- You'll often write function, classes and expressions
- You instruct the Engine what to do during the game / menu state.
- You need to compile C++ and you don't need to compile a script.
- C++ often offers lower level access to functionality and leaves more room for mistakes.
- Scripting languages often offer a useful and easier to learn API but not necessarily the case.