Spaghetti Code

Code Structure


description

Code Blocks

Code Blocks are how a computer comes to recognize which pieces of code go together. The syntax for many programming languages uses parentheses '()', brackets '[]', or curly braces '{}' to determine these blocks.
  • Parentheses often denote a block of arguments, or inputs that a piece of code will use during computations.
  • Brackets, especially at the end of a variable, denote an array.
  • Curly braces determine where a series of instructions begins and ends.
Organizing these code blocks demonstrates what code structure is all about. But how do we organize them? The best practice is to align, space, and comment your code blocks properly. Let's start with how to align code blocks.