Browse OOP reference
Paradigms in practice

When is object-oriented programming the wrong choice?

On this page

When the dominant operation is a uniform transformation over many records, per-record objects can obscure the algorithm and introduce needless allocation. An array operation over a million samples may be clearer. Measure with a representative workload and consider keeping object boundaries around resources and policy.

Worked example

Python
readings_mv = [90, 105, 115, 80]
threshold_mv = 100
excess = [reading - threshold_mv for reading in readings_mv
          if reading > threshold_mv]
assert excess == [5, 15]

Python Functional Programming HOWTO

Explore class relationships in the OOP Playground

How does functional programming compare with OOP?What is object-oriented programming?What are object-oriented databases?

All OOP questions

Search ObjectFAQ