Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

I.

REVIEW OF COMPUTER PROGRAMMING FUNDAMENTALS (Week 1)

a. Programming Languages
b. IDE and Coding Environments
c. Variable Declaration
d. Basic Syntax
e. Data Type and Structures
f. Flow Control Structures
g. Functional Programming
h. OOP
i. Debugging
j. APIs

A. PROGRAMMING LANGUAGES

A programming language is a formal language used to write computer programs that can be executed by a computer or
other computing devices.

It consists of a set of rules, symbols, and syntax that define the instructions to be executed by a computer. Programming
languages allow programmers to create software applications, websites, and other computer programs by writing code
that can be compiled or interpreted by a computer.

Some common examples of programming languages are:

Web Application:

JavaScript, Python, Ruby, PHP, Java, C#, TypeScript, Go, Kotlin, Swift, Rust

Android:

Java, Kotlin, C++, C#, Dart,JavaScript

Software:

C, C++, Java, Python, Ruby, Rust, Swift, JavaScript, Go, Kotlin, TypeScript, C#

AI/Robotics/Expert Systems:

Python, C++, Java, JavaScript, Lua, Rust, MATLAB, Lisp

Note that these programming languages are not limited to the respective fields mentioned above. Many programming
languages can be used across different fields, depending on their features and capabilities.

B. IDE AND CODING ENVIRONMENTS

IDE stands for Integrated Development Environment – they are applications programmers use to write code and
organize text groups. It increases a programmer’s efficiency and productivity, and has added features like code
completion, code compilation, debugging, syntax highlighting, etc.

Some common examples of IDE’s are:

1. Visual Studio code


2. Visual Studio
3. NetBeans
4. Android Studio

IDEs have the following features:

1. Source code editor - is an environment in which the programmer enters his code and the code he writes is
converted into machine language by the compiler or interpreter
a. Syntax Colouring
Page 1 of 9
b. Autocomplete
c. Code Template
2. Compiler or interpreter - A compiler and an interpreter are two types of programs that are used to convert
source code written in a programming language into machine code that can be executed by a computer.
a. Compiler - is a program that converts the entire source code into an executable form at once.
b. Interpreter - is a program that converts and executes source code line by line, or statement by
statement, at runtime.
3. Error terminator - IDEs include debugging tools that allow developers to identify and fix bugs in their code.
These tools may include breakpoints, step-through debugging, and variable inspection.

C. VARIABLE DECLARATION

Variables are containers for storing data values, a memory location for a data type. Variables are created using a
declaration or keyword that varies across languages.

Variable names are usually alphanumeric, that is, they contain a-z and 0-9. They can also include special characters like
underscore or the dollar sign.

Variables can hold values of any data type supported by the programming language. This value may change during
program execution.

D. BASIC SYNTAX

Every programming language has its syntax, and you must learn the fundamental syntax of the language you are
learning.

Syntax refers to the set of rules that define the structure of a language. It is almost impossible to read or understand a
programming language without its syntax.

For example, let us declare a variable named greet and assign the value “Hello World” to it:

In Javascript

In C++

E. DATA TYPES AND STRUCTURES

Data types refer to the classification of data. The most common data types include:

a. String – “Sheesh”
b. Boolean - TRUE or FALSE
c. Numbers, which includes integers (whole numbers from 1) and floating-point numbers (decimal-base)
d. Characters (includes single alphabets or numbers)

Page 2 of 9
e. Arrays (a collection of data, usually of the same data type)

Data Structure is a storage that is used to store and organize data. It is a way of arranging data on a computer so that it
can be accessed and updated efficiently.

Depending on your requirement and project, it is important to choose the right data structure for your project.

Why Data Structure?

Knowledge about data structures helps you understand the working of each data structure. And, based on that you can
select the right data structures for your project.

Types of Data Structure

LINEAR DATA STRUCTURE

In linear data structures, the elements are arranged in sequence one after the other. Since elements are arranged in
particular order, they are easy to implement.

However, when the complexity of the program increases, the linear data structures might not be the best choice because
of operational complexities.

1. Array Data Structure - In an array, elements in memory are arranged in continuous memory. All the elements of an
array are of the same type

2. Stack Data Structure - In stack data structure, elements are stored in the LIFO principle. That is, the last element
stored in a stack will be removed first. It works just like a pile of plates where the last plate kept on the pile will be
removed first.

3. Queue Data Structure - Unlike stack, the queue data structure works in the FIFO principle where first element
stored in the queue will be removed first. It works just like a queue of people in the ticket counter where first
person on the queue

4. Linked List Data Structure – In linked list data structure, data elements are connected through a series of nodes.
And, each node contains the data items and address to the next node.

Page 3 of 9
NON LINEAR DATA STRUCTURE

Unlike linear data structures, elements in non-linear data structures are not in any sequence. Instead they are arranged
in a hierarchical manner where one element will be connected to one or more elements.

Non-linear data structures are further divided into graph and tree based data structures.

1. Graph Data Structure

A graph data structure is a collection of nodes that have data and are connected to other nodes.

Let's try to understand this through an example. On facebook, everything is a node. That includes User, Photo, Album,
Event, Group, Page, Comment, Story, Video, Link, Note...anything that has data is a node.

Every relationship is an edge from one node to another. Whether you post a photo, join a group, like a page, etc., a new
edge is created for that relationship.

All of facebook is then a collection of these nodes and edges. This is because facebook uses a graph data structure to
store its data.

More precisely, a graph is a data structure (V, E) that consists of

A collection of vertices V

A collection of edges E, represented as ordered pairs of vertices (u,v)

2. Trees Data Structure

