Why Class?
I really like Hadi's criticism of OO, and in fact I would like to hijack it and take it a few steps further, to paint what in my mind is a more realistic picture. Functional programming is only an alternative choice of paradigm. Expert programmers will use the best tool for the job and eschew the pointless search for the absolute best.Why OO? Classes exist to decouple behaviors from data. In fact, their purpose is to think in terms of cohesive sets of behaviors instead of data-driven functions.Does this apply to any possible case? No, it's a leaky abstraction.Why FP? Functions exist to decouple behavior from other behavior. In fact, their purpose is to think in terms of completely decoupled sets of behaviors instead of cohesive functions.Does this apply to any possible case? No, it's a leaky abstraction.Why AOP? Aspects exist to decouple behaviors that apply across classes. In fact, their purpose is to think in terms of orthogonal sets of behaviors instead of hierarchical sets of behaviors.Does this apply to any possible case? No, it's a leaky abstraction.Why Procedural Programming? To separate the functionality of the application in separate behaviors. In fact, the purpose of procedures is to think in terms of behaviors instead of sequences of operations.Does this apply to any possible case? No, it's a leaky abstraction.Why Declarative Programming? To express solutions in terms of goals instead of behaviors. In fact, its purpose is to think in terms of desired state, not sequences or compositions of behaviors.Does this apply to any possible case? No, it's a leaky abstraction.Why Logic Programming? To explore the logical consequences of given facts, instead of focusing on behaviors or desired outcomes. In fact, its purpose is to find new truths starting from given truths.Does this apply to any possible case? No, it's a leaky abstraction.Why spaghetti code? Wait, no that's just crap ;-)