Introduction
Programming constructs are those structures that allow us to build programs. They are summaries of thought processes we often use.
- Conditional branchingWe need our computers to make decisions so we use variations of if-then-else; case; and occasional specialized tools.
- Iteration and loops. Often a set of steps must be repeated over and over. This is called iterating the loop and there are various loops to do this. They include for-next loops, while loops, do loops and such constructs.
- Variables and data types. We humans need to have the computer express information a certain way. Words are expressed as a string. Numbers in one of several number forms. Boolean is a logical data type that expresses things as TRUE or FALSE.
- Arrays/Vectors/Tables. We often need a useful way of holding data.
- Comments. Well, OK, they don't impact code but the really do impact our ability to understand our code later. Find your comment methods for your language.
Documents
Conditional branching
if-then-else
if-then-else but from a basic approach.
if-then-else with a JavaScript approach. Similar to many other modern languages.
The biggest problem with the if-then-else is when it gets too complicated. Nesting and long lists of if statements can be reduced to case or switch statements if supported by your language. Note: the syntax varies alot depending on the language
Case/SwitchCase/Switch
Case/Switch
Loops and iteration
For Loops, several flavors but solid explanation.
While Loops.
Loops, with a several flavors.
Loops, with a Pascal flavor.
Recursion as a form of Loop -- advanced topic, most can ignore this section
Variables and Data Types
While every effort has been made to find generic articles, always consult your language reference to see what are valid variable names and the syntax of your data types. Every language has its own rules. Each language has certain pre-defined variable names that you can't use because that language already does.
Discussion on variables
Variables
Variable names
Educational rant about variable names
Why choosing good variable names is important. Of course, language specific so remember the principle.
Variable names rules from a Java view, but easily adaptable to YOUR language.
Data types from a Basic approach, but most languages support the same type of types.
Data types
Data types
Data types from a C view.
Scope of a variable using bash but the concept is important.
Arrays/Vectors/Tables
Please note that some writers consider these to be a data type not a construct. I just don't agree with them.
Arrays
Arrays
Arrays from a JavaScript view.
Arrays from a bash view.
Comments and general coding styles
Comments
Coding Styles
Coding Styles
Coding Styles
Coding Styles
Videos
No videos have been developed for this yet.
Conditional branching
Loops and iteration
Variables and Data Types
Arrays/Vectors/Tables
Comments
Projects
No projects have been developed for this yet.
Conditional branching
Loops and iteration
Variables and Data Types
Arrays/Vectors/Tables
Comments
Examples
Excellent examples are available under the documents section.