Enlighten me, what is the true essence of OOP? Is is just the use of objects and classes, or is it something more?
and is OOP really better than structured programming?
Name:
Anonymous2006-04-11 17:10 (sage)
gb2/cave/
Name:
Anonymous2006-04-11 17:54
>>1
OOP is made of win and god. You are obviously made of fail and some other noun that sounds mildly insulting to you.
Name:
Anonymous2006-04-11 17:57
>Enlighten me, what is the true essence of OOP?
Wank and managerspeak
>Is is just the use of objects and classes, or is it something more?
It's the use of backronyms and other nonsense that makes the speaker sound important.
>and is OOP really better than structured programming?
I suppose, if you're the type who likes Java. The rest of us just want to get our work done.
Name:
Anonymous2006-04-11 18:29
>>4
OOP is not exclusively made of wank, it's good for big programs where you don't have mathematical stuff to do, and it's too big to be done by just one man.
Name:
Anonymous2006-04-12 0:50
>>1
the true essence of OOP isn't just about using classes and objects, but using them as the basic building blocks of the entire program.
it's easy enough to throw objects into an otherwise normal non-OO program if the language supports it (C++ is a good example). in these cases, however, objects are little more than glorified structs which do little to enhance the program.
object oriented programming takes it further. rather than a bunch of commands acting on variables, you have a bunch of objects acting with other objects. each class ideally has it's own unique methods and attributes which apply only to that class. this makes OO programs more modular and, theoretically, improves the ability to reuse one class in other programs.
>and is OOP really better than structured programming?
meh, not really 'better' so much as 'different'. you can do the same things in structured programming, and often with less code. however, OO programs (in my experience) tend to be easier to debug and upgrade if done properly. it's mostly a personal preference, and i'd recommend learning both styles of programming regardless.
Name:
Anonymous2006-04-12 3:41
>>4
Don't equate OOP with Java. Java takes a poor implementation of OO and then turns it into a religion.
The classic definition of OO is that provided by Smalltalk. It boils down to the idea of message passing. Every object is responsible for its own internal state, and for responding to messages sent by other objects. When done right it can be a very elegant and intuitive way of programming. When done wrong you get Java, or sometimes even C++.
Have a look at Ruby for a modern Smalltalk-style OO language. Observe how it doesn't force stupid shit down your throat.
Name:
Anonymous2006-04-12 5:54
>>4 got it right, it's mostly wank and managerspeak.
Seriously, it's just a syntax and a series of features, which are to be used following a style which good programmers already do with structured programming. When implemented properly, OOP is alright, but it's not the marvelous best practice wankery people hypes about.
Consider the following:
Bad practice => best practice
Regular => business
Structured module with a structure => class
Structure fields => properties AKA member variables
Variables of this structure => objects AKA instances
Functions in the module => methods AKA member functions
etc
Java is the worst example of OOP and will make you hate it. Java's implementation of OOP is made of half assed and wrong, and forcing you to do everything in OOP is lame. Modern multi-paradigm scripting languages like Python or Ruby have nice implementations which you'll learn to like and will use together with structured programming and some functional programming whenever you feel they fit the job better.
In particular, I like Python's model because it's easy to understand: it's just a namespace hack with a few __special__ methods. Consider object.method(param) is the same as class.method(object, param). You can very easily convert a well done structured module into a class; very easily as in "copypasta" and "hack", really.
Objects are about maintaining their own internal state, not being "smart", not inheritence, not classes, not interfaces, not instances, not singletons, not replacable, and especially not Java, like Sun would try have you believe.
Name:
Anonymous2006-04-18 14:28
OOP is just POO backwards
Name:
Anonymous2006-04-19 5:35
>>11 I wish we had sigs here; if we did, I'd make that one mine!
I like objects. It don't know if its necessarily "better" then traditional code, but I certainly find my Objective-C programs easier to understand then my C ones, especially if I haven't looked at it for awhile.
OOP is like... in C you'd have a module, some static and some extern variables and a handful of functions that do stuff to and with the variables and other functions. But you only get one, because a static or global variable exists only once per program.
Versus the so-called OO languages, where you stick this junk in a class and get multiple instances of it, plus things like inheritance, interfaces and annoyingly verbose "Math.pow(xxx, yyy)", "System.out.println("fuck off yall")" syntax because the language designers are wankers.
Name:
Anonymous2006-04-29 10:54
... of course you can still do a painful, by hand kind of OOP with function pointers, structs and so forth in C if you really need to. There's nothing special about the current generation of commercially successful OO language (i.e. C++, C#, Javur) in that regard.
Agreed. When I program in C++, I don't get overtly anal about making every, single, god damn thing conform to OOP analisms. C++'s biggest strength, at least as far as my coding style is, is it lets me code in C, but I can compartmentalize (is that a real world?) certain things so that my code can be slightly more readable than if I were to write it in pure C.
If I were to structure a graphics engine in C++ using strict OOP protocol, it'd be shitty and slow compared to if I wrote such a thing in C++, with very loose OOP such that I can still design the data structures based on speed rather than blind orthodoxy.
C is the best language ever. OOP is for Rallie Retardedson.
Seriously, all this moving from language to language is spending time fapping your language dick when you could actually be concentrating on getting something working.