Programming Techniques and Tools

Intermediate and advanced programming concepts, tools, memory management, UNIX, and software engineering in C.

Undergraduate Compulsory Course
Instructor

Dr. Andreas Aristidou
Office: B113, FST01
Email: aristidou.andreas

Lab Instructor

Pavlos Antoniou
Office: B109, FST01
Email: antoniou.pavlos

Lectures

Tuesday & Friday
10:30 - 12:00

Labs

Monday
09:00 - 10:30, 10:30 - 12:00
12:00 - 13:30, 13:30 - 15:00

Course Overview

The course teaches intermediate and advanced programming concepts, techniques and tools through a language that compiles to machine code.

The course familiarizes the students with advanced programming constructs utilized for handling memory and files.

Advanced topics in compilation, debugging, documentation and optimization of software. Methodological aspects in developing large-scale system software that addresses complex problems.

Basic commands for programmers in the UNIX operating system.

Course Content

  • Introduction to C for Programmers: types x86/x64, loops, selections, expressions, arrays, functions, IO, basic program organization.
  • Advanced C programming constructs: program anatomy and processes, memory and addresses (pointers, pointers and arrays, strings and examples), structures, unions and enumerations. Linear and non-linear programming data structures (dynamic memory allocation, lists, queues, doubly-linked lists, trees, applications and examples).
  • Advanced Compilation Topics and Tools: preprocessor directives, compiling multiple files with makefiles, static (.a) and dynamic (.so) linking of object files (.o), error handling (assert.h), static and dynamic code analysis (valgrind and gprof).
  • Low-level programming (binary operators and examples, binary files and hexdump).
  • Basic commands for programmers in the UNIX operating system: file system, redirection and pipes, permissions and basic filters.
You can download the syllabus of the course here...

Course Schedule & Lectures

1. Introduction: Syllabus & Basics
C Fundamentals

Course objectives, syllabus, first C program, directives, functions, GCC compilation, native vs interpreted compilation and basic data types.

PDF
2. Fundamentals I: Formatted I/O, Expressions, Selection Statements, Loops
Expressions & Loops

printf(), scanf(), arithmetic operators, assignment operators, logical expressions, if/else, switch, while, do-while and for loops.

PDF
3. Fundamentals II: Basic Types, Arrays and Functions
Arrays & Functions

Integer, float and character types, overflow, casting, typedef, sizeof, one-dimensional and multidimensional arrays.

4. Program Organization
Files & Scope

Local variables, scope, organizing C programs, doxygen comments, fopen(), fread(), fwrite(), srand(), rand() and time().

PDF
5. Memory I: Pointers
Pointers

Pointer variables, addresses, indirection, pointer assignment, pointers as arguments and return values.

6. Memory II: Pointers and Arrays
Pointer Arithmetic

Pointer arithmetic, arrays processing, multidimensional arrays and memory access.

PDF
7. Memory III: Strings, Array of Pointers and Examples
Strings

String literals, strcpy(), strlen(), strcat(), strcmp() and command line arguments.

8. Memory IV: Structures, Unions and Enumerations
Structures

Structures, nested structures, unions, enumerations, memory alignment and packed structures.

PDF
9. Memory V: Dynamic Storage Allocation
Dynamic Memory

malloc(), calloc(), realloc(), free(), dangling pointers and dynamic allocation examples.

PDF
10. Program Structures I: Basic Linked-Lists, Pointer-to-Pointer and Stacks / Queues
Linked Lists

Linked lists, stacks, queues, pointer-to-pointer and multidimensional matrices.

11. Writing Large Programs
Multi-file Programs

Reverse Polish Notation examples, multiple source files, GCC and header files.

PDF
12. Writing Large Programs and the Preprocessor
Preprocessor

Header protection, makefiles, macros, #include and #define directives.

PDF
13. Program Structures II: Linked-Lists
Data Structures

Ordered linked lists, recursive functions and list traversal.

PDF
14. Program Structures III: Additional Linked-Lists Functions and Examples
Linked List Operations

insert(), delete(), eliminateDuplicates() and mergeLists().

PDF
15. Program Structures IV: Doubly-linked Lists
Doubly Linked Lists

Doubly-linked lists, circular lists and recursive implementations.

16. Tools I: Large-scale Software, Modules & Libraries, Testing
Software Engineering

Modules, abstract data types, assertions, testing, Valgrind and gprof.

PDF
17. Tools II: Team Development, SVN and Open Source Software Development
Version Control

SVN architecture, OSS licenses and software versioning systems.

PDF
18. Selected Topic I: Low-level Programming I
Bitwise Operations

Bitwise operators, bit masking and low-level programming basics.

PDF
19. Selected Topic II: Low-level Programming II
Low-level Programming

XOR encryption, bit fields and memory alignment.

20. Basic Unix System Commands
UNIX Basics

Directory handling, pipes, redirection and file manipulation commands.

PDF
21. Unix Commands and System Utilities I
UNIX Utilities

chmod, grep, regular expressions, ownership and permissions.

PDF
22. Unix Commands and System Utilities II
UNIX Process Management

jobs, ps, kill, find, diff, xargs and crontab utilities.

PDF

Lab Schedule

Week Topic Material
1 VSCode, GCC, GitHub, Moodle — Basic Programs & Fundamentals (operators, conditionals) Lab Files
2 Google Style Guide, Doxygen — Fundamentals with files, loops, functions and string.h Lab Files
3 Fundamentals with arrays and pointers Lab Files
4 Re-implementing string.h using pointers Lab Files
5 Dynamic allocation, structs, enums and unions Lab Files
6 Stacks and Queues — Josephus problem and balancing parentheses Lab Files
7 Multiple file organization and Makefiles Lab Files
8 Macros, conditional compilation and linked lists operations Lab Files
9 Dynamic code analysis with Valgrind and gprof Lab Files
10 Binary files, hexdump and low-level programming Lab Files
11 Unix Commands I Lab Files
12 Unix Commands II Lab Files

Resources