Late binding

Late binding

Criticism: changed "compute" to "computation" as "compute" is a buzzword and grammatically confusing.

← Previous revision Revision as of 23:03, 26 April 2026
Line 92: Line 92:
{{Original research|section|date=July 2019}}
{{Original research|section|date=July 2019}}
{{criticism section |date=May 2024}}
{{criticism section |date=May 2024}}
Late binding has poorer performance than an early bound method call. Under most implementations, the correct method address must be looked up by name with each call, requiring relatively expensive dictionary search and possibly overload resolution logic. In most applications, the extra compute and time required is negligible on modern computers.
Late binding has poorer performance than an early bound method call. Under most implementations, the correct method address must be looked up by name with each call, requiring relatively expensive dictionary search and possibly overload resolution logic. In most applications, the extra computation and time required is negligible on modern computers.


For some compilers, late binding may prevent the use of static type checking. When making a late bound call, the compiler has to assume that the method exists. This means a simple spelling error can cause a run-time error to be thrown. Modern compilers avoid this by ensuring that every possible call must have an implementation during compilation.
For some compilers, late binding may prevent the use of static type checking. When making a late bound call, the compiler has to assume that the method exists. This means a simple spelling error can cause a run-time error to be thrown. Modern compilers avoid this by ensuring that every possible call must have an implementation during compilation.