Tuesday, 19 January 2016

SCOPE of prgramming

Scope variables ( in mock)

A variable is a storage of data that can be altered and changed at any time
constant is similar however the value cant be changed once it has been entered.
A global variable is accessible form all parts of a program
A local variable is only accessible within a function / procedure.

GOOD Programming
- Using meaningful identifiers for variable names
- Use commenting to aid understanding:
- Avoid use of global variables in favour of local variables.

local variables use less memory as the variable sis gone once the function is
global variables can become confusing as by using the same variable names data would be overwritten

No comments:

Post a Comment