Posts

for loop

​The simplest form of a loop is a for loop. for loop specifies initial configuration of the loop variable, the exit condition and optionally a change of a variable with each iteration. By default if a step of changing variable value is not specified, then with each iteration of this loop, loop variable will be adjusted by one.

A loop in programming

​A loop in programming is way to perform multiple iterations of code execution. There are three options of loops, I will cover each one separately.

Combine statements within an if statement

​It is possible to combine conditions that are inside of an if statement with the help of AND and OR statements. AND statement is used to perform a Boolean expression that combines results of each condition, and only if all of the conditions are true then entire condition evaluates to TRUE. OR condition just like AND condition is used to perform Boolean operations on the results of expressions. If any of the expressions evaluate to TRUE, then entire condition evaluates to TRUE. I think that operation with OR conditions can be simplified. If first occurrence of such a condition evaluates to TRUE, then there is no need to evaluate conditions any further.

if control statements

​if control statements is way to conditionally execute code depending on the condition that is within of statement. I will explain more about if statements.

Computer dictionaries

​A computer dictionary is a way to store and efficiently access related information in code. A dictionary consists of elements that have a key and the value. For example keys can be “first” and “last”. Computer dictionaries make more sense than arrays.

Introduction to OOP (Object Oriented Programming)

​Object Oriented Programming (OOP) is used to speed up complex development time. OOP defines classes that can be reused by several different objects. Classes define properties and methods that can be used by that object. For example if a class is a car. Then speed of the car is going to be that class property. Actions of that class are going to be accelerate or break.

A module in programming

​A module in programming is a piece of code that can be reused in other applications. The benefit of having modules is that modules speed up development time. Modules can be used to provide generic functionality that will be common to many programs.