A tree is a nonlinear hierarchical data structure that consists of nodes connected by edges.

Similar to a graph, a tree is also a collection of vertices and edges. However, in tree data structure, there can only be one
edge between two vertices.

Linear vs Non-linear Data Structures

Now that we know about linear and non-linear data structures, let's see the major differences between them.

Linear Data Structures Non Linear Data Structures


The data items are arranged in sequential order, one after The data items are arranged in non-sequential order
the other. (hierarchical manner).
All the items are present on the single layer. The data items are present at different layers.
It can be traversed on a single run. That is, if we start from It requires multiple runs. That is, if we start from the first

Page 4 of 9
the first element, we can traverse all the elements element it might not be possible to traverse all the
sequentially in a single pass. elements in a single pass.
The memory utilization is not efficient. Different structures utilize memory in different efficient
ways depending on the need.
The time complexity increase with the data size. Time complexity remains the same.

F. FLOW CONTROL STRUCTURES

Flow Control Structures are the fundamental components of computer programs. They are commands that allow a
program to “decide” to take one direction or another.

There are three basic types of control structures: sequential, selection, and iteration.

1. Sequential

The most basic control flow is sequential control flow. It involves the execution of code statements one after the other.
A real-world example is following a cooking recipe.

Sequential control flow is a fundamental concept in programming that refers to the order in which instructions or
statements are executed in a program. In sequential control flow, each statement is executed one after the other, in the
order that they appear in the code.

2. Selection (conditionals)

The basic premise of selection flow control is, the computer decides what action to perform based on the result of a test
or condition equalling true or false.

Selection or conditionals are control flow structures in programming that allow the execution of different blocks of code
based on the evaluation of a condition or expression.

Page 5 of 9
`if` statement example:

`switch` statement example:

3. Iterations (Loops)

A loop is a programming structure that allows a statement or block of code to be run repeatedly until a specified
condition is no longer true (will return Boolean, true or false). It is one of the most powerful and fundamental
programming concepts.

for loop: A loop that repeats a block of code a specified number of times. It is commonly used when you know the
number of iterations in advance.

Page 6 of 9
while loop: A loop that repeats a block of code while a specified condition is true. It is commonly used when you do not
know the number of iterations in advance.

do-while loop: A loop that is similar to the while loop, but it always executes the loop body at least once, even if the
condition is false.

forEach loop: A loop that is used to iterate over the elements of an array. It executes a function for each element in the
array.

for...in loop: A loop that is used to iterate over the properties of an object. It executes a block of code for each property
in the object.

for...of loop: A loop that is used to iterate over the elements of an iterable object (such as an array). It executes a block
of code for each element in the iterable.

G. FUNCTIONAL PROGRAMMING

Functions are containers that take in a set of inputs and return an output. It is not required for a function to return a
value. Pure functions will always give the same result for the same set of inputs.

Functional Programming is a straightforward method of building software that involves using pure functions. This
method eliminates the occurrence of data mutation or side effects.

H. OOP

**Object-Oriented Programming (OOP)**is a programming concept that revolves around ‘objects’ and ‘methods’.

Before OOP we had a procedural programming that divided a program into a set of functions so we have data stored in a
bunch of variables and functions that operate on the data. When copying lines of code, you make a change to one
function and then several other functions would break – that’s what we call spaghetti code. The procedural code has so
many parameters.

In OOP we combine a group of related variables and functions into an OBJECT. We refer to these variables as properties
and the functions as methods.

Page 7 of 9
There are four core concepts of OOP:

a. Encapsulation – we group related variables and functions that operate on them into objects.

The parameters are modelled as properties of this object and the getWage() function are part of one unit. The fewer the
number of parameters the easier it is to use and maintain that function. Encapsulation reduces complexity and increase
reusability.

Parameters - is a value or variable that is passed as an input to a function or method.

Abstraction - Encapsulation reduces complexity and isolates impact of changes.

-In object-oriented programming (OOP), abstraction is a key principle that allows developers to create complex software
systems by breaking them down into simpler, more manageable components.

For example, let's say we're building a car rental system. We might create an abstract class called "Vehicle" that defines
the basic properties and methods of all vehicles, such as "drive" and "stop". We could then create more specific classes
that inherit from Vehicle, such as "Car", "Truck", and "Motorcycle", each with their own unique properties and methods.

- is a concept of hiding the implementation details and showing only the necessary information to the user. It allows
creating a simplified version of a complex system and ignoring unimportant details, thus making it easier to understand
and use

-hiding away functionality, no matter how you do it.

Inheritance – Eliminate redundant Code, Saves time

Allows us to use the properties of an existing class already.

Polymorphism – Refractor ugly switch/ case statements.

Allows you to write code that can work with objects of different classes without having to know the exact type of each
object at compile time. This is achieved through the use of inheritance and interfaces.

I. DEBUGGING

It involves detecting and removing existing and potential errors, defects, or ‘loopholes’ in one’s code.

I. API

API stands for application programming interface, which is a set of definitions and protocols for building and integrating
application software.

How do APIs work?

APIs let your product or service communicate with other products and services without having to know how they’re
implemented. This can simplify app development, saving time and money.

Examples are:

GCASH API
Page 8 of 9
PAYMONGO API
CHATFUEL API
Basic Interpretation:

Reasons why we use API?

1. ACCESS DATA – They are used to get access to data so multiple apps or services can work together.
2. HIDE COMPLEXITY – Allowing developers to not waste time on figuring out how certain technology works.
3. EXTEND FUNCTIONALITY – extend functionality of existing systems.
4. SECURITY – they act as gate keeper to protect our personal data.

**End

Next: Short Quiz


Review

Page 9 of 9

You might also like