- ES Español

- EN English

5.8. Objects-oriented programming I (Mandatory)
- Semester: 2nd Sem. Credits: 4
- Hour of this course: Theory: 2 hours; Laboratory: 4 hours;
- Syllabus:
- htmlonly

Español

English - Prerrequisites:
- BIC01 Introduction to Computing (1st Sem) itemize
5.8.1. Justification ↑ Back to top
This is the second course in the introductory Computer Science programming sequence. It incorporates a programming language transition as a pedagogical strategy and focuses on core Object-Oriented Programming (OOP) concepts in C++17/C++20, expanding on the foundations from the first course while introducing low-level programming concepts. The course provides a solid foundation for advanced topics covered in the subsequent course of the curriculum.
5.8.2. Generales Goals ↑ Back to top
- Introduce the student to the foundations of the object orientation paradigm in C++
- Develop skills in C++17/C++20 programming including templates and STL
- Understand memory management and low-level programming concepts
- Develop problem-solving skills using OOP principles
- Master intermediate C++ programming techniques
5.8.3. Contribution to Outcomes ↑ Back to top
- AG-C09) Design and Development of Solutions: Designs, implements, and evaluates solutions for complex computing problems. (Usage)
- AG-C12) Applies computer science theory and software development fundamentals to produce computer-based solutions. (Usage)
5.8.4. Content ↑ Back to top
5.8.4.1. Language Pragmatics (2 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Josuttis, 2019)
Topics
- Problem domains and programming paradigm
- Criteria for good programming language design:
- Principles of language design such as orthogonality
- Defining control and iteration constructs
- Modularization of large software enumerate
- Brief review of programming paradigms
- Comparison between functional and imperative programming
- History of programming languages (emphasis on C and C++)
Learning Outcomes
- Discuss the historical context of programming language paradigms [Familiarity].
- Evaluate language design trade-offs for specific applications [Assessment].
5.8.4.2. Language Translation and Execution (4 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Deitel and Deitel, 2017)
Topics
- Execution models for JIT (Just-In-Time), compiler, interpreter
- Use of intermediate code, e.g., bytecode
- Execution as native code or within a virtual machine
- Virtual machines and intermediate languages
- Compilation vs. interpretation models
Learning Outcomes
- Explain and understand the differences between compiled, JIT, and interpreted language implementations, including the benefits and limitations of each [Familiarity]
- Differentiate syntax and parsing from semantics and evaluation [Usage]
- Illustrate ambiguity in parsing using nested if-then-else/arithmetic expression and show resolution using precedence order [Assessment]
5.8.4.3. Type Systems Fundamentals (8 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Josuttis, 2019)
Topics
- A type as a set of values together with a set of operations:
- Primitive types (e.g., numbers, Booleans)
- Compound types built from other types (e.g., records/structs, unions, arrays, lists, functions, references using set operations) enumerate
- Generic types (parametric polymorphism):
- Definition and advantages of polymorphism: parametric, subtyping, overloading, and coercion
- Comparison of monomorphic and polymorphic types
- Comparison with ad-hoc polymorphism (overloading) and subtype polymorphism
- Generic parameters and typing
- Use of generic libraries such as collections
- Comparison with ad hoc polymorphism (overloading) and subtype polymorphism
- Prescriptive vs descriptive polymorphism
- Implementation models of polymorphic types
- Subtyping enumerate
- Declaration models (linking, visibility, scope, lifetime)
- Overview of type checking in C++
- Type conversion and casting in C++
Learning Outcomes
- Define and use program pieces (such as functions, classes, methods) that use generic types, including for collections [Usage]
- Discuss the differences among generics, subtyping, and overloading [Familiarity]
- Explain multiple benefits and limitations of static typing in writing, maintaining, and debugging software [Assessment]
5.8.4.4. Object-Oriented Programming Fundamentals (14 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Josuttis, 2019)
Topics
- Definition of classes: fields, methods, and constructors.
- Subclasses, inheritance (including multiple inheritance), and method overriding.
- Dynamic dispatch: definition of method-call.
- Subtyping:
- Subtype polymorphism; implicit upcasts in typed languages.
- Notion of behavioral replacement: subtypes acting like supertype.
- Relationship between subtyping and inheritance. enumerate
- Classes and objects in C++
- Constructors and destructors
- Access specifiers and encapsulation
- Inheritance hierarchies
- Polymorphism and virtual functions
Learning Outcomes
- Compose a class through design, implementation, and testing to meet behavioral requirements [Usage]
- Build a simple class hierarchy utilizing subclassing that allows code to be reused for distinct subclasses [Usage]
- Predict and validate control flow in a program using dynamic dispatch [Assessment]
- Design C++ classes with proper encapsulation [Usage].
- Implement inheritance hierarchies for code reuse [Usage].
5.8.4.5. Systems Execution and Memory Model (12 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Deitel and Deitel, 2017)
Topics
- Direct, indirect, and indexed access to memory location
- Run-time representation of data abstractions such as variables, arrays, vectors, records, pointer-based data elements such as linked-lists and trees, and objects
- Low level allocation and accessing of high-level data structures such as basic data types, n-dimensional array, vector, record, and objects
- Return from procedure as automatic deallocation mechanism for local data elements in the stack
- Manual memory management: allocating, de-allocating, and reusing heap memory
- Automated memory management: garbage collection as an automated technique using the notion of reachability
- Memory layout (stack, heap, static)
- Pointer arithmetic and operations
- Dynamic memory allocation (new/delete)
- Memory leaks and dangling pointers
- Smart pointers (unique_ptr, shared_ptr)
Learning Outcomes
- Explain why memory leaks and dangling pointer problems occur, and what can be done by a programmer to avoid/fix them [Usage]
- Explain how programming language implementations typically organize memory into global data, text, heap, and stack sections and how features such as recursion and memory management map to this memory model [Assessment]
- Explain how a core language construct, such as data abstractions and control abstractions, is executed [Assessment]
- Implement RAII for resource management [Usage].
- Debug memory-related errors in C++ programs [Usage].
5.8.4.6. Functional Programming (10 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Josuttis, 2019)
Topics
- Lambda expressions and evaluation:
- Variable binding and scope rules.
- Parameter-passing.
- Nested lambda expressions and reduction order. enumerate
- Using higher-order functions (taking, returning, and storing functions).
- Function templates and class templates
- Template specialization
- Lambda expressions in C++11/14
- Standard Template Library concepts
Learning Outcomes
- Develop useful functions that take and return other functions [Usage]
- Correctly interpret variables and lexical scope in a program using function closures [Assessment]
- Use functional encapsulation mechanisms such as closures and modular interfaces [Usage]
- Implement generic functions using templates [Usage].
- Use lambda expressions for functional programming [Usage].
5.8.4.7. Object-Oriented Programming: Encapsulation, Subtyping, and Reflection (8 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Josuttis, 2019)
Topics
- Collection classes, iterators, and other common library components.
- Sequence containers (vector, list, deque)
- Associative containers (set, map, unordered_set)
- Container adapters (stack, queue, priority_queue)
- Iterators and algorithms
- Functors and predicates
Learning Outcomes
- Use collection classes and iterators effectively to solve a problem [Usage]
- Define and use iterators and other operations on aggregates, including operations that take functions as arguments, in multiple programming languages, selecting the most natural idioms for each language [Usage]
- Compare and contrast mechanisms to define and protect data elements within procedural, functional, and object-oriented approaches [Assessment]
- Select appropriate STL containers for specific needs [Usage].
5.8.4.8. Advanced Programming Constructs (6 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Stroustrup, 2013; Josuttis, 2019)
Topics
- Object-oriented abstractions: multiple inheritance, mixins, traits, multimethods
- Metaprogramming: macros, generative programming, model-based development
- Operator overloading
- Move semantics and rvalue references
- Exception handling in C++
- Namespaces and modular programming
Learning Outcomes
- Use various advanced programming constructs and idioms correctly [Usage]
- Discuss how various advanced programming constructs aim to improve program structure, software quality, and programmer productivity [Assessment]
- Discuss how various advanced programming constructs interact with the definition and implementation of other language features [Familiarity]
- Implement move semantics for performance optimization [Usage].
5.8.4.9. Shell Scripting (4 hours) [Skills AG-C09,AG-C12] ↑ Back to top
Bibliography: (Robbins and Beebe, 2005)
Topics
- System commands:
- Interface with operating systems enumerate
- Piping
- File abstraction and operators
- Programs and processes
- Automating compilation and testing of C++ programs through scripts (Makefiles, build/test scripts)
Learning Outcomes
- Create and execute automated scripts to manage various system tasks [Usage]
5.8.5. Bibliography ↑ Back to top
Stroustrup, B. (2013). The C++ Programming Language. Addison-Wesley Professional, Upper Saddle River, NJ, 4th edition.
Josuttis, N. M. (2019). C++17: The Complete Guide. Pearson Education, Indianapolis, IN, 1st edition.
Deitel, H. and Deitel, P. (2017). C++17: The Complete Guide. Pearson, Boston, MA, 10th edition.
Robbins, A. and Beebe, N. H. (2005). Classic Shell Scripting. O'Reilly Media, Sebastopol, CA, 1st edition.