Functions In Computer Programming

Computer Programming Functions: Get to Know What They Are

When it comes to computer programming vocabulary, there are so many terminologies that people who do not have enough know-how tend to become lost and confused. One term could be translated into so many different names in different languages. For example, the following words are quite similar: Functions, Programs, Subroutines, Procedures, Subprograms, or Subqueries. The only question now is which of these terms could stand on their own.

Theoretically speaking, computer programming avoids the duplication of any code in multiple spaces. For example, one institution utilizing the programs could have some libraries of different thousands or even more programs with billions of basic code lines. With such intricate case, duplication could still be avoided. Let us say that an error message occurs because the collection now needs to have an additional ‘member’.

A good example is the addition of another global currency called the Euro. If each and every program will be told to update itself because of this new addition, it could be complex. But with sub-programs or functions specifically designed to handle diverse situations, then the only function that would take care of the change would be the one assigned to handle such a scenario.

In the same way that we write new programs, many of the components that it will need are already in existence (e.g. accessing a certain file to dig up a certain data, computing inventories on hand). In cases such as this, a good alternative to writing different source code lines to work on the new function (and eventually replication of the code onto numerous other programs), the sub-program is accessed to work on the specified function.

In a handful of programming languages, there are certain parameters that are being passed from a specific program name to the program that is being called to do a task. A secondary program usually makes the values altered and then the control is brought back to the main program. These actions could be levels deeper. The various programs that are being used to call each other are written in so many varying languages. The reasons behind this are: to have a reasonable controllable function pieces and having various languages means being better able to suit different function types.

To further define the uses of programming functions, a function may appear in two different locations or even a single location. This depends on whether it is multi-line or single-line function. A function that is single line is one that gives back a value after performing tasks (all of this in a single line). The multi-line function, however, is stretched on many different lines.

A single line function could show in a code block all because it only responds when called by a certain name. The multi-line function does otherwise. If it is a multi-line function that is being defined in a block of code, then the statements that follow the definition are done in a non-sequential manner.

In its simplicity, functions are code blocks that can be reusable. These code blocks often return single values (sometimes they don’t’). Common examples of these code blocks are Mathematical functions (e.g. tan or log), date functions (figures between two dates), or string functions (looking for incidents of 1 string located within another string). Functions are also kept separately from the primary program code. A lot of programming language has specific functions which are delegated as entry points to a certain program.

Knowing what functions are in computer programming could take sometime to non-computer savvy individuals. But the basics are all here. Looking at the many complex things that functions do, you get to appreciate the things that the computer does for you each day, don’t you?

 

 
Translate Page Into German Translate Page Into French Translate Page Into Italian Translate Page Into Portuguese Translate Page Into Spanish Translate Page Into Japanese Translate Page Into Korean

More Articles

 

 

Search This Site

 

Related Products And FREE Videos





 

More Articles


Cd Rom Computer Programming Macromedia Training

... graphics editor that is designed to integrate with other Macromedia products. Another graphics program is the FreeHand package, which creates vector graphics in two-dimensions, and is designed for the use of desktop publishers. What is undoubtedly the most popular package in the Macromedia family is the ... 

Read Full Article  


Computer Programming Magazines

... respectable industry-related magazines. Thanks to the internet, these magazines are also available for public viewing over the web. This means you really don't worry about missing a subscription or so. In other cases, you don't even have to pay for subscriptions anymore. All you have to do is to log on ... 

Read Full Article  


Hardware Development And Computer Programming

... developers. But where there is software, there should also exist the hardware. Generally speaking, hardware devices are any physical things that are being used in computer manipulation. Examples are circuit boards, keyboards and processors. The development of hardware plays a major role on the advancement ... 

Read Full Article  


Computer Programming Fundamentals

... how to pour the right amount of cereal into a bowl and how much milk to use, in that order. And if you're truly good, you can even tell the computer what specific type of cereal and milk to use. - Understanding the nature of the code Another important basic knowledge you must learn in programming is understanding ... 

Read Full Article  


Examples Of Functions In Computer Programming

... 2+4+6 is 12. Take note that {} statement ended the course of the function. If multiple variables are to be returned, a group of variables should be returned, not a single variable: An example: function maths ($input1, $input2) { $total = ($input1 + $input2); $difference = ($input1 - $input2); $ret = array("tot"=>$total, ... 

Read Full Article