For those without knowledge of programming, the terms used are strange and confusing. To a beginner in programming, words such as programs, queries, procedures, subquires etc. are unfamiliar and uncommon. They can get you lost, but what do they stand for individually?
Duplication in programming is always avoided. Basic code in billions of lines may make up a program, but with duplication always avoided. When an additional member is needed, an error message may occur.
For example, if a currency that is global, called the Euro, is to be added. Updating each program to have it would be difficult, as it would require the addition of one of many lines of code. But a function or a sub-program can be created to handle this. Then it would be added to the program to handle the changes.
Many components of new programs are usually in pre-existence for example file access, inventorying. Alternatively, instead of writing new lines of code, we can have a sub-program to work on the specific function. It can then be added to other programs to do the same task.
A parameter can go into a specific program handling a specified task. Control is taken back to the main program, i.e. a secondary program altering values. Varying languages can be made to call varying programs. This enables having controllable function pieces and different function types are handled better by the suitable languages.
A function can be multilines or single line. A multi-line stretches in many lines, while a single-line returns a value after task performance is done on a single line. A specific name must call the single-line function. A multi-line function, however, can be called non-sequential statements in a block of code.
To put it simply, functions are reusable blocks of code. That is, instead of writing a code again, we use code that is already written i.e. repetition. For example, mathematical e.g. log, tan or date (working with value dates) or string (looking if a string can be located on another string). Mostly, program code is separated from the functions. The functions are developed as if they are small programs. Specific functions usually provide an entry point to certain programs.
Just by looking at what a computer does, one begins to understand how programming works. All the basics can be observed from the working applications. But the transition from a beginner to a proficient programmer takes time.