60 likes | 185 Vues
Explore the fundamentals of Object-Oriented Programming (OOP) and Procedural Programming (PP). OOP features encapsulation, inheritance, and polymorphism, promoting code reusability and maintenance but can lead to increased complexity and memory usage. Meanwhile, PP offers fast execution and low memory consumption but suffers from challenges like large function libraries and code maintainability. Dive into essential programming terminology to enhance your coding skills and understand the trade-offs between these two popular programming paradigms.
E N D
Procedural Programming • Pros • Main control code block that calls functions • Custom functions written to solve each problem • Any data can be passed into any function • Fast • Low memory usage
Procedural Programming • Cons • Function libraries can get very large • You cannot reuse functions for other problems without reworking them • Data can be changed inadvertently • The code is difficult to maintain • Changes to a function can introduce bugs in other sections of code
Object Oriented Programming • Cons • More complicated design • Uses more memory • Code can be slower to run
Terms to know • Object • A unit containing data and functions to operate on that data • Class • Defines what data and functions an object will have
More Terms (the pros) • Abstraction • Hides the data inside the class, and provides controlled access through functions • Encapsulation • Having data and functions together in the same object • Inheritance • Reusability, lets you make small changes to classes easily • Polymorphism • Using the same function for different types of data (overloading)