1. an Overview of Computers and Programming Languages
1. an Overview of Computers and Programming Languages
|Introduction to Programming|
MARK L. MASCARDO
College of Computing Studies (CCS)
• Definition:
What is Programming?
• Programming is the process of creating a set of instructions that a computer follows to
perform a specific task.
• These instructions are written in a programming language, which acts as a bridge
between human language and machine code.
• Real-Life Analogy:
• Programming enables the automation of tasks, making them faster and reducing the
possibility of human error.
• Problem Solving:
• Innovation:
• Writing Code:
• Code is written in a programming language that the computer can interpret and execute.
• Choosing a Language:
• The choice of programming language depends on the task. For example, Python is often
used for data analysis and web development, while C++ is preferred for system
programming.
Basic Concepts in Programming
• Algorithms:
• An algorithm is a step-by-step procedure to solve a problem.
Every program is based on an algorithm.
• Flowcharts:
• A flowchart is a graphical representation of an algorithm. It
helps visualize the flow of control in a program.
• Pseudocode:
• Pseudocode is an informal high-level description of the
operating principle of a program or algorithm. It uses plain
language to outline the logic before actual code is written.
Writing Your First Program
• Example: "Hello, World!"
• The "Hello, World!" program is traditionally the first program written by someone
learning a new programming language. It simply outputs the text "Hello, World!" on the
screen.
• print("Hello, World!")
• Explanation:
• In this example, print is a function that displays the specified message ("Hello, World!")
on the screen.
Compiling and Running a Program
• Source Code:
• The code that a programmer writes is called source code. This source code needs to be
translated into machine code that the computer can execute.
• Compilation/Interpretation:
• Depending on the programming language, this translation is done either by a compiler
(for languages like C++ or Java) or an interpreter (for languages like Python).
• Execution:
• Once translated, the computer executes the machine code, performing the tasks as
specified by the original program.
Overview of Programming Paradigms
• Procedural Programming:
• A paradigm based on the concept of procedure calls, where programs are structured as
sequences of statements or commands.
• Functional Programming:
• A paradigm that treats computation as the evaluation of mathematical functions and
avoids changing-state and mutable data.
Getting Started with Programming
• Choosing an IDE:
• An Integrated Development Environment (IDE) is a software application that provides
comprehensive facilities to programmers for software development. Examples include
PyCharm, Visual Studio Code, and Eclipse.