Live data from Hacker News

Object Oriented Programming has Failed Us

blog.dmbcllc.com

41–49 of 49 posts

Re: Object Oriented Programming has Failed Us

#41
I find it very hard to agree with thesis when there is absolutely no backing information about how OO programming is "hard". What are the difficulties people are having with OO? How can I take this article seriously when it's nothing more than a statement followed by some fluff followed by a few half-thought suggestions. Who are these 'people these people who 'really understand' OO programming?

Am I one of them?

Are you?

How are we to know with no example of HOW OO is hard? What exactly is so hard about it? Class Apple extends Fruit. apple = new Apple(). apple.eat(). Makes sense to me. How are people using it wrong? Is the real issue that people don't understand when to use it?

Here's a similar article:

Playing poker is hard. A lot of people really don't understand how to play poker. People that play poker should stop, and start playing go fish. They should leave poker to the professionals that understand poker. All poker books should now become go fish books.

Re: Object Oriented Programming has Failed Us

#42

Earlier quoted context omitted.

We've also got a strong contingent of anti-MS ranters. I've been having to work in MFC recently for a client, and boy... If you ever needed a reminder why some people dislike C++ so much, just work with MFC. It's one of the worst bastardizations of C++ I've ever seen (of course, to be fair, one has to admit that much of the really sucky stuff in MFC was done before the C++ standards were very good, and long before th…

I mean MS in terms of the entire corporation, ie, all that comes from MS is bad. Last time I wrote in MFC was about five years ago. As I recall, I got up to speed by reading a couple books which went over basic application design stuff in Win32. Didn't seem too bad to me -- I even did some COM stuff and some hooks and such. But like I said, that was a while ago. I wasn't a crazy fan or anything, but the tools did the…

My latest woes were in trying to take a program written in a Modern/Standard C++ style and build in some existing sources that were written for MFC.

Talk about a black hole of tool-chain hell...

Re: Object Oriented Programming has Failed Us

#43
post #12

Object Orientation failed because it's too hard to understand? I blinked in incredulity. Object Orientation hasn't failed, but we're coming to appreciate its short comings as a sole design paradigm. For C programmers, C++ gave them access to variable execution via polymorphism (without ugly function pointers) and more flexible scoping via classes. In languages that provide first class and anonymous functions polymorp…

"closures provide better scoping flexibility than classes. Languages that have these features make it obvious how restrictive C++ is in binding this functionality in with the type system." C++ can/does do anonymous functions (for example, see boost lambda), and can even give you most of what you want from first-class functions and closures (using functors). The parts that you don't get are due mostly to the fact that…

Boost::lambda is a poor substitute for an actual lambda. Every time I have attempted to use it in a non-trivial way, I gave up because writing a one-off function object was clearer and required less code. (Albiet spread out more.)

Your claim that you can achieve everything in C++ misses the point. Sure, I can write lots of function objects every time I want to apply a function to a data structure (and I do), but I also have to write a lot of tedious code to do it. That tedious code increases the size of my code base, which increases the likelihood of errors and its cognitive load. You can write object-oriented programs using ANSI C, but your code base is going to be much larger than if you did it in a language with actual OO support.

When a programming concept has first-class support in a language, programs that use that concept are going to be shorter, clearer, and less likely to have bugs related to that concept's implementation.

Luckily, true anonymous function support will be a part of C++0x.

Re: Object Oriented Programming has Failed Us

#44

Earlier quoted context omitted.

I mean MS in terms of the entire corporation, ie, all that comes from MS is bad. Last time I wrote in MFC was about five years ago. As I recall, I got up to speed by reading a couple books which went over basic application design stuff in Win32. Didn't seem too bad to me -- I even did some COM stuff and some hooks and such. But like I said, that was a while ago. I wasn't a crazy fan or anything, but the tools did the…

My latest woes were in trying to take a program written in a Modern/Standard C++ style and build in some existing sources that were written for MFC. Talk about a black hole of tool-chain hell...

Ya -- mixing complex hierarchical OO libraries and programming metaphors in one project? It does sound like a trip through the underworld.

Re: Object Oriented Programming has Failed Us

#45
post #43
post #12

Earlier quoted context omitted.

"closures provide better scoping flexibility than classes. Languages that have these features make it obvious how restrictive C++ is in binding this functionality in with the type system." C++ can/does do anonymous functions (for example, see boost lambda), and can even give you most of what you want from first-class functions and closures (using functors). The parts that you don't get are due mostly to the fact that…

Boost::lambda is a poor substitute for an actual lambda. Every time I have attempted to use it in a non-trivial way, I gave up because writing a one-off function object was clearer and required less code. (Albiet spread out more.) Your claim that you can achieve everything in C++ misses the point. Sure, I can write lots of function objects every time I want to apply a function to a data structure (and I do), but I al…

"Your claim that you can achieve everything in C++ misses the point."

Well, no. I was responding to a comment that implied that it was impossible to do things like anonymous functions and closures in C++, due to the restrictions of the type system. That's wrong.

You'll get no argument from me that C++ is verbose.

Re: Object Oriented Programming has Failed Us

#46

Earlier quoted context omitted.

My latest woes were in trying to take a program written in a Modern/Standard C++ style and build in some existing sources that were written for MFC. Talk about a black hole of tool-chain hell...

Ya -- mixing complex hierarchical OO libraries and programming metaphors in one project? It does sound like a trip through the underworld.

But see, that's the point - C++ is intended to be multi-paradigm, and MS made it one-dimensional. Stdlib and Boost both take advantage of multiple paradigms while the MFC is a framework prison whence there is no escape.

Re: Object Oriented Programming has Failed Us

#47
post #16

Earlier quoted context omitted.

And yet, somehow, I've never seen a single line of live ADA code...and there are literally hundreds of millions of lines of C code doing work right now. Not only that, someone is almost certainly starting a new program written in C right now ...and now...and now...and now. And...you, guessed it, now. I'm sure Ada had a useful life, possibly even in a niche where C would never be an effective tool. I was just saying t…

Funny, I look at Ada every day ('cept it's called PL/SQL).

Please explain

Re: Object Oriented Programming has Failed Us

#48
post #47
post #16

Earlier quoted context omitted.

Funny, I look at Ada every day ('cept it's called PL/SQL).

Please explain

Ada never caught on as a general purpose programming language, but a subset of it lives on in PL/SQL, the embedded language in Oracle. It's not the most flexible or elegant language, but it's easy enough to learn and extremely reliable. It's all about choosing the right tool for the job. Sure you can run C in-process with your database, but unless you really, really have to it's a bit pointless to risk i.

Re: Object Oriented Programming has Failed Us

#49

Earlier quoted context omitted.

Ya -- mixing complex hierarchical OO libraries and programming metaphors in one project? It does sound like a trip through the underworld.

But see, that's the point - C++ is intended to be multi-paradigm, and MS made it one-dimensional. Stdlib and Boost both take advantage of multiple paradigms while the MFC is a framework prison whence there is no escape.

But it's not OOP's fault, and to the degree that Microsoft had to release something early (in order to support their Win32 framework) and keep supporting it -- it's not their fault either.

You can go with a lightweight (?!?!) framework around your API, a la MFC, or more of a true framework, like OWL. But in either case, comparing a what? 12-year old framework system with something more recent isn't exactly apples and apples.

I'm not trying to make excuses but heck, the whole reason we grow new frameworks is because old ones get too bloated and brittle.

Rock on with Boost, but don't compare apples and oranges. Maybe it's me, but professionals are supposed to know the hard-to-use crap and should be able to swim around in that stuff like a fish in water.

Hey -- just my two cents. No matter how you cut it, C++ is a killer language when it comes to complexity -- and that's without the freaking frameworks!

Post reply on HN