Talk:Late binding

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Conflicting definitions[edit]

First sentence of the article defines Dynamic Binding/Late binding as "is a computer programming mechanism in which the method being called upon an object or the function being called with arguments is looked up by name at runtime". I.e. like a form of reflection that calls the method only known at runtime by name. Something like 'Foo.CallMethod("Bar")'; While in example section lots of examples are given that are just a Dynamic Dispatch: https://en.wikipedia.org/wiki/Dynamic_dispatch C++ for example. virtual tables are not Dynamic Binding by the definition in the first paragraph (even if the offset is not known at the compile time). AFAIK, there is no built-in Dynamic Binding mechanism in C++, though a number of frameworks provide their own (like Qt and its meta-classes). It's probably because of the confusion introduced by Java where Dynamic Dispatch is commonly used as a synonym for dynamic dispatch. --93.185.19.62 (talk) 13:02, 29 June 2017 (UTC)[reply]

Maybe the title should also change to "Late binding (programming)" because 1) the words in the term itself aren't wedded to programming, even if the term originated there; 2) there are useful generalizations, eg. to design: https://www.jnd.org/dn.mss/why_procrastination_.html or product: https://www.linkedin.com/pulse/20140902142646-11590749-the-cost-of-late-binding-decisions/

As it's a useful concept, and this short, nice term generalizes well, and the current page is software specific, it'd be good to add this qualifier and maybe add a new page for the general concept, linking to specializations eg. late binding in software.

Not good[edit]

It would be best if the authors had not mentioned duck typing and dynamic languages w.r.t. late binding. The statements are confused and confusin. It would be best if the article made reference to the article on Duck typing and refrained from comment.

Again, "performance" is criticised; as if so much software is junked/late because it doesn't go fast enough due to late binding? --Paddy (talk) 06:07, 31 January 2011 (UTC)[reply]

Even in the documentation for Visual Basic (pre .NET era) there are numerous discussions about the performance differences between early and late binding. And this is from a language that supports both. Grauenwolf (talk) 20:27, 6 February 2011 (UTC)[reply]

As for "duck typing", I included that reference because many younger developers don't know that it means exactly the same thing as late binding. If they were to read any papers on the topic dated from roughly 1960 to 2000 they would only see the terms late binding or name binding. It is only the combination of Java's misuse of the term that allowed duck typing to gain any popularity. Grauenwolf (talk) 20:30, 6 February 2011 (UTC)[reply]

Hi Grauenwolf, I wouild agree that Duck typing and late binding are similar, and that they stress different things. The article goes on to state that DT ignores types and yet many would class Python as both strongly typed and embracing DT. --Paddy (talk) 22:52, 6 February 2011 (UTC)[reply]

Late binding, name binding, duck typing, dynamic binding, dynamic dispatch[edit]

Hello. It seems to me that late binding describes what I call duck typing. If the term "late binding" is ambiguous, then by definition late binding should be a disambig, pointing to both dynamic dispatch and duck typing.

I notice there is also a separate article about name binding.

Also, dynamic binding (which arguably should redirect to late binding) points to dynamic dispatch.

Can we agree on a rational plan please?

My initial bid is: late binding to point to dynamic binding, which is a disambig pointing to both dynamic dispatch and name binding (or duck typing), and name binding is merged to duck typing and redirects to it (or vice versa, depending on what Computer Science literature does). 219.111.119.62 (talk) 09:08, 5 March 2011 (UTC)[reply]

The choice between Late Binding and Name Binding is hard, both are old terms. I suggest more research be done to choose between the two, but I personally favor Late Binding because it really is the opposite of Early Binding. The Duck Typing article has some good stuff, but the term itself isn't something I would expect to see in computer science literature prior to the turn of the century while Late Binding dates back to 1970. Grauenwolf (talk) 04:38, 11 June 2011 (UTC)[reply]

All concepts are related, but there are subtle differences. Some points to share and discuss:

Late-binding: In all of them the implementation class that will receive the message is dynamically known only at runtime, but late-binding emphasize in when point-of-view, and dynamic-binding focus on the how. That is, generally, when we talk about late-binding we are focus on when two objects links together (at runtime). When we talk about dynamic-binding we focus on the capability to load any implementation of the type late-loaded for Polymorphism. In some implementations the client even doesn't know the package (or assembly) that contains the called type because is also loaded at runtime, with the implementation class name read from a configuration file or store. Then, this full-late-binding (if you permit to introduce the term), is quite different form of late-binding because decouples physically the client to the implementation components at compile time. In that cases the whole library is interchangeable with any other one that shares the same types.

Dynamic-binding: Dynamic-binding as explained above is more related to the late-binding capability (how it is performed) to use subclasses or same types to fulfill the request.

Duck typing: I consider duck typing included in late-binding, but it's not the other way around. Duck typing doesn't use a class relations (inheritance) to polymorphism, but same interface or types), appropriate for dynamically type languages.

Name binding: Is more associated to the way late-binding is realized (using ids for late-binding and associated objects).

Dynamic dispatch: The focus is on the matching of the messages at runtime, when late-binding.

As noted above, I consider late-binding as the class that contains all other versions. But it is my vision of course. Please, discuss it. --Klodr (talk) 06:11, 7 January 2013 (UTC)[reply]

Criticism First[edit]

It seems out of the ordinary to have criticism as the first section of the article. Normally it would be last, or towards the end, at least. — Preceding unsigned comment added by 76.6.99.255 (talk) 01:13, 2 January 2012 (UTC)[reply]

No single word about C++?[edit]

virtual void func() Now what is that? Late binding, too, no? As this is on of C++'s key features, it proves how incomplete this article is because nothing has been written about it. I will add this bit. [EDIT] Now I realize what's "wrong": Late binding and dynamic dispatch are commonly used synonymously. The latter article has a comprehensive elaboration on dynamic dispatch, which even in some very common textbooks will be called "late binding" instead. -andy 77.7.101.188 (talk) 11:28, 1 December 2012 (UTC)[reply]

C++ is a language specification, not an implementation[edit]

This article seems to assume that every C++ implementation uses virtual tables to implement dynamic dispatch. However, the standard does not mandate on how to implement virtual functions, and I would not be surprised if there were some compilers that use other methods, at least in some cases, to implement virtual functions. 88.115.93.18 (talk) 19:02, 24 December 2012 (UTC)[reply]