So... when you write an OO program in C++ it stops being OO once you compile it since it is in machine code?
Yes, every language has value. Yes, hand coding assembly *BLOWS*. (debug.exe was fun, but there's something to be said for being able to edit your code...) OO is still about design, and then you choose the language that will best allow you to implement your design.
And to respond to your first comment directly, you can't write OO code in any language. You can write code that implements an OO design in any language (and like I think both you and I agree, depending on the particulars of the design, some languages will be better to use than others).
i suppose i might have been clearer. c++ does all sorts of fancy type checks to make sure that what you're doing is legit, e.g. inheritance and so on, as well as implementing the whole thing with vtables so that you can have overloaded functions and so on which is convenient for OO designs, and something that c just plain does not do. it also has exception handling, and a number of other features. all of these can be done in c in one way or another, but they do usually come out looking cleaner in c++.
conversely, in c, you can just pass void pointers around and make calls to function pointers with function signatures that you specify at your own whim and the compiler will be none the wiser. while you can still do this in c++, the compiler does provide you with a legit path so that it can do many of the checks itself.
Have you ever seen an OO design in scheme? It's *surprisingly* clean. Other than some admittedly hairy convenience functions, you can implement a class structure quite easily. And scheme doesn't even have types. (For those who don't know, scheme is pretty much the same thing as LISP. And if you don't know what that is... well... there's google.)
And yeah, I agree that there are some languages that facilitate OO and others that don't. It just irks me when people claim that OO is linked directly to a given language and any program in C can't be OO, it can only "pretend"
Wow, it's really too bad that people these days think that OO is about a language spec. It's not! OO is a design paradigm! (ugh. i hate that word, but that's what it is.) Your design is either OO or not OO, and the language that you implement it in is irrelevant. All that c++ does that c doesn't is do a few checks in the compiler. You can implement OO designs in C, Scheme, and plenty of other languages that don't have built-in checks for such things. (and yes, c++ does have a number of other features, but they are wholly unrelated to OO)
OO doesn't fix buffer overflows either. Why would it? If you have crappy design/use the wrong functions for the wrong things, then you're going to end up with buffer overflows. C# goes quite a ways, as a language, to prevent this, but don't confuse it with OO.
Not so -- a lot of the time, physics actually drives the development in mathematics (take calculus, for example).
So... when you write an OO program in C++ it stops being OO once you compile it since it is in machine code?
Yes, every language has value. Yes, hand coding assembly *BLOWS*. (debug.exe was fun, but there's something to be said for being able to edit your code...) OO is still about design, and then you choose the language that will best allow you to implement your design.
And to respond to your first comment directly, you can't write OO code in any language. You can write code that implements an OO design in any language (and like I think both you and I agree, depending on the particulars of the design, some languages will be better to use than others).
i suppose i might have been clearer. c++ does all sorts of fancy type checks to make sure that what you're doing is legit, e.g. inheritance and so on, as well as implementing the whole thing with vtables so that you can have overloaded functions and so on which is convenient for OO designs, and something that c just plain does not do. it also has exception handling, and a number of other features. all of these can be done in c in one way or another, but they do usually come out looking cleaner in c++.
conversely, in c, you can just pass void pointers around and make calls to function pointers with function signatures that you specify at your own whim and the compiler will be none the wiser. while you can still do this in c++, the compiler does provide you with a legit path so that it can do many of the checks itself.
Have you ever seen an OO design in scheme? It's *surprisingly* clean. Other than some admittedly hairy convenience functions, you can implement a class structure quite easily. And scheme doesn't even have types. (For those who don't know, scheme is pretty much the same thing as LISP. And if you don't know what that is... well... there's google.)
And yeah, I agree that there are some languages that facilitate OO and others that don't. It just irks me when people claim that OO is linked directly to a given language and any program in C can't be OO, it can only "pretend"
Wow, it's really too bad that people these days think that OO is about a language spec. It's not! OO is a design paradigm! (ugh. i hate that word, but that's what it is.) Your design is either OO or not OO, and the language that you implement it in is irrelevant. All that c++ does that c doesn't is do a few checks in the compiler. You can implement OO designs in C, Scheme, and plenty of other languages that don't have built-in checks for such things. (and yes, c++ does have a number of other features, but they are wholly unrelated to OO) OO doesn't fix buffer overflows either. Why would it? If you have crappy design/use the wrong functions for the wrong things, then you're going to end up with buffer overflows. C# goes quite a ways, as a language, to prevent this, but don't confuse it with OO.