Reading 04
Functions
Function
A task or grouping of numerous tasks which may be easily called upon by simply stating its/their assigned name. -Brannon Starnes
To define or ‘Declare’ a function: Function funcName(){code}
To ‘call’ a function: funcName(); . When you expect the function to provide a value it is known as the * return * value.
return varName;
Any function that requires values in the form of parameters, place them in the parenthesis:
myExample(value1, value2)
.
Variable Scope
Local Variable
Anytime a variable is declared * within * a function, it cannot be used any other place. You may also call these “function level variables”.
Global Variable
Variables created outside a function can be used anywhere in the code, hence the name “Global”.
Links
<a href="yourlink.example>
Links to various destinations are available for use in HTML.
<li>Other sites</li> <li>Pages on the same site</li> <li>Email "href='mailto:name@mail.com"</li> <li>Areas on same page "href='#id'"</li>
Paired Programming
Paired programming is a powerful tool used to fully engross student developers into the programming languages they are learning. This process is similar to that of any foreign language class. The language is note only read and written, but spoken and listened-to. These key points help to solidify what is being learned.
Additionally, this is a more efficient process than solo programming. Pairs tend to catch mistakes and produce a cleaner, more error-free product. This makes what seems to be a slower process, in turn, more efficient. As an added benefit, paired programming prepares students for future interviews with software development companies who often use this method in the interview itself.