Why would it matter now that a language supports OO and it's speed. If you are talking about Jamagic, I want to see an example program written with an OO approach using Classes and inheitance. Then I want to see the same program written in Dark Basic Pro using only procedual approach. Then I want to see a C++ version of the same code written in both OO and procedual. Now you tell me on a 3Ghz Machine, which one is faster than the last.
Plus the fact, Jamagic is not compiled. It's interpreted. It's just like Java. It's a VM like Dark Basic was.
Dark Basic Pro is 100% compiled. Java though fast can still run slow. For instance, Java Applets, you get too many going at the same time, it's going to bog any system down because the VM just can't keep up. It acts like a computer but is slower than the actual hardware. Until they come out with Hardwired Java chips that execute code, you will never see it run very fast. Now to start answering some of your other questions.
I am both a C++ and C programmer. Having said that, I went a head tonight and programmed up two similar programs in both C++ and C.
In C++ I used classes
In C I used Structs and passed the struct by reference to the functions I made for it.
When I looked at the size of the EXE's that were produced, I was shocked! It was true that the C++ program was bigger. Yes, the C program was 204K and the C++ program was 224K. Yup a 9% size increase. Yup, a lot of people are going to be disappointed that a program fills their 20 gig hard drive up by 20Kilobytes more.
Now to put down anyone saying that OO is slow and
inefficient, let's put it this way. A guy buys your game. Installs it on his 2Ghz machine. Do you really think a few milliseconds are going to matter to the guy running the game? No really. Since the code is compiled, it's going to run as fast as the processor will allow it to. The only areas that you can get in trouble with speed is sorts and searches. I am not even sure why you are saying that OO is inefficient at speed. It isn't.
Heck, my friend programmed a Java program that runs faster on my machine than on his. Can you believe that? Even if the VM is suppose to run the same no matter how fast your computer is?
Why oh why would after having C++ this long we would be producing OO code that was inefficient coding to the procedual style of C. Why would the industry choose C++ over C. Hmmmm. Maybe the reason is that OO code is NOT inefficient? If it was inefficient they wouldn't be teaching C as an afterthought course in college. They wouldn't want C++ programmers, they would want more C programmers this day and age. iD Software wouldn't be programming Doom3 in C++. No, they would be doing it in C.
Ok, another point I would like to make. Operating Overloading and C++ way of intializing data.
You point out that cin and cout have nothing to do with OO. I beg to differ. If you have MSVC++ or Borland C++ open up a copy of your istream.h and ostream.h. Why, look at that, sitting inside a class are the overloaded operators. Hmmmm/ Plus as far as I know, Overloading Operators is apart of Object Oriented design. Without the ability to overload operators you wouldn't be able to copy one object to another without getting into shallow copying which won't work. Unless you use temp variables. So you would have to overload the = operator, but it would make more sense to overload the = operator.
Also, another point I would like to make. Any time you declare a variable in C++, you are treating it like an object.
Example code
#include <iostream.h>
int main()
{
int x = 5;
int y = 6;
int c = x + y;
cout << c;
return 0;
}
[\code]
Ok now that I have shown you that, look at this. It does THE SAME THING.
#include <iostream.h>
int main()
{
int x(5);
int y(6);
int c(x + y);
cout << c;
return 0;
}
[\code]
What does this mean? It means that C++ treats it's variables as Objects. In C++ we have what's called a constructor. In a class these are called to intialize the variables inside the class. Now with a class you can tell it how you want it to initialize or you can let the compiler do it for you.
Anyway, in C++, each time you declare a variable as type int also known as integer, you are creating an object of the class integer. When you do an int x = 5; you are passing the 5 to the constructor of class int. Although you can't directly access class int since it's a built in class, it's there. This is the same for any data type in C++ that's built in.
Next Point
"unless you dont want OO to interact with normal functions."
That's why we have friends. But why would you need to do that if you are coding private functions within the class?
Next
If you use the OO commands of DBPro your going to get 1)an FPS hit
What proves this? Nothing. The only things that matter are CPU, Amount of Ram and Video Card. Oh yeah, take already optimized C++ code, rewrite to C and see if you can get that 1 to 3 extra FPS. Yup, that makes sense.
Next
"how can C use this OOL stuff when only C++ really is? Hmm?"
Structs are an idea of OO, but they leave out two basic needs. Encapsulation and memeber functions to access member data. In C++ you can actually stick functions inside structs, but if you are already programming in C++, why would you want to use a struct? Structs are ok for some things, but I prefer classes. Usually I see structs used for making lists and I like that approach, but I would rather stick to using class to do linked list. Plus the STL provides one we can use if we so choose. Templating is good for linked lists.
Next
"A final note. DarkBasic is an abstraction built upon DirectX using C++, to simplify the programming paradigm."
DarkBasic/DarkBasic Pro makes it easy to use the Direct X API. It's not simplifying the programming paradigm any further than it already has been. You can make very complex DarkBasic Pro programs if you wanted to. Adding OO is not going to take away from how simplifyed it already is. It's giving those who have advanced skills the ability to use those skills.
This is what I want. If DBS added OO programming to Dark Basic Pro, it's not going to even bother you. You don't have to use it if you want to. It's for those who want it.
Repeat after me.
You don't have to use OO if you don't want to.
You don't have to use OO if you don't want to.
You don't have to use OO if you don't want to.
You don't have to use OO if you don't want to.
SoulMan
I am my own and own my am I