The Future of Object-Oriented Programming
COMP2511
OOP: A Mixed Perspective
- A widely used paradigm of development
- It's great in theory (as we've learned!)
- Abstraction & Encapsulationncapsulation
- Inheritance & Polymorphism
- But what about in the real world?
- OOP: The Trillion Dollar Disaster and Why We Need to Move on
https://betterprogramming.pub/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7
Software Complexity Revisited
- No Silver Bullet
- Essential Complexity: Essential to the problem
- Accidental Complexity: Not essential to the problem
- Aim of OOP: Reduce software complexity through delegation of responsibility and abstraction
- But does it?
Problem 1: Shared Mutable State
- Multiple objects 'haggling' over control of state
- Encapsulations aren't a sure way of ensuring safety of data - anyone can still mutate it.
- All objects are just pointers
- Example: Getters for ArrayLists
- Parallelism and concurrency is very difficult with shared mutable state
Problem 2: Not everything is an object
- "Everything is an object" - but is it?
- Sometimes behaviours are just behaviours
- Multiply - we don't need a class to multiply two numbers, just a function
Problem 3: Boilerplate Code
- How much of our code is just overhead rather than the actual problem logic?
- Example: Blackout Assignment
- Is this overhead accidental or essential?
- A lot of our code is 'glue' that liaises between objects
- How much time do we spend on boilerplate rather than actually solving problems?
In a Nutshell
Design Patterns and Complexity
- "Design Patterns are just a cover-up for missing language features"
- Decorator Pattern - why doesn't Java just have decorators?
- Mis-application of design patterns increases software complexity
- But can we use patterns in a way that makes our software better?
- Some problems are essential (e.g. Composite Pattern)
OOP Languages
-
Java
- Easier to work with than C
- Built-in garbage collection
- Friendly-named APIs
- GUI Programming & JavaFX
- Portability
- Exception Handling
- C# - Microsoft's "Better Java"
- Non OO Languages with Objects
- C++
- Python
Why 2511 at all then?
- Practical
- OOP is widespread (good or bad)
-
Design Thinking
- How do we realise and model a problem domain in software?
- How do we make our software beautiful and intuitive?
- How do we make our software adaptable and extensible to evolutions in requirements?
- How do we use the wisdom of the past to solve problems? (Design Patterns)
Where next?
- Courses with this as a prerequisite
- COMP3131: Programming Languages & Compilers
- COMP6771: Advanced C++ Programming
- COMP3421: Computer Graphics
- COMP4511: User Interface Design & Construction
The Future of Object-Oriented Programming
By npatrikeos
The Future of Object-Oriented Programming
- 934