when you know how many times you want to loop for...
Indefinite loop
when you don't know how many times you want to loop.while...
if
if=selection
comments
explains what each part of the program does;easier to read
Descriptive names
descriptive identifier for variavles/constants/subprograms to make their purpose clear.
Indentation
easier to see where each block of code starts and finishes.Getting this wrong could also reuslt in the program not running.
White space
adding blanklines between bits of code to make them stand out.
Strings
A sequence of characters.They can be letters,numbers,symbols,punctuation or spaces ususally put in speechmarks.Substring is a way of extracting part of the string.The substring is also known as a slice.
Sub programs
A piece of code that performs a specific task.
Example of sub program
Turtle is a built in subprogram
Recursion
when subprograms call themselves.You must have a terminating condition otherwise this creates an infinite loop.
Functions
This returns a value to the main program
Procedures
This doesn't return a value to the main program
Parameters
The values that are passed to a subprogram when it is called.
Constant
a set value that cannot be changed
Local variable
only accesses from the subprogram in which it is created
Global Variable
can be accessed from anywhere in the program including inside subprograms
Scope
the region of code within a variable is visible(where can that variable be seen-local or global)