Comprehensive Introduction to Programming and Phases of Software Development

  • A computer handles data i.e it is a data handler.
  • Computer hardware needs to be instructed on how to operate. This set of instructions is called a program.
  • The art of writing a program is called programming or coding.
  • In the program, the instructions command the computer how to perform a task.
  • There are four phases of software development. These phases can be structured using the waterfall model, iterative model, or the agile model. These phases are:
  1. Analysis – The developer decides what the program can do, its functions and capabilities.
  2. Design and Plan – Focuses on decision on how the program is to be created and operated by the end user. Requires developer to choose programming language, sketch interface, and design database.
  3. Build – Software is created and its user documentation written.
  4. Test – Software is run to check its operations and debug its code. There are 4 types of tests: unit test (for checking individual functions), function test (for checking individual components), integration test (to check whether components work together as expected), and system test (to check the entire software in a working environment/system).
  • The set of words, numbers/numerals, and symbols used to write a program constitute the programming language. If the language requires the person writing the program (the programmer) to have a deep understanding of computer knowledge, and the program is optimized to work on only a specific computer hardware, then this language is defined as a low-level language. The program created usually has direct control of the hardware and its functionalities. Conversely, if the language allows the programmer who has little understanding of computer hardware to write a program that can be run on almost any computer hardware, then this language is called a high-level language. It can be written quickly and it is easy to understand.
  • The low-level language is used to create a low-level code that the microprocessor can understand as a set of instructions, and this code is called the machine code. It is usually a collection of bits – sets of 1 and 0 – that the processor can read, interpret, execute, and process to generate an output. This code is comprised of two parts: the opcode which are the instructions, and the operand that specifies the data to be used by the processor.
  • Programs written in high-level language need to be translated into machine code for it to be executed by the processor. If the programming is running, the interpreter performs this translation and execution. The compiler translates the program before it is run.
  • A program is written in a code editor, which can have productivity features such as color coding and autocomplete for instructions. If this code editor is combined with a debugger, compiler, and interpreter into a single set of tools for creating, testing, and running programs, then this set of tools is called the integrated development environment (IDE).
  • Programming languages can be classified into the following types:
  1. Imperative Programming – Requires the program to provide detailed step-by-step instructions of how the program is to be run by the processor so as to complete a task. Examples of imperative programming languages are Java, C, and C++.
  2. Declarative Programming – Programmer instructs program what output to provide, without instructing the program what to do to achieve this output. An example of a declarative programming language is the structured query language (SQL) and Wolfram Language.
  3. Event-driven Programming – Program waits for an event (such as user action or sensor input) to happen, and then executes a specific program sequence. Examples of event-driven programming languages are Scratch and JavaScript.
  4. Procedural Programming – Program has distinct functions, with each function reusing chunks of instructions sets. A function can start another function, and even restart itself. Examples of procedural programming languages are Python and Java.
  5. Object-Oriented Programming – In this program, the data and instructions related to its processing are bundled together into objects, and each object can interact with other objects. As expected, the objects contain the data, related instruction sets, and interface for communicating with other objects. Examples of object-oriented programming are Python, C++, and Javascript.
  6. Visual Programming – Language uses drag-and-drop interface to create software. An example of this language is Visual Basic.
  • Programming is guided by 2 related precepts:
    • There is always an easier way to solve a problem.
    • Keep it simple.
  • Programming languages can be categorized conceptually into 3 groups:
    • Multipurpose versus Domain-specific language: A multipurpose programming language – e.g C – can be used to create different types of programs e.g desktop programs, mobile applications, and web applications; while a domain-specific language e.g CSS, XML, SQL, and HTML e.t.c is only used to for one specific purpose e.g CSS for styling HTML webpages.
    • Single-paradigm versus Multiparadigm language: A paradigm is the philosophy, method, or approach to solving a problem. Each paradigm has its own mode of think and way of expression. A programming language can be created to solve problems using a specific paradigm, but still allow other paradigms to be used.
    • Strongly-typed versus Weakly-typed Language: A strongly-typed language requires the type to be declared before it is run e.g C# and C++, and it is also described as a Staticallytyped language. A weakly-typed, or dynamically-typed language does not require the data type to be declared e.g JavaScript and Python.
  • The programming language used to write the source code is called the source code language. The source code is converted into a machine code using a translator, and there are 3 types of translators which give rise to 3 types of programming language:
  1. Interpreted Language: The translator converts the code line-by-line with the computer executing the program in this manner. PHP and JavaScript are interpreted languages.
  2. Compiled Language: The entire source code is converted into machine language at once through a process called compilation. C++ and C are compiled languages.
  3. Mixed Language: The source code is compiled into an intermediate language, and this compiled code is then converted into machine code. Java and C# are mixed languages.
  • The process of creating a program consists of the following steps:
  • Elaboration of the problem.
  • Creation of an algorithm in pseudo-code.
  • Editing the program in the code editor.
  • Program compilation.
  • Linkage of the compiled program with external files and/or modules depending on references made in the program source code.
  • Creation of an executable file that is the final program.
  • Program execution enables one to determine if the program is working correctly. It also allows for the revelation of runtime errors or improper functionality, and this requires debugging.
  • Debugging allows for the correction of runtime errors and improper functionality, with this correction done by re-editing the source code in the code editor. After debugging, the program is executed again, and if everything is fine, the program goes to the next step.
  • Exploitation phase: The program is tested by executing it in a real environment that mimics how the user will use the program.
  • Program release for real usage.
  • Program maintenance: In this maintenance phase, the functionality of the program is improved and optimized.
  • An IDE is a programming environment that contains the code editor, debugger,
  • The main parts of a program are:
  1. Comments.
  2. Preprocessing.
  3. Main functions. The function in the program is enclosed/wrapped by curly brackets/braces {}.
  4. Keywords.
  5. External functions.
  6. Control characters.
  • A Variable is a memory area in a program that can be referenced in this program. Each variable is given a name that serves as its identity. This name must start with a letter, and can be a combination of letters and numbers. Each named variable can store a value that can be referenced to in the program.
  • There are different types of variables:
  1. Whole variable INT – This is used to store whole numbers.
  2. Real variable FLOAT – Used to store a decimal number.
  3. Character variable CHAR – Used to store only a single character.
  • A variable is assigned a value using the EQUALS TO operator (=) in the following manner

