Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
Programming

Is Object-Oriented Programming a Trillion Dollar Disaster? (medium.com) 782

Senior full-stack engineer Ilya Suzdalnitski recently published a lively 6,000-word essay calling object-oriented programming "a trillion dollar disaster." Precious time and brainpower are being spent thinking about "abstractions" and "design patterns" instead of solving real-world problems... Object-Oriented Programming (OOP) has been created with one goal in mind -- to manage the complexity of procedural codebases. In other words, it was supposed to improve code organization. There's no objective and open evidence that OOP is better than plain procedural programming... Instead of reducing complexity, it encourages promiscuous sharing of mutable state and introduces additional complexity with its numerous design patterns. OOP makes common development practices, like refactoring and testing, needlessly hard...

Using OOP is seemingly innocent in the short-term, especially on greenfield projects. But what are the long-term consequences of using OOP? OOP is a time bomb, set to explode sometime in the future when the codebase gets big enough. Projects get delayed, deadlines get missed, developers get burned-out, adding in new features becomes next to impossible. The organization labels the codebase as the "legacy codebase", and the development team plans a rewrite.... OOP provides developers too many tools and choices, without imposing the right kinds of limitations. Even though OOP promises to address modularity and improve reusability, it fails to deliver on its promises...

I'm not criticizing Alan Kay's OOP -- he is a genius. I wish OOP was implemented the way he designed it. I'm criticizing the modern Java/C# approach to OOP... I think that it is plain wrong that OOP is considered the de-facto standard for code organization by many people, including those in very senior technical positions. It is also wrong that many mainstream languages don't offer any other alternatives to code organization other than OOP.

The essay ultimately blames Java for the popularity of OOP, citing Alan Kay's comment that Java "is the most distressing thing to happen to computing since MS-DOS." It also quotes Linus Torvalds's observation that "limiting your project to C means that people don't screw things up with any idiotic 'object model'."

And it ultimately suggests Functional Programming as a superior alternative, making the following assertions about OOP:
  • "OOP code encourages the use of shared mutable state, which has been proven to be unsafe time and time again... [E]ncapsulation, in fact, is glorified global state."
  • "OOP typically requires a lot of boilerplate code (low signal-to-noise ratio)."
  • "Some might disagree, but OOP code is notoriously difficult to unit test... [R]efactoring OOP code is really hard without dedicated tools like Resharper."
  • "It is impossible to write good and maintainable Object-Oriented code."

Comment Green BANANA Crew Will Stop Everything (Score 1) 569

Build Absolutely Nothing Anywhere Near Anything (BANANA): Each Greeny has their pet solutions for the problem. And for each solution, there is a highly vocal group that will shout down the solution. The result is, every solution is shouted down and we get mired in our inertia. Hydro, wind, tidal, nuclear, solar, geo all have their detractors when the solutions are mentioned. Save the fish, the birds, the Oregon Orange Stinky Ground Owl. Meanwhile, we sit and idle waiting for someone to do something and blaming others for the problem. I'm done, build the nuclear power plants, install the infrastructure for fast electric charging, do it NOW.

Slashdot Top Deals

"No job too big; no fee too big!" -- Dr. Peter Venkman, "Ghost-busters"

Working...