In programming you’ll find that you want the computer to do the same thing again and again, usually something pretty basic. Early on, programmers decided that they didn’t want to write the same instructions again and again so they developed subroutines and functions.
A subroutine is a snippet of code that you can abstract so it can be used again and again. It can be dead simple like this one that makes the computer beep, twice:
SUB BeepTwice
BEEP
BEEP
END
Continue reading “Programming Basics for Duncan IV: Subs and Functions”