473,386 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Binding

Hi,
What is early/late binding ?

Jul 30 '07 #1
15 3076
Tom Gur wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Jul 30 '07 #2
On Jul 30, 4:04 pm, Tom Gur <gur....@gmail.comwrote:
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.

Jul 30 '07 #3
On Jul 30, 6:04 pm, Tom Gur <gur....@gmail.comwrote:
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

Jul 30 '07 #4

Neelesh Bodas <ne***********@gmail.comwrote:
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".
Jul 30 '07 #5
On Jul 30, 3:23 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Tom Gur wrote:
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?
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.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jul 31 '07 #6
James Kanze wrote:
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.
Jul 31 '07 #7
Juha Nieminen wrote:
James Kanze wrote:
>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.
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_...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.
Jul 31 '07 #8
On Jul 31, 12:34 pm, Juha Nieminen <nos...@thanks.invalidwrote:
James Kanze wrote:
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.
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.

--
James Kanze (Gabi Software) email: ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Jul 31 '07 #9
On Aug 1, 1:22 am, "Alf P. Steinbach" <al...@start.nowrote:
* James Kanze:
On Jul 31, 12:34 pm, Juha Nieminen <nos...@thanks.invalidwrote:
James Kanze wrote:
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.
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.
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.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Aug 1 '07 #10
On Jul 31, 8:24 pm, James Kanze <james.ka...@gmail.comwrote:
>
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 :-))
Aug 1 '07 #11
On Aug 1, 11:38 am, tragomaskhalos <dave.du.verg...@logicacmg.com>
wrote:
On Jul 31, 8:24 pm, James Kanze <james.ka...@gmail.comwrote:
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 ?
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.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Aug 2 '07 #12
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.
Aug 2 '07 #13
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:C...estion-red.svg
Bo Persson
Aug 2 '07 #14
Bo Persson wrote:
Here's a list of pages claimed to be in great need of a cleanup:

http://en.wikipedia.org/wiki/Image:Broom_icon.svg
"Needs cleanup" doesn't necessarily mean "contains wrong information",
just "the text is a mess and needs reformatting and rewriting". Or,
as programming nerds say, "refactoring".
Aug 2 '07 #15
On Aug 2, 11:35 am, Juha Nieminen <nos...@thanks.invalidwrote:
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.
They tend to change from one day to the next. That's the whole
problem.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Aug 3 '07 #16

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ann Morris | last post by:
INTRODUCTION One of the most powerful aspects of .NET and Windows Forms is data binding. Data binding is the process of associating user interface (UI) elements with a data source to generate a...
1
by: JD Kronicz | last post by:
Hi .. I have an issue I have been beating my head against the wall on for some time. I am trying to use late binding for MS graph so that my end users don't have to worry about having the right...
9
by: Zlatko Matiæ | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
1
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
0
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions...
6
by: Mikus Sleiners | last post by:
Is there any way to enable exception throws in VS 2005, that occur during binding operations? I am upset that i can't see exceptions that are thrown during binding operations. It's very hard to...
3
ADezii
by: ADezii | last post by:
The process of verifying that an Object exists and that a specified Property or Method is valid is called Binding. There are two times when this verification process can take place: during compile...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.