60 likes | 173 Views
Object Oriented Programming. 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
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)