0% found this document useful (0 votes)
5 views36 pages

Lecture 1

Uploaded by

zikangding92
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views36 pages

Lecture 1

Uploaded by

zikangding92
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Object-Oriented Technology

Lecture 01

Hongbo Liu

University of Electronic Science and Technology of China


Computers
Computer = CPU + memory

+
How to interact with computers effectively?
Programming Language
Express processor instructions in human understandable way

This course targets C++ language


C++ Advantages
Conciseness Full Equation C++ Shorthands
• C++ provides powerful shorthands x = x - 10 x -= 10
x=x*3 x *= 3
Maintainability
• C++ is object oriented

Portability
• C++ can be used to write programs for nearly any processor
C++ Advantages (cont’d)
High performance

Picture from
https://attractivechaos.github.io/plb/
C++ Advantages (cont’d)
High performance

Picture from
https://attractivechaos.github.io/plb/
C++ History

From “Introduction to C++”


by Microsoft
Materials
Online material
Reference books:
• The C Programming Language, by K & R
• The C++ Programming Language, by B. Stroustrop
• Useful resources from B. Stroustrop’s homepage

Suggestion: practice, practice, and practice


Course Schedule
Contents #Classes
Introduction 2
C Basics Basics 2
In-class practice 3
Functions 3
Pointers 4
Advanced C
In-class practice 4
Classes 4
C++ Individual Inheritance & Polymorphism 4
In-class practice 4
Features
Emphasize practice!!!
Overall Score
60% in usual vs. 40% in final project
Usual performance:
• Attendance
• In-class practices
• Homework
• Self-learning results

Self-learning course: The Missing Semester of Your CS Education


Configuration
Linux setup
• Linux distribution (Ubuntu) download & install from USTC source (high
download speed in China)

Windows setup
• Requirement: Windows 10
• Activate WSL following instruction
Terminal
Terminal

How to communicate with


terminal?
Command Line Basics

from Briana
Vim Introduction
Most famous editor must be learnt for Linux programming
• Have a plenty of shortcuts

Installation & configuration


sudo apt-get install vim
git clone –depth=1 https://github.com/amix/vimrc.git
~/.vim_runtime
sh ~/.vim_runtime/install_basic_vimrc.sh
Vim Tutorial
Start: vim [filename]
Normal, insert and visual modes
• Normal: command line manipulation
• Insert: text edit
• Visual: text selection for copy/paste

vimtutor
• 25-30 minutes tutorial for basics of vim
Vim Tuitorial (cont’d)
Vim Tuitorial (cont’d)
A series of graphical cheat sheet-based tutorial from viemu
A series of graphical cheat sheet-based tutorial from viemu
A series of graphical cheat sheet-based tutorial from viemu
A series of graphical cheat sheet-based tutorial from viemu
A series of graphical cheat sheet-based tutorial from viemu
A series of graphical cheat sheet-based tutorial from viemu
A series of graphical cheat sheet-based tutorial from viemu
Compiler & Linker
Transfer sources to executable files

• Compiler: turning code into object files


• Linker: linking object files together into executable form

Compilation in Linux: g++ {sources} –o {executable}


Compiler & Linker (cont’d)

From “Introduction to C++”


by Microsoft
First Program

L1: locate file that contains code for library


• iostream is for input/output

L3: entry point of program


• No arguments
• Return integer
First Program (cont’d)

L4: standard output function


• member of std namespace

L5: indicate successful execution


C++ Statements
Preprocess directive
• Execute operations prior to compilation

Comments
• // … or /* … */
• … are omitted by compilers

Declaration & assignments & executable statements


• End with ;
Summary
Linux command line
Vim editor
Linux compiler
“Hello World” program
Homework
Watching video for Linux command line
Watching video (2 parts) for vim basics
Practice vimtutor
Self-learning presentation: Editors(vim)

You might also like