Introduction To Programming
Introduction To Programming
Introduction To Programming
Programming Concept
Why understanding programming languages is essential
in the digital age.
What is a Programming Language?
Definition Importance
lowest-level programming language Fundamental for computer operation;
consisting of binary code directly every program ultimately runs as
executed by a computer's central machine code.
processing unit (CPU)
Assembly language
Definition Importance
Assembly language is a low-level Provides a more human-readable
programming language closely related representation of machine code,
to machine language but uses enabling programmers to write code at a
mnemonics and symbols to represent lower level than high-level languages
instructions.
High-level Languages
Definition Importance
High-level languages are user-friendly Enhances productivity, readability, and
programming languages with high-level portability; enables complex tasks
abstractions from machine code, making without dealing with low-level
it easier for programmers to write code. hardware details.
How Programming Languages Work
01 02 03 04
Source Code Assembly Code Object Code Executable Code
PreProcesso
Compiler Assembler
r
Link Editor
Preprocessing Compilation Assembly Linking
convert source code in expanded source to convert assembly source convert object code to
expanded assembly code to object code executable code
source code source code
What is
assembler,compiler
?
Assembler
Helps computers understand really basic instructions.
It reads and executes your high-level code line by line, translating and
running each command as it goes. It's great for testing small bits of code
and seeing immediate results.
Interpreter vs Compiler vs Assemble
Translates high-level language Translates high-level language Translates assembly language into
into machine code into machine code machine code
Translates source one line at a Translates all code at the same Uses the processors instruction set to
time time convert
Returns a list of errors found Will only inform you of the first
and on which lines error it finds
Runs more slowly as it is being Once compiled runs quickly but Runs quickly as conversation between
translated every time the code compiling can take a long time two low level languages is just reliant on
is run the processors instructions set
Types of Programming Languages
01 02
Procedural Languages Object-Oriented Languages
Based on procedures or routines; follow Organize data as objects and methods to
a linear flow of control. manipulate these objects.
03 04
Functional Languages Scripting Languages
Treat computation as the evaluation of
Interpreted languages for automating the
mathematical functions; avoid changing
execution of tasks.
state and mutable data.
Popular programming languages
Known for readability and versatility; used in web development, data
Python analysis, artificial intelligence, and more.
Computational Thinking
Semantics Programming
Syntax
What is syntax and semantics?
Semantics, on the other hand, deals with the meaning behind the code,
ensuring that instructions are executed correctly.
syntax
Syntax in programming refers to the set of rules that dictate how
programs should be written.
Components of Syntax:
1. Keywords: Reserved words with specific meanings (e.g., if, else, while).
2. Operators: Symbols representing computations (e.g., +, -, *, /).
3. Variables: Containers for storing data, named using letters and digits.
4. Punctuation: Symbols like semicolons (;) and parentheses () used for
structuring code.
5. Expressions: Combinations of variables, operators, and keywords that
produce a value.
Why syntax is important?
Syntax rules are the precise instructions governing how code should
be structured.
Readability Compatibility
Consistent syntax enhances Following language-specific
code readability, making it rules ensures compatibility
easier to understand and across different platforms and
maintain versions.
Understanding Syntax is
the First Step in Writing
Code!
semantics
Semantics in programming focuses on the meaning behind the
code.
Understanding Semantics:
Implementation phase
• implement the program in some programming
language
Flowchart
A graphical representation of the sequence of operations in
an information system or program.
Usages
Information system flowcharts show
how data flows from source documents
through the computer to final
distribution to users.
Program flowcharts show the sequence
of instructions in a single program or
subroutine.
Different symbols are used to draw
each type of flowchart.