Intro to OOP Flashcards
First OOP Language, introduced
object-oriented programming concepts
such as object, class,
etc.
SIMULA (Simulation Language)
Creators: Ole-Johann Dahl and Kristen Nygaard
Fathers of Object Technology
led a team that developed
Smalltalk at Xerox PARC
- inspired by Simula,
- Coined the term “Object
Oriented Programming”
Alan Kay
implemented “C with Classes” aka C++ - Became the most widely used OOP language
Bjarne Stroustrup
developed Java (former name is Oak)
- Simplified C++
James Gosling
4 Approaches to Software Development
Top-Down Programming
Bottom-Up Programming
Modular Programming
Structured Programming
the programmer decides what major actions the program
must take
rather than worry about the details of how it is done, the
programmer defines a function that will handle that
later
Top-Down Programming
starts by defining a simple function that might be useful in
solving a more complex problem
Bottom-Up Programming
4 Main Python Coding Styles
Imperative
Functional
Object-oriented
Procedural
Like math: treats everything like a math equation
Make use of higher-order functions for data manipulation
Functional Style
focus is on how a program operates. Changes the state information as needed in order to achieve a goal
Imperative Style
What Coding style does this code snippet exemplify:
sum = 0
for x in my_list:
sum += x
print(sum)
Imperative Style
coding is all about increasing an application’s ability to reuse code and make it easier to understand
Object-Oriented Programming
What Coding style does this code snippet exemplify:
class ChangeList(object):
def __init__(self, any_list):
self.any_list = any_list
def do_add(self):
self.sum = sum(self.any_list)
create_sum = ChangeList(my_list)
create_sum.do_add()
print(create_sum.sum)
Object Oriented Programming
The __________________ relies on procedure calls to create modularized code. This approach simplifies your application code by breaking it into small pieces that a developer can view easily.
Procedural Style
POP vs OOP
Program Subparts: Functions
Procedural Oriented Programming
POP vs OOP
Program Subparts: Objects
OOP
POP vs OOP
Prioritizes functions as well as sequence
of actions to be done
POP
POP vs OOP
Prioritizes data
OOP
POP vs OOP
Top-down Approach
POP
POP vs OOP
Bottom Up Approach
OOP
POP vs OOP
No access modifiers
POP
POP vs OOP
Has access modifiers (ie. public, private, protected, default)
OOP
POP vs OOP
Data can move freely
from function to
function in the system
POP
POP vs OOP
Objects can move and communicate
with each other through member
functions
OOP