Variable = value;

  • The semicolon (;) is a control character that indicates an end to a statement or command.
  • The variable types can be converted, and there are two forms of this type conversion:
  1. Implicit Conversion.
  2. Explicit Conversion.
  • A special type of variable is the pointer which is a variable that stores the physical address of another variable, thus allowing the stored variable to be accessed indirectly.
  • Logical comparisons allows one option from multiple options to be chosen for execution depending on input fed into the program. The main statements used for logical comparisons in C programming are:
  1. IF statement: It evaluates if an expression satisfies a condition, and then executes a predefined instruction. The expression is enclosed wrapped in brackets ().
  2. IF-ELSE statement: It has 2 sets of pre-defined instructions to be executed, generically described as the IF instruction and the ELSE instruction. It evaluates if an expression satisfies a condition and then executes the predefined IF instruction, but if there is no expression, then the ELSE instruction is executed.
  • Relational operators are used to evaluate a value in a logical expression, and the main types of relational operators are ==,>,>=,<,=<, and !=.
  • Logical expressions can be combined together using logical operators, and the main types of these operators are &&, !, and ||.
  • An alternative to the IF-ELSE statement is the SWITCH statement.
  • An action may need to be repeated till a condition is satisfied, and this process of repetition is called a loop. The main types of loop are:
  1. Loop FOR – Used to repeat the instruction execution for a specific number of times.
  2. WHILE Loop – Used to repeat the instruction execution that has satisfied a condition.
  • Fixed quantity of elements belonging to a particular type form an array.
  • A sequence of characters is called a string.
  • There are 2 types of memory allocated to a program: static and dynamic memory. The memory that is managed by the source code compiler is called the static memory, while the memory space that the programmer allocates the program is called dynamic memory.
  • Dynamic memory is allocated at run-time with its size predetermined by the malloc function set by the programmer.
  • In C programming, each functionality of the program is controlled by a block of code called a function.
  • A set of functions form a module.
  • In structured programming, the code is divided into functions and modules, which simplifies the process of code maintenance and modification.
  • Regarding variables in structured programming, each variable has a scope. This scope of a variable describes its range of visibility within the program. If the variable is defined in a function, it can only be used inside this function. Thus, its visibility is described as being limited within the function, and this scope of a variable makes the variable a static variable. If the variable is defined in a module, then its scope and range of visibility makes it a global variable. As expected, the global variable is visible to all functions in the module.
  • In a function, the static variable is referenced to using a local variable call. It is the compiler that makes this call.
  • The function is identified by a (function) name.
  • A parameter can be passed to a function. A parameter is described as a list of variables separated from each other by a comma, and this list can be passed to a function. This parameter can be passed to the function in 2 ways:
  1. Parameter by Value – Used to pass variables and constant whose value does not change during execution of the function.
  2. Parameter by Reference – Used to change the modify the parameter in the function, and this parameter is passed as a pointer. It is usually used to return 2 or more values in the function.
  • A value that returns a function is called the return.
Share this post:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.