Professional Documents
Culture Documents
Techniques
Chapter 1: Introduction
Lecturer: Dr. Hoang Duc Chinh (Hoàng Đức Chính)
Department of Automation Engineering
School of Electrical and Electronics Engineering
Email: chinh.hoangduc@hust.edu.vn
© HĐC 2022.1
Content
1.1. Course Description
1.2. Introduction of programming technique
1.3. Programming Paradigms
1.4. Software development process
1.5. Fundamentals of C/C++ languages
1.6. Getting started
Interchangeability
Structured programming,
Modular Programming &
Information Hiding
Pascal, Algo 68 Programs run faster
Assembler, Autocodes, 1st New languages support parallel
version of Fortran computing
Iterative method
int kq = 1;
while (N > 1)
kq *= N--;
return kq;
Chapter 1: Introduction © HĐC 2022.1 22
How to program well?
Learn the way of thinking and programming methodologies
Mathematical thinking, logical thinking, structure thinking, OOP thinking
and generic thinking
Exploring data structures and algorithms
Understand the computer
Interaction amongst CPU, Programs and Memory
Memory management
Mastering the programming language
Understand the strengths and limits of the language
Programming skill
Self-practicing
Understand the above aspects
Learn from professional developers’ codes (but do not copy blindly)
Keep practicing and be creative
“Keep it simple :
as simple as possible,
but no simpler”
- Albert Einstein
// return output y
Analysis Coding
Testing
Object-oriented
design
Two approaches
Structure design, or
top-down design
Break the
system into
procedures
to solve Starting with
problems general then
detailed design
Logic error
would cause unexpected
Desk check
Developer uses testing data results
to verify the program
Structured walkthrough
Test data Developer describes algorithm
is similar to actual data while the programming team
which should be validate program logic
processed by the program
Compiler
Compiled
code
Linker Library
Executable
program
Deploy &
Execute
Chapter 1: Introduction © HĐC 2022.1 59
Developing tools / environment
IDE (Integrated Development Environment)
Support the whole process of programming
E.g.: MS Visual Studio, Borland C++ (Builder), Keil-C
Tools
Editor
Compiler
Linker
Loader
Debugger
Project manager
https://spectrum.ieee.org/top-programming-languages-2021
Chapter 1: Introduction © HĐC 2022.1
https://spectrum.ieee.org/top-programming-languages-2022 66
“C makes it easy to shoot
yourself in the foot;
C++ makes it harder, but
when you do it blows your
whole leg off.”
― Bjarne Stroustrup
Chapter 1: Introduction © HĐC 2022.1 67
1.6 Getting started
Windows:
Install Visual Studio Code (VS Code)
https://code.visualstudio.com/download
Install C++ extension for VS Code
Install MinGW-w64 (https://sourceforge.net/projects/mingw-w64/)
in a folder with simple path, i.e.: C\mingw64
Set Mingw64\bin in Windows Environment Variables
Linux:
gcc or g++ may be installed by default, otherwise install it:
sudo apt-get update
sudo apt-get install build-essential gdb
MacOS: Use Clang for compiling
Check if Clang is install: clang --version
Install it: xcode-select --install