topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 9:57 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Thoughts about OOP programming  (Read 12770 times)

Cpilot

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 293
    • View Profile
    • Bite Notes
    • Read more about this member.
    • Donate to Member
Thoughts about OOP programming
« on: March 20, 2006, 10:33 PM »
I don't really do or understand object oriented programming techniques. I have been reading about it and thinking about giving it a shot.
But I ran across this article and thought I would point folks to it for discussion and opinions on OOP.

OOP Is Much Better in Theory Than in Practice

Enjoy  :)


Rover

  • Master of Smilies
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 633
    • View Profile
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #1 on: March 21, 2006, 12:27 AM »
mouser, I know you love OOP, so please don't take offence :)

I thought OOP was a crock when I first started toying with it in the 90's in Turbo Pascal and C++.  Then I figured I must just be too slow to pick it up.  Now I don't feel so bad.  Many people are telling stories of woe about OOP.

To be fair, I think it's almost a personality type.  I mean some people like OOP because it works the way they think.  Others, like me, don't like OOP because we can think...  I mean because we think different... or something  :-[

Insert Brilliant Sig line here

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #2 on: March 21, 2006, 04:26 AM »
thought provoking but ultimately extremely unconvincing to me.
i guess part of it might be a style issue, and i'll leave it to someone better at writing (and someone who isn't up to his eyeballs coding the donationcredits system) to dissect it, but really i think it misses all of the important features of object oriented programming.

what people have to realize is that ultimately, all code is compiled down into a very low level language like assembly.

everything else is just stuff on top to help you as a human organize your data and code in a way that makes it easier for you to write and maintain.

to me, over almost two decates, object oriented programming has represented a profoundly positive framework for organizing code and data structures.  it changes the way i plan solutions, conceive of problems, etc.  i can't imagine trying to keep complex programs organized without using it.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,069
    • View Profile
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #3 on: March 21, 2006, 05:15 AM »
GUI components are great time-savers, and they work well. But don't confuse them with OOP itself. Few people attempt to modify the methods of components. You may change a text box's font size, but you don't change how a text box changes its font size.

Isn't that the point of OOP programming - black box self contained and documented units that can be pulled off the shelf.

Sure it means that resulting code may not be as efficient (you may have redundant code knowcking about in the black boxes) but was OOP ever designed for pure number of lines efficiency.

He also says it works well in a large team programming structure - and I think that is the point. None of these tools (including all the current ones) are actually designed with the lone geek in mind, they are all designed for corporate solutions and big team playing.

I remember learning OOP programming via Turbo Pascal when it first came out. I can't remember any of the details but it was an interesting development. I'd guess that the vast majority of small scale programmers dabbled and then went back to linear methods, but most programs are now written using components (in one form or another) so even if the overall structure of the program isn't OOP I bet there are few applications that don't utilize OOP in some way - even if they don't know it!

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #4 on: March 21, 2006, 06:57 AM »
i completely and vigorously object to the idea that oop is only for group programming.

the more people you have looking at code the more important it is that it is better modularized, but saying that's the only time to use oop is like saying that a filing strategy helps organize stuff when you work in an office with lots of people, so when you are home you should just throw your papers on the floor randomly.


here is that authors full website against oop for those who didn't read through to the end of his article: http://www.geocities.../tablizer/oopbad.htm
hmm.. i think this guy had a bad psychological reaction to oop when he was a baby.. maybe his ex-girlfriend was an oop fan.


now there are some more sophisticated attacks of oop than this guys, centering on new programming paradigms like "Aspect Oriented Programming" - http://en.wikipedia....oriented_programming

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #5 on: March 21, 2006, 07:03 AM »
more links:
wikipedia page on object oriented programming: http://en.wikipedia....nstead_of_membership

and wouldn't you know it, our own favorite programming blogger, jeff atwood, has written about the oop hater page:
http://www.codinghor...archives/000200.html
definitely worth a read!

looong philosophical article on oop thinking:
http://www.interacti...ation_redefined.html

« Last Edit: March 21, 2006, 08:10 AM by mouser »

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,069
    • View Profile
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #6 on: March 21, 2006, 07:29 AM »
i completely and vigorously object to the idea that oop is only for group programming.

Not sure if that is aimed at me or the article .. if me then I didn't actually mean that ... what I meant was it was designed with group progamming in mind. Lots of people use OOP to organise their programming ideas and produce easily accessible reuseable code, and even more buy into it unwittingly. However I think the article's argument that OOP isn't the only way of being organised is valid.

To take your anaolgy further just because you don't have the same organisational needs of big business doesn't mean you chuck it all over the floor. But for most home/small scale programmers an indexed shoe box would do the trick just as effectively ;)

Equally just because stuff is organised for corporate environments (eg. MS Office 2003 or Adobe Design products) doesn't mean that the corporate tools can't be used by small groups and individuals to simplify their workflow - they just weren't really designed with that approach in mind. An example of this is Adobe's VersionCue.
« Last Edit: March 21, 2006, 07:31 AM by Carol Haynes »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #7 on: March 21, 2006, 08:03 AM »
i was referring to the author.
i agree that there is no one approach for all problems, though as an avid oop fan i think most non-trivial programming tasks are well suited to oop methods.

Rover

  • Master of Smilies
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 633
    • View Profile
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #8 on: March 21, 2006, 11:09 AM »
Just peeked at the Looonnnggg article on OOP psychology.  I guest the first thing that has always bugged me about OOP is the whole notion that the "Real World" has any relationship to programming.  Every OOP book I've read starts by talking about objects like an apple.  An apple has attributes and do certain things.  It's a little different than an orange but has some similarities.  WHO CARES?!  What does that have to do with business rules, or accepting keyboard input?

I get the idea that objects, classes or whatever your language calls them are self contained, have attributes and methods, can be a subclass of another object or be a parent to sub objects. 

I guess I really fail to see the difference between OOP and a good library.  I used to buy TurboPower units when I was programming in Pascal.  They had UI code, calendar code, file manipulation code, etc. etc.  I could just link it in and start using it.  It was extremely productive.  What I focused on was writing the logical end of things as determined by the business.    I created some units (libraries) of my own to contain general business logic that we used.  What did I miss by not using OOP?

People solve problems differently, and I still think this is all just a preference issue.

I sure can't say OOP is totally worthless... look @ mouser and his productivity. :Thmbsup:  But I think I can say it's not my cup o' tea.  8)


Edit: The picture below is from the article mentioned by mouser.  Although I would love to take credit such fine art.  ;D
Insert Brilliant Sig line here
« Last Edit: March 21, 2006, 01:24 PM by Rover »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #9 on: March 21, 2006, 11:28 AM »
accepting keyboard input?
The key 'U' is similar to the key 't', but have some similarities, thus, can be handled the same way  :tellme: :tellme:

Btw.. i love your drawing! :D

Gerome

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 154
    • View Profile
    • Get my Freestyle Basic Script Language + compiler!
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #10 on: March 21, 2006, 04:35 PM »
Hello,

Since i'm a C, C++, VB, .NET, PLSQL and other development tools dev'er, i'm not very fond of OOP programming since it only depends on how you can see OOP...
According to me it's just 'a vue d'esprit' and i can affirm after more than 10 years of system development and other, that OOP has slowed down my projects more than non OOP ones...
I'm more efficient and faster developper with effective result at C rather than with C++ or alike...
Yours,
(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
http://www.fbsl.net [FBSL Author]
http://gedd123.free.fr/FBSLv3.zip [FBSL Help file]
(¯`·._.·[If you need help... just ask]·._.·´¯)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #11 on: April 04, 2006, 06:22 AM »
Any good piece of software will be written using many of the principles of OOP, whether you use classes (C++), objects (Pascal), or whatever they're called in other languages. Namely, isolation, modularization, black-box functionality, et cetera.

Some of the popular C libraries (as in not-using-classes-and-not-C++) are even object-oriented by nature - most library calls include a "context" of one form or another as one of their parameters. Guess what? That's the same way classes work, syntactic sugar aside.

People that I've seen fight fiercely against OOP have almost never had a formal programming education, often don't realize they're using using OOP concepts themselves, and have this totally flawed view that OOP code means "bloated and slow", based on observations of really bad code and really old and bad compilers... or compilers in debug/non-optimization mode.

Crappy textbooks and "teach yourself language <lang> in <quantity> <timeunits>" pieces of crap are to blame too, talking about cars, fruits, and animals. For good OOP (C++ biased), you'll need Meyers, Dewhurst, Sutter, Alexandrescu books, as well as the Design Patterns (GoF) book. That's the Real Deal.
- carpe noctem

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: Thoughts about OOP programming
« Reply #12 on: April 13, 2006, 01:58 AM »
I don't have a firm concept of OOP myself, but for me it's a natural way of programming. I mean OOP is nothing more than programming principles. That is, certain principles can help keeping a large project (= mucho code) in check.

The moment these principles turn into ritual, OOP becomes a religion; writing code is ever so complex and challenging that rituals seem like *the* solution, but they just distract from the real problem.

I don't think classes and inheritance are the holy grail of OOP; some principles can be expressed like that, but there are more principles than just encapsulation and code reuse. Point being, there have been many too simplistic, even religious, statements about OOP and now the normal programmer is confused: OOP turned into a buzzword. But in fact it can help keeping things organized by expressedly showing *how* to manifest certain principles in code...

I use classes for encapsulation, but I don't have to put every function inside a class. Inheritance I use to take care of "special cases". I don't think I know many aspects of OOP (and I am not sure I use them correctly), but I do know my productivity increased dramatically after I first learned of OOP. I don't care about runtime behavior because I think the compilers these days do a very good job optimizing the resulting code.

When I think "OOP" I don't think "class hierarchies & inheritance" but "neat objects doin' their thang"  :)