r/programming • • May 28 '14

"Compression-oriented programming" - Casey Muratori's blog

http://mollyrocket.com/casey/stream_0019.html
125 Upvotes

67 comments sorted by

View all comments

5

u/archagon May 28 '14 edited May 28 '14

I wish I could read this article with a clear mind, but the author's stance is just so... bloody arrogant that I have a hard time doing it. How can you say that object orientation is "objectively bad" when most of the best software in the world is written using object-oriented principles? I dunno — maybe the decades of research starting all the way from Smalltalk have actually been conducted by very intelligent computer scientists who knew what they were talking about? In my experience, it seems that it's mostly old-school programmers in their 40s who prefer the described imperative approach. Given the absolute cornucopia of fascinating new programming paradigms out there today, I feel that they're a bit stuck in the past.

Additionally, I know of literally zero programmers who write things out on index cards and create rigid Employee/Manager/Contractor-like hierarchies.

(With that said, enough smart people have complained about OO that I'm willing to give it more thought.)

9

u/ProvokedGaming May 28 '14

Of course the author is taking things to the extreme to show his point, but that doesn't mean his point is invalid, or that these issues aren't real. I've seen a plethora of horrible code over the years in the enterprise...code you wouldn't even believe that came from "professional" developers from big name companies (IBM and AMD as my most recent examples)...I've had the great displeasure of going through code (usually in Java) that has come out of Indian and Chinese "code shops" where 10$ an hour developers crank out code for the enterprise which is absolutely OOP to the extreme. I've had management at various client offices try to do "agile" by pre-defining everything through requirements documents turned into code objects which are heavily abstracted. And these are all multi-billion dollar corporations. I've been tempted to start a blog just to show examples of what not to do that I find on a daily/weekly basis at large enterprises in their software. The point is, there are pros and cons to most programming techniques, and all of them can be abused. Less experienced developers (or experienced shitty developers) are given tools without an understanding of when they are appropriate. OO is a tool, and as the saying goes...when you're holding a hammer, every problem looks like a nail. Not every code problem is best solved with objects. :)

3

u/vattenpuss May 29 '14

But he's not describing object oriented design. The point is invalid.

My job is developing and maintaining a payroll system in Smalltalk, does it get any more object oriented?

We have a Person class. Whether they are a manager or a contractor is decided by a has-a relation inside the Employment the Person has.

All customers have different types of employees, it's not something we can know beforehand so it would just be silly of us to create a class hierarchy over those things. Also, anybody starting to create that tree of classes would soon see they are being stupid when they realise they will have hundreds of leaf classes with no meaningful difference.