Binding

V

Victor Bazarov

Tom said:
What is early/late binding ?

I think it's the resolution of function address(es) in the code where
the function(s) is (are) called. Early binding (referred to as "static"
or "compile-time" or "link-time" binding) means resolving the address
based on the type information available at compile time. Late binding
(also "dynamic binding" or "run-time binding") means resolving the
address based on type information available [only] at run time and
depending on some condition not known at compile-time.

What does Wikipedia say?

V
 
T

terminator

Hi,
What is early/late binding ?

late binding is something involving calling things which are usually
declared as 'virtual'.other things are usually early binded.Late
binding is about determining the function to be called at runtime
which is too late to be sorry about mistakes.

regards,
FM.
 
N

Neelesh Bodas

Hi,
What is early/late binding ?

In a very general sense, "binding time" refers to the time where
identifiers/variables are bound to values. Early binding, also called
"static binding" or "compile time binding" refers to the fact that
identifiers get bound to the values at compile time. Run-time
binding / dynamic binding / late binding refers to the fact that the
binding is delayed till run time.

of course, 'Binding' should not be confused with 'changing the
value' .

In C++, virtual functions follow late binding. Non virtual functions
follow early binding. On the other hand, all variables are _always_
early bound. This can be seen from the following example:

struct A
{
int i;
A() : i(10) { }
virtual void foo();
};

struct B: public A
{
int i;
B(): i(20) { }
void foo();
};

int main()
{
A* a = new B();
int s = a->i; // value of s is 10 not 20 : early binding
a->foo(); // calls B::foo() : late binding
}

-N
 
O

Ole Nielsby

Neelesh Bodas said:
In C++, virtual functions follow late binding. Non virtual functions
follow early binding.

I'd say virtual functions are an intermediate thing - they are perhaps the
closest you get to late binding in C++ but not comparable to late binding
in, say, Javascript.

The Javascript-style late-binding relies on runtime-lookup of the
function name, and runtime typechecking, whereas C++ virtuals
are "late bound but early typechecked".
 
J

James Kanze

I think it's the resolution of function address(es) in the code where
the function(s) is (are) called. Early binding (referred to as "static"
or "compile-time" or "link-time" binding) means resolving the address
based on the type information available at compile time. Late binding
(also "dynamic binding" or "run-time binding") means resolving the
address based on type information available [only] at run time and
depending on some condition not known at compile-time.
What does Wikipedia say?

Depends on what the last person to update the article happened
to feel. The Wikipedia is fun for a lot of things, but it can
hardly be considered a source of reliable information.
 
J

Juha Nieminen

James said:
The Wikipedia is fun for a lot of things, but it can
hardly be considered a source of reliable information.

So the urban legend says, yet I have yet to see with my own
eyes unrealiable information there. Sure, there are examples.
I just haven't seen any myself.
 
J

Juha Nieminen

Juha said:
So the urban legend says, yet I have yet to see with my own
eyes unrealiable information there. Sure, there are examples.
I just haven't seen any myself.

Define irony: I have to take that back right away, since
I encountered an example just a moment ago:

http://en.wikipedia.org/wiki/Binary_search#Equal_elements

"If one searches for a value that occurs multiple times in the list,
the index returned will be of the first-encountered equal element, and
this will not necessarily be that of the first, last, or middle element
of the run of equal-key"

This is, of course, BS. It's perfectly possible (and usually
desirable) to implement binary search so that it will always find
eg. the first of equal elements in log(n) time. Eg. std::lower_bound()
does this.
 
J

James Kanze

So the urban legend says, yet I have yet to see with my own
eyes unrealiable information there. Sure, there are examples.
I just haven't seen any myself.

I've run into a number of them. But that's not the point. The
point is that there is no guarantee of reliability; unless you
already know the answer, you don't know whether what the article
says is correct or not.
 
A

Alf P. Steinbach

* James Kanze:
I've run into a number of them. But that's not the point. The
point is that there is no guarantee of reliability; unless you
already know the answer, you don't know whether what the article
says is correct or not.

Sorry friend James, I have to disagree strongly with you there.

There's no such thing as absolute correctness: it's just a question of
probability of correctness, and Wikipedia compared favorably to old
Encylopedia Britannica in that respect last time it was checked.

It's the same issue as with longish mathematical proofs, approaching or
exceeding computer programs in complexity (hence, possibility of bugs).
The four-color theorem was proved by computer, but how do you trust
the proof when it runs to zillions of pages, and how do you trust the
program that generated it? Even worse for mathematicians who
irrationally believe in the concept of absolute correctness (there are
some irrational mathematicians, even of the very best), some people of
high standing argue that probabilistic proofs, proofs that you know at
the outset only give a probability (albeit near certainty), are Just As
Good(TM) as fallible absolute proofs, with about the same probability...
 
J

James Kanze

* James Kanze:
Sorry friend James, I have to disagree strongly with you there.
There's no such thing as absolute correctness: it's just a
question of probability of correctness, and Wikipedia compared
favorably to old Encylopedia Britannica in that respect last
time it was checked.

And that is simply false. (Although in fact, I don't think it
was ever checked.) From my own experience, about one article in
two contains some more or less important error. In some cases,
serious errors, which would give the reader a very false
impression of what the current state of the art is.
It's the same issue as with longish mathematical proofs, approaching or
exceeding computer programs in complexity (hence, possibility of bugs).
The four-color theorem was proved by computer, but how do you trust
the proof when it runs to zillions of pages, and how do you trust the
program that generated it? Even worse for mathematicians who
irrationally believe in the concept of absolute correctness (there are
some irrational mathematicians, even of the very best), some people of
high standing argue that probabilistic proofs, proofs that you know at
the outset only give a probability (albeit near certainty), are Just As
Good(TM) as fallible absolute proofs, with about the same probability...

It's not an issue of proofs. One doesn't go to an encyclopedia
for proofs. One uses it to obtain a summary of the current
generally accepted "facts". Where "generally accepted" means
"by the experts in the field".

Note that I'm not against Wikipedia per se. I find it a lot of
fun, and enjoy reading it. But I also find that it is being
rather systematically used for something it is not: an
authorative source.
 
A

Alf P. Steinbach

* James Kanze:
And that is simply false. (Although in fact, I don't think it
was ever checked.)

Now, now, listen to Alf, I say.

<url: http://news.com.com/2100-1038_3-5997332.html>

"Wikipedia is about as good a source of accurate information as
Britannica, the venerable standard-bearer of facts about the world
around us, according to a study published this week [December 15, 2005]
in the journal Nature."

From my own experience, about one article in
two contains some more or less important error.

Yes, it averages to about 2 or 3 errors per article (page) in either
encyclopedia, and that's the usual.

E.g. check out the errata list for any serious, good technical book,
such as TCPPPL: it's /long/.

On the other hand, the really bad books seemingly are error-free, no
errata lists published, and naïve novices believe 'em. They're just
like magazines (like old Object magazine, very unfortunately merged into
DDJ if I recall correctly) that don't publish letters to the editor.
Wikipedia is at the absolute other end of the spectrum: you can leave
discussion comments freely, and you can /fix/ it -- and should.


[snip]
Note that I'm not against Wikipedia per se. I find it a lot of
fun, and enjoy reading it. But I also find that it is being
rather systematically used for something it is not: an
authorative source.

Yes, I agree, and add: it can be stupid to cite a "fact" with reference
to Wikipedia, because when someone follows the reference, the Wikipedia
article might have changed, omitting that "fact", but on the other hand
it can be intelligent if the "fact" is in doubt, because when someone
follows the reference, the article might have been corrected.

And the nice thing is that you can follow the references and google for
terms and facts found in the articles, and find authoritative sources.

Not that those more authoritative sources necessarily have better error
rates, but, they're authoritative, so nobody can fault you... ;-)
 
T

tragomaskhalos

I've run into a number of them. But that's not the point. The
point is that there is no guarantee of reliability; unless you
already know the answer, you don't know whether what the article
says is correct or not.

Very true, but isn't this more broadly true of the internet
as a whole ?
(Wisdom imparted by the more august members of this n.g.
being a different matter, of course :))
 
J

James Kanze

* James Kanze:
Now, now, listen to Alf, I say.

"Wikipedia is about as good a source of accurate information as
Britannica, the venerable standard-bearer of facts about the world
around us, according to a study published this week [December 15, 2005]
in the journal Nature."

Did you read the rest of the article? Where it says that their
evidence is based on a sample set of only 42 (hardly
significant). Or the fact that what they actually find isn't
that Wikipedia is accurate (it's actually worse than I thought),
but that the Encylopedia Britannica was exceedingly inaccurate.
And that the Wikipedia did have about 1/3 more errors, which
would be significant if the sample size were significant.

At least in their sample. (But it's worrying enough that I'd
like to see a test with a much larger sample.)
Yes, it averages to about 2 or 3 errors per article (page) in
either encyclopedia, and that's the usual.
E.g. check out the errata list for any serious, good technical book,
such as TCPPPL: it's /long/.

But most are simple typos, or minor details.

The issue isn't just one of such errors. It's one of
orientation, or presentation. (I'm not sure what the exact word
I'm looking for is.) For "just plain facts", like birth dates,
etc., the Wikipedia is fine (in general, anyway). Just about
any time the question is more open, however, Wikipedia is
subject to "hijacking" (and in practice, usually is hijacked).
On the other hand, the really bad books seemingly are error-free, no
errata lists published, and naïve novices believe 'em. They're just
like magazines (like old Object magazine, very unfortunately merged into
DDJ if I recall correctly) that don't publish letters to the editor.
Wikipedia is at the absolute other end of the spectrum: you can leave
discussion comments freely, and you can /fix/ it -- and should.

It's the "you can fix it" that causes problems. There's no way
to guarantee accuracy, but ensuring that an article is written
by an established expert in the field helps avoid the worst
abuse; in most cases, of course, you'd also want some sort of
peer review.

But it often depends. I use the Wikipedia a lot for information
that isn't important enough for a classic encyclopedia, nor
controversial enough for people to attempt to slant it. There's
a lot of information there that it would be very difficult to
find elsewhere.
[snip]
Note that I'm not against Wikipedia per se. I find it a lot of
fun, and enjoy reading it. But I also find that it is being
rather systematically used for something it is not: an
authorative source.
Yes, I agree, and add: it can be stupid to cite a "fact" with reference
to Wikipedia, because when someone follows the reference, the Wikipedia
article might have changed, omitting that "fact", but on the other hand
it can be intelligent if the "fact" is in doubt, because when someone
follows the reference, the article might have been corrected.

Or the "fact" might have been correct, and been "corrected" to
something wrong.
And the nice thing is that you can follow the references and google for
terms and facts found in the articles, and find authoritative sources.

Even the choice of references can be tendential.
Not that those more authoritative sources necessarily have better error
rates, but, they're authoritative, so nobody can fault you... ;-)

Unless the fact is cut and dried (like a recent birth date,
established from a birth certificate), you need several
different authoritative sources. The real problem, however, is
the one you mentionned concerning bad books, above: how does a
newbie know whether a source really is authoritative?

There's no simple solution; learning any complex subject is
difficult, and involves real work. And intellectual laziness
seems to be the in thing these days: everyone just wants to "plug
in" expert knowledge, and imagines that they can. And the
Wikipedia (perhaps not intentionally) panders to this attitude.
(In a way, so does any encyclopedia. But there's something
about having to physically go to the bookshelf, and lift a heavy
tome, that suggests that some work is involved. Today, you just
Google, take the first hit, and consider yourself an expert.)
 
J

James Kanze

Very true, but isn't this more broadly true of the internet
as a whole ?

It's true of just about any source of information, to a more or
less greater degree. The problem is the not the existance of
Wikipedia; it's the way it is often used. Search just about any
topic with Google, and the Wikipedia article will be in the top
three hits---as if it were an original source. And it's
constantly cited as the authorative source.

In a sense, I'm reminded of a definition of expert: an expert is
a person who knows more and more about less and less (and the
ultimate expert knows everything there is to know about
nothing). Wikipedia (and encyclopedias in general, but the
Wikipedia is an extreme example of this) is the opposite of an
expert: it "knows" something about just about everything, but
the quality of the information isn't nearly as high as it would
be in more specialized literature. (Although if there is a
market, even the more specialized literature can sometimes be
very bad. Regretfully, I don't have any magic solution for the
newbie, to help him distinguish. Other than by asking a lot of
different "experts".)
(Wisdom imparted by the more august members of this n.g.
being a different matter, of course :))

I don't know. I find a fair number of errors in the answers
here as well. And make some myself, when I'm too lazy to go
look things up in the authorative sources. (In the case of C++,
there is one formally authorative source: the standard. There
have already been two different versions of that, however, a
third one is in the pipeline, and practically, very few
compilers are really conform, so you need more. And of course,
understanding what is written in the standard isn't always that
easy either.)
 
A

Alf P. Steinbach

* James Kanze:
* James Kanze:
Now, now, listen to Alf, I say.

"Wikipedia is about as good a source of accurate information as
Britannica, the venerable standard-bearer of facts about the world
around us, according to a study published this week [December 15, 2005]
in the journal Nature."

Did you read the rest of the article?

Yes, and of course I read that when it happened; I just googled up a
version for your convenience.

This version also has a discussion forum, in the spirit of Wikipedia! <g>

Worth skimming, at least, if you haven't.


[snip]
There's no simple solution; learning any complex subject is
difficult, and involves real work. And intellectual laziness
seems to be the in thing these days: everyone just wants to "plug
in" expert knowledge, and imagines that they can. And the
Wikipedia (perhaps not intentionally) panders to this attitude.
(In a way, so does any encyclopedia. But there's something
about having to physically go to the bookshelf, and lift a heavy
tome, that suggests that some work is involved. Today, you just
Google, take the first hit, and consider yourself an expert.)

I think that's an academic problem.

For I have yet to encounter anyone basing their "expert" advice, opinion
or alleged fact on simple googling or Wikipedia.

On the other hand, I've learned much from Wikipedia, but mostly of the
kind "there's much more to know but you won't find it here". E.g. I was
interested in processing RGB colors and found some very interesting
information about that, including the inability of current systems to do
violet correctly. But the experimental basis was just roughly sketched,
and not discussed in any critical way (Wikipedians have as guideline to
not present "original research", and that means criticality also goes
down the drain, throwing out baby with bathwater); the calibration
functions were not explained; and so forth; and experimenting with the
data files, using best interpretation of Wikipedia explanations and
explanation in linked-to articles, produced very awful colors. Still,
its worthwhile, you get the big picture and clear indications of what
the not-discussed parts are (where you need a textbook or research
articles or whatever, perhaps some expert). And so you can with a very
good conscience refer to Wikipedia articles as places to learn more.

Cheers,

- Alf
 
J

Juha Nieminen

James said:
From my own experience, about one article in
two contains some more or less important error. In some cases,
serious errors, which would give the reader a very false
impression of what the current state of the art is.

If that's so then it shouldn't be a problem for you to list
a couple of dozens of wikipedia pages and the errors in them.
 
B

Bo Persson

Juha Nieminen wrote:
:: James Kanze wrote:
::: From my own experience, about one article in
::: two contains some more or less important error. In some cases,
::: serious errors, which would give the reader a very false
::: impression of what the current state of the art is.
::
:: If that's so then it shouldn't be a problem for you to list
:: a couple of dozens of wikipedia pages and the errors in them.

Why not use Wikipedia for this? :)

Here's a list of pages claimed to be in great need of a cleanup:

http://en.wikipedia.org/wiki/Image:Broom_icon.svg


Or articles that are actively disputed:

http://en.wikipedia.org/wiki/Image:Circle-question-red.svg


Bo Persson
 
J

James Kanze

If that's so then it shouldn't be a problem for you to list
a couple of dozens of wikipedia pages and the errors in them.

They tend to change from one day to the next. That's the whole
problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Binding 1
Late & Early Binding 1
Early binding as an option 1
early vs late binding 2
Breaking infinite loop with key stroke 1
Option Strict On disallows late binding 1
Binding 1
data binding 1

Members online

No members online now.

Forum statistics

Threads
474,290
Messages
2,571,453
Members
48,129
Latest member
DianneCarn

Latest Threads

Top