Object-Oriented Programming | Encapsulation | Bundling data and methods operating on that data within objects; controlling access to internal details. | A Car object with speed (data) and accelerate() (method), where speed might be private. | |
Object-Oriented Programming | Abstraction | Hiding complex implementation details, showing only essential information. | A RemoteControl with a simple power() button, hiding the underlying electronics. | |
Object-Oriented Programming | Inheritance | A class inheriting properties and behaviors from a parent class, promoting code reuse. | Dog class inheriting from an Animal class, inheriting eat() method. | |
Object-Oriented Programming | Polymorphism | Objects responding to the same method call in their own specific way (compile-time and run-time). | Calling draw() on a Circle and a Square object, each drawing differently. | |
Object-Oriented Programming | Objects | Instances of classes, the fundamental building blocks of OOP, containing data and behavior. | my_car = Car() , my_dog = Dog() | |
Object-Oriented Programming | Classes | Blueprints for creating objects, defining their structure (attributes) and behavior (methods). | class Car: ... , class Animal: ... | |
Object-Oriented Programming | Association | A relationship between two separate classes indicating interaction. | A Student object having a Course object associated with it. | |
Object-Oriented Programming | Aggregation | A “has-a” relationship where the part can exist independently of the whole. | A Car object having an Engine object; the engine can exist separately. | |
Object-Oriented Programming | Composition | A strong “has-a” relationship where the part cannot exist independently of the whole. | A House object having a Room object; a room typically doesn’t exist independently. | |
Object-Oriented Programming | Messaging | Objects interacting by sending and receiving messages (method calls). | my_car.accelerate(10) (sending the accelerate message). | |
Related to OOP | Design Patterns | Reusable solutions to common software design problems. | The Singleton pattern ensuring only one instance of a class. | |
Related to OOP | SOLID Principles | Five design principles for creating more understandable, flexible, and maintainable software. | Single Responsibility: A class should have only one reason to change. | |
Related to OOP | UML (Unified Modeling Language) | A standardized visual modeling language for designing software systems. | Class diagrams, sequence diagrams. | |
Related to OOP | Aspect-Oriented Programming (AOP) | Separating cross-cutting concerns from core business logic. | Logging behavior applied to multiple methods without modifying them directly. | |
Related to OOP | Reactive Programming | A declarative paradigm focused on data streams and the propagation of change. | Libraries like RxJava or RxJS handling asynchronous events. | |
Related to OOP | Microservices | An architectural style structuring applications as collections of small, independent services. | A web application broken into separate user, product, and order services. | |
Related to OOP | Domain-Driven Design (DDD) | An approach focusing on understanding the business domain and modeling software accordingly. | Modeling a business process with entities like Customer , Order , Product . | |
Related to OOP | Frameworks | Collections of pre-written code providing structure for building applications. | Django (Python), Spring (Java), React (JavaScript). | |
Related to OOP | Testing (Unit, Integration, System) | Methodologies for ensuring the correctness of software. | Writing tests for individual methods (Unit ), interactions (Integration ), and the whole system (System ). | |
Metaprogramming | Reflection | Examining and modifying a program’s structure and behavior at runtime. | Discovering the methods of an object at runtime in Python using dir() . | |
Metaprogramming | Code Generation | Programmatically creating new code at runtime. | Using string formatting or template engines to create code. | |
Metaprogramming | Annotations/Decorators | Adding metadata or modifying behavior of code elements declaratively. | Python’s @staticmethod or @property decorators. | |
Metaprogramming | Abstract Syntax Trees (ASTs) | Tree-like representations of code structure for analysis and manipulation. | Libraries like ast in Python for parsing code. | |
Metaprogramming | Introspection | Determining the type or properties of an object at runtime. | Using type() or isinstance() in Python. | |
Metaprogramming | Domain-Specific Languages (DSLs) | Creating mini-languages tailored to specific problem domains. | SQL for database queries. | |
Metaprogramming | Macros | Code fragments replaced by larger pieces of code before compilation/runtime. | C/C++ #define directives. | |
Metaprogramming | Dynamic Class/Object Creation | Creating new classes or objects at runtime based on program logic. | Using type() to create classes dynamically in Python. | |
Related to Metaprogramming | Reflection-Oriented Programming | A programming style heavily relying on runtime reflection. | Frameworks that dynamically adapt based on configuration files. | |
Related to Metaprogramming | Source Code Analysis | Programmatically examining and understanding source code. | Linters (like Pylint) or static analysis tools. | |
Related to Metaprogramming | Template Engines | Libraries embedding code/logic in templates to generate dynamic output. | Jinja2 or Mustache for generating HTML. | |
Related to Metaprogramming | Build Systems | Tools automating the process of compiling, linking, and packaging software. | Make, CMake, Maven, Gradle. | |
Related to Metaprogramming | Static Analysis | Examining code without execution to find potential errors. | SonarQube, Checkstyle. | |
Related to Metaprogramming | Language Workbenches | IDEs for creating and working with domain-specific languages. | JetBrains MPS. | |
General Optimization Techniques | Algorithm Optimization | Choosing more efficient algorithms for tasks. | Using Merge Sort instead of Bubble Sort for large datasets. | |
General Optimization Techniques | Data Structure Optimization | Selecting appropriate data structures for efficient operations. | Using a set for fast membership checking. | |
General Optimization Techniques | Caching & Memoization | Storing and reusing results of expensive computations. | Using @functools.cache in Python. | |
General Optimization Techniques | Loop Optimization | Reducing overhead and improving efficiency of loops. | Moving constant calculations outside a loop. | |
General Optimization Techniques | Inline Expansion | Replacing function calls with function code to reduce overhead. | Compiler inlining small, frequently called functions. | |
General Optimization Techniques | Just-In-Time (JIT) Compilation | Compiling code to machine code during runtime. | Java Virtual Machine (JVM) performing JIT compilation. | |
General Optimization Techniques | Ahead-Of-Time (AOT) Compilation | Compiling code to machine code before runtime. | Compiling C++ code to a native executable. | |
General Optimization Techniques | Profiling | Analyzing program performance to identify bottlenecks. | Using tools like cProfile in Python or perf in Linux. | |
General Optimization Techniques | Concurrency and Parallelism | Utilizing multiple threads/processes for simultaneous task execution. | Using threads or multiprocessing to speed up computations. | |
General Optimization Techniques | Asynchronous Programming | Allowing a program to perform other tasks while waiting for long operations. | Using async and await in Python. | |
General Optimization Techniques | Lazy Evaluation | Delaying expression evaluation until the value is needed. | Python’s itertools or generator expressions. | |
General Optimization Techniques | Resource Management | Efficiently managing system resources (memory, files, network). | Using with open(...) as f: to automatically close files. | |
General Optimization Techniques | Code Profiling and Analysis Tools | Specific tools for measuring and understanding performance. | VisualVM, YourKit. | |
General Optimization Techniques | Database Optimization | Techniques to improve database query and operation performance. | Adding indexes to database tables. | |
General Optimization Techniques | Network Optimization | Reducing network latency and improving data transfer rates. | Using compression or caching for network requests. | |
General Optimization Techniques | Memory Management | Reducing memory consumption and avoiding leaks. | Properly dereferencing objects when no longer needed. | |
General Optimization Techniques | String Interning | Reusing identical string objects to reduce memory. | Python’s internal mechanism for string literals. | |
General Optimization Techniques | Bitwise Operations | Using bitwise operators for efficient integer data manipulation. | Using & , ` | , ^, <<, >>` for fast flag manipulation. |
Related to Optimization | Profiling Tools | Specific tools for measuring different aspects of program performance. | jstat , htop . | |
Related to Optimization | Benchmarking | Running controlled experiments to measure code performance. | Using libraries like timeit in Python. | |
Related to Optimization | Amdahl’s Law | Theory on the maximum speedup from parallelization. | Understanding that serial portions limit overall speedup. | |
Related to Optimization | Gustafson’s Law | Theory on how parallelizable work scales with processors. | Considering increasing problem size with more processors. | |
Related to Optimization | Trade-offs (Time vs. Space) | Understanding the balance between execution speed and memory usage. | Choosing between storing pre-calculated values (space) vs. recalculating (time). | |
Related to Optimization | Premature Optimization | Optimizing code too early without identifying actual bottlenecks. | ”Make it work, make it right, make it fast (if it’s not fast enough).” | |
Related to Optimization | Big O Notation | Describing the asymptotic complexity of algorithms. | O(n), O(log n), O(n^2). | |
Related to Optimization | Compiler Optimizations | Automatic performance improvements by compilers. | Loop unrolling, dead code elimination. | |
Related to Optimization | Hardware Considerations | Understanding how hardware affects program performance. | Cache locality, CPU pipelining. | |
Related to Optimization | Code Style and Readability | Writing clear code that is easier to understand and optimize. | Consistent naming conventions, clear comments. | |