Software Studies

Loop and Function

Today's reading was from Software Studies on Loops and Functions, here is just a quick brief on what I read and learned from the reading .

When reading about loops, I was slightly confused due to how loops were being discussed/explained, as I am familiar with loops in programming languages such as C# and JavaScript/Java, but page 179 of Software Studies was discussing loops in ways I was not familiar with or understood. The loop in this instance was said to denote a vast chain of beginnings; iterators, GO-TO statements with passing arguments, count-controlled loops, condition-controlled loops, collection controlled loops, tail-end recursion, enumerators, continuations, generators, or lambda forms. I did understand that a loop only needs one opportunity in a run-time to become infinite and a loop is a loop inside another.
Next onto page 181, a loop was described to haphazardly diverge into two branches: iteration, in which "a collection of instructions is repeated in a looping manner"; and a recursion, which has "each stage of the repetition executed as a sub-task of previous stage".

Functions, which are also known as "subroutine" are described as "self-contained sections of code that are laid-out in a standard way to enable deployment and re-use at any number of different points within a program". More-or-less, a function is convenient, within a function is code that lay's out the role of that function: for example, if a function was called "calculator", within the calculator function would be an arrangement of instructions that creates a working calculator for numerical problems, and whenever that function is called outside the function, it would then carry out its role. Using a function in this sense, is a way of minimising the amount of written code. Also, functions are normally dedicated to a single specific task and should not do anything outside of its intended scope; the only way a function should be interacted with "is by means of the values passed to it as arguments when the function is invoked".

Comments

Popular posts from this blog

Pure Data: GEM

Purr Data: GEM

The Enduring Ephemeral, or the Future Is a Memory