Objects are a form of Superstition

by moodyharsh

Object superstition

“Object-oriented programming is an exceptionally bad idea which could only have originated in California” - Dijkstra

How did rational programmers get invested in overly simplistic “californian” ideas like - everything is an object - everything is natural and is made of like energy and positive stuff man ? Why do OO and FP seem like religious cults ?

A company X and a priest Y will announce a Framework Z. After 5 years the company will ditch Z1, Z2, Z3 and use W. You did not use OOAD DDD DI MVC MVP MVVM properly, The Horror! The Shame!

Everything is made of water, air, ether and fire. These superstitions have been held for more than 2000 years. It has been 50 years since object hysteria has started. Everything is an object is a nonsensical statement. Thing and object are synonyms. So Everyobject is an object and everything is also made of objects. How about waves and streams ?

The actual statement OO practioners are making is - everything ought to be an object because it increases code maitenance. We have lost entire generations of programmers rewriting code from Struts to Spring to Backbone to Angular to Angular 3 to React to React 15 to Typescript and now to webassembly, so how exactly is software being maintained better and reused when it is being re-written for every new release of the same framework ? How can we have a hundred MVC frameworks for every language with no code reuse between any of them ? Why are microservices better at reuse even though it is basically procedural code with RPC ?

Prior to the germ theory of medicine, all diseases were said to be the result of an imbalance of humors, or dyscrasia. Health is balance of humors, or eucrasia. A similar claim is made about the use of objects, namely without continously balancing them code becomes spaghetti code. This is nothing but superstition. When are we going to stop telling this fairy tale ? Could it be that singular and totalitarian epistemologies when applied mindlessly only leads to spaghetti code ? What exactly is maintenace, is it some code afterlife ?

A simple dictionary can better model object containers. You don’t need objects, meta objects. Merge and Copy are better primitives than Inheritance. If you don’t know what a vtable is, you shouldn’t be using objects anyway. The success of Java is not because of OO but because of garbage collection. Test cases, not FP or OO have visibly increased the quality of many code bases . The biggest ongoing software crisis is C’s memory management - safety is absolutely more important than speed. What actually gave us reuse was CPAN/Gems/NPM. What Java gave us was underdeveloped and overhyped software and it probably caused the first software bubble. The so software crisis of 70s was not because of overuse of goto’s but the tendency of mangers to think that 9 women can deliver a baby in 1 month. Not only have objects not delivered on the vague promises of code reuse, they use twice the memory of plain structs and are 3 times slower than functions on averge and are contributing to ongoing software obesity epidemic.

Hostility to criticism is one of the major features of pseudoscience. If observation shows that the predicted effect is definitely absent, then the theory is simply refuted. Blind commitment to a theory is not an intellectual virtue: it is an intellectual crime. How do you know that your intervention works? What is your evidence?

While we are at it … let us burst another myth. Code is not data. Code is an interperation of data