Results 1 to 2 of 2
Jul 27, 2011, 02:39 #1
Having real trouble understanding functions, some help would be great
Jul 27, 2011, 03:43 #2
- Join Date
- Jun 2007
- North Yorkshire, UK
- 0 Post(s)
- 0 Thread(s)
There are many reasons for using functions.
The simplest reason is that if you do not use functions then you could end up with a very large block of code that is difficult to understand. Taking parts of the code out into a function can make the large block of code a lot smaller and thus easier to understand.
You also use a function if a piece of code occurs many times in your program/script. Put the code into a function and call the function rather than replicate the code. The use of function parameters/arguments allows the same code to work on different data.