Professional Documents
Culture Documents
Chapter 1.
Computer Programming Language
A computer programming language is a formal language comprising a set of
instructions that produce various kinds of output. It is used to communicate instructions
to a computer in order to perform specific tasks, such as data manipulation, algorithm
implementation, and application development. Programming languages provide a
structured way to express algorithms and logic, enabling programmers to create
software, scripts, or applications for a wide range of purposes. These languages
typically consist of syntax rules, keywords, data types, control structures, and libraries
that programmers use to write code and interact with computer systems effectively.
Programming languages enable humans to communicate with computers in a way that
they can understand and execute.
Learning a programming language offers numerous benefits and reasons why it's
worth the investment of time and effort. Here are some key reasons why learning a
programming language is valuable:
Chapter 2.
History of Programming Language
Programming languages are formal languages used to communicate
instructions to a computer. They provide a structured and systematic way to write
code that can be executed by a computer to perform specific tasks or solve problems.
Programming languages allow programmers to express algorithms, logic, and data
manipulation in a human-readable format, which is then translated into machine-
readable instructions by a compiler or interpreter.
In essence, programming languages serve as a bridge between human
thought and machine execution, enabling programmers to write software that
instructs computers on how to perform various operations, from simple arithmetic
calculations to complex data analysis and system control. These languages vary in
syntax, semantics, and features, catering to different programming paradigms, such
as imperative, declarative, functional, and object-oriented programming. Some
common programming languages include Python, Java, C++, JavaScript, and Ruby,
among many others.
The history of programming languages is a rich and complex subject that
spans several decades and involves numerous contributors, innovations, and
developments. Here, will be provided a comprehensive overview of the history of
programming languages, divided into key stages and highlighting significant
languages and advancements along the way.
1. Pre-20th Century
The concept of programming languages can be traced back to the 19th century,
with the development of mechanical calculating machines such as Charles
Babbage's Analytical Engine.
Ada Lovelace, often considered the world's first programmer, wrote algorithms
for Babbage's Analytical Engine in the mid-19th century.
2. 1940 - Early 1950
The first electronic computers were developed during and after World War II,
leading to the need for programming languages to operate these machines
efficiently.
In the 1940, assembly languages, such as Assembly for the ENIAC, were
developed to provide a more human-readable representation of machine code.
The short-lived Plankalkül, developed by Konrad Zuse in the late 1940, is
considered one of the earliest high-level programming languages.
3. 1950 - 1960
6. 21st Century
The 21st century has seen the continued evolution of programming languages
and the emergence of new trends and paradigms:
a. Swift (2014): Developed by Apple for iOS and macOS app development,
Swift replaced Objective-C as the primary language for Apple platform
development.
b. Rust (2010): Developed by Mozilla, Rust gained attention for its emphasis
on safety and performance, particularly in system programming contexts.
c. Go (2009): Developed by Google, Go became popular for its simplicity and
efficiency, particularly in concurrent programming.
d. Kotlin (2011): Developed by JetBrains, Kotlin gained traction as a modern
language for Android app development, eventually becoming an official
language for Android development alongside Java.
Answer: C) Rust
13. What programming language became popular for its simplicity and efficiency,
particularly in concurrent programming?
A) Swift
B) Kotlin
C) Rust
D) Go
Answer: D) Go
14. Who developed the programming language Kotlin?
A) Google
B) JetBrains
C) Mozilla
D) Apple
Answer: B) JetBrains
15. Which of the following is an official language for Android development alongside
Java?
A) Swift
B) Kotlin
C) Rust
D) Go
Answer: B) Kotlin
16. Which language gained traction as a modern language for Android app
development?
A) Swift
B) Kotlin
C) Rust
D) Go
Answer: B) Kotlin
17. What was the primary purpose of the Plankalkül programming language?
A) Scientific computing
B) Business data processing
C) Teaching programming
D) Artificial intelligence
Answer: C) Teaching programming
18. What was the primary purpose of the ALGOL programming language?
A) Scientific computing
B) Business data processing
C) Artificial intelligence
D) Teaching programming
Chapter 3.
Syntax and Semantic
3.1 Syntax
Syntax in programming languages refers to the set of rules that define the
combinations of symbols, keywords, and characters that form valid statements and
expressions within the language. It governs how programs are written and
structured, ensuring that the code is understandable and interpretable by both
humans and computers. Syntax encompasses elements such as variable declarations,
control structures, data types, and function definitions.
Here are some key aspects of syntax in programming languages
a. Keywords: These are reserved words that have special meanings in the
language and cannot be used as identifiers (e.g., variable names). Examples
include `if`, `else`, `for`, `while`, `int`, `float`, etc.
b. Identifiers: These are names given to various program elements such as
variables, functions, classes, etc. Identifiers must adhere to certain rules
regarding character usage, such as starting with a letter or underscore, and
can contain letters, digits, and underscores. Examples:
- Variable names: int age, double salary, String name.
- Function names: void calculateSalary(), int add(int a, int b).
- Class names: class MyClass, interface MyInterface.
- Object names: MyClass obj, MyInterface obj.
c. Operators: These symbols represent operations to be performed on operands,
such as arithmetic operators (`+`, `-`, `*`, `/`), comparison operators (`==`,
`!=`, `<`, `>`), logical operators (`&&`, `||`, `!`), etc.
d. Punctuation: Punctuation symbols like parentheses `()`, braces `{}`, brackets
`[]`, commas `,`, semicolons `;`, and periods `.` are used to define the
structure of code, such as grouping expressions, delineating blocks of code,
separating elements, and terminating statements.
e. Comments: In programming languages, a comment is a piece of text that is
ignored by the compiler or interpreter and is intended solely for human
readers. Comments are used to annotate code, providing explanations,
clarifications, or notes about the purpose, functionality, or behavior of the code.
They are essential for improving code readability, understanding, and
maintenance. Comments are typically indicated by special symbols or
keywords specified by the programming language, and they can appear inline
3.2 Semantic
In the context of programming languages, "semantic" refers to the meaning or
interpretation of the code, as opposed to its syntax, which is concerned with its
structure and grammar. The semantics of a programming language define how
statements and expressions are executed and how they interact with each other and
the underlying system.