Please ignore my previous post. I accidentally sent my rough draft.
I have been programming for over twenty-years. I first started out with
BASIC and LOGO on the Vic-20, and continued with BASIC and LOGO for the
Commadore-64. While studying mathematics and computer science in
university, I began programming in C, C++, and Java, as well as with Perl
and PHP. Recently, I have been using Xcode, (a very excellent IDE and is
free) for Objective-C programming. So, I know my theory, my programming,
and my languages very well.
When I became aware, in 2003, that REALBasic had become Object-Oriented,
I decided to give REALBasic a try. What I needed was an IDE which would
allow me to rapidly develop application prototypes for both the Macintosh
and Windows OS's. So, REALBasic suited me just fine.
However, I never thought of REALBasic as the tool to write fast,
real-time, realistic 3D. Because BASIC was designed not for writing fast
programs, it was designed to allow non-programmers to program a computer to
solve relatively simple problems.
Of course, REALBasic has evolved from these beginnings, into an
object-oriented language for beginner's and professional's alike, but
REALBasic is still BASIC.
The fundamental reason I argue that REALBasic cannot compete against the
C family, (C, C++, Objective-C), for rendering fast real-time, realistic 3D
graphics, is that pointers are not available in REALBasic while they are
fundamental and crucial to the C family.
Arrays, for example, compose a critical point along the path for
rendering 3D graphics. Therefore, the speed with which a language can
perform array operations critically affects the speed with which the
language can render a dynamic 3D environment.
Array operations are slow in REALBasic, while pointer's give the C family
the ability to perform these operations extremely fast.
Pointers provide tremendous power, and along with that power comes great
responsibility. Pointers cannot be used without great care. In any but the
most simple projects, it is imperative that you know exactly the state of
your pointers, when they live and when they die.
If, for example, you use a pointer incorrectly, what happens is
undefined. The bad pointer may be affecting some completely un-related,
distant part of your code. So, when you experience a bug caused by this bad
pointer, it is quite possible you'll have no idea of where to look for the
cause.
However, just because pointers can cause tricky bugs, is not reason
enough not to use them. You just need to use great care.
Now, I do not mean to say that REALBasic cannot become faster unless
REALBasic adds pointers. Indeed, REALBasic can increase its performance for
3D graphics without using pointers. However, it is the pointer which gives
the C family the razor's edge for fast, real-time, realistic 3D rendering.
Therefore, I cannot see REALBasic seriously competing against
industry-standard language for 3D graphics.
So, unless you change the nature of the beast, REALBasic is not the tool
to use to write 3D games capable of competing within the video game market.
If you want hardcore, you have to go hardcore.
This was simply my point.
Now, regarding Polymorphism and Dynamic Binding.
Let me first say that if you are getting all your theoretical knowledge
from Wiki, you need to look elsewhere.
Secondly, I think you are confusing Dynamic Linking with Dynamic
Binding. Linking and Binding are completely different.
A method is dynamically bound to an implementation, if this binding can
only occur at Runtime.
Consider the following example:
Let all lifeForms have a method named "die"
Let Fish, Rats, Cats and Lizards all be LifeForms
Each type of lifeForm, (cat,rat,lizard etc) may or may not implement
their own versions of the die method.
Now consider the following method of some other class (say Window1):
Sub createRandomLifeForm() As LifeForm
{
dim random as Random
dim number as integer
dim fish as Fish
dim cat as Cat
dim lizard as Lizard
random = new Random()
number = random.number() * 3 + 1 //chooses either 1, 2 or 3 at random
select case number:
case 1: //fish
return new Fish()
case 2: //cat
return new Cat()
case 3://lizard
return new Lizard()
end case
return nil
}
Since a random number must first be generated in order to determine
which kind of life form is returned, and since the random number is only
generated at Runtime, the compiler can not bind any implementation to any of
the methods of the life form objects. Therefore, the binding between
implementation and method occurs at Runtime.
Since the binding occurs at runtime, the binding is called dynamic
binding.
Polymorphism doesn't necessarily imply Dynamic Binding, you are correct.
But as the above example shows, if method overriding is a part of
Polymorphism, (as it should be), then Polymorphism requires Dynamic Binding.
Adam
-
Let 1 = 0 and say Good-Bye World.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|