You can talk about this in lots of contexts, but I'm comparing ObjectiveCee with CeePlusPlus. The former is a really neat little language - C with a bit of SmallTalk SyntacticSugar. The latter is, well, CategoryConsideredHarmful.
The two languages have about the same vintage but CeePlusPlus was much more successful because of its EarlyBinding. There were two reasons for this:
- EarlyBinding is supposedly faster because you have less hashing and indirection on method calls.
- EarlyBinding is supposedly safer because the compiler checks all your parameter signatures at compile time.
But just a moment's thought will demonstrate that both these reasons are Complete
Nonsense:
- Since anyone in their right mind knows to OptimizeLater, there's no bloody point in "fast method calls". EarlyBinding is the ugliest and most common expression of PrematureOptimization.
- Since anyone in their right mind knows to TestFirst, there's no bloody point in "explicit parametric contracts". This is because parametricization can't capture semantics - you're just as likely to make logic errors in your excruciatingly StlStyle code as you are in plain old C.
- Ah yes, but all those out-by-one and LintableBugs? will bite you in the arse.
- No, not in ObjectiveCee, which is very sensible about this. For example you can send any message you like to "Nil" and it will not fail. So long as you TestFirst the language semantics themselves will tolerate most LintableBugs?.
- It's just like all that Stroustrup nonsense about throwing derived exception classes - anyone in their right mind knows to ThrowStrings? unless you're going to use ExceptionsTidyThreads. The man's a raving loony.
Moreover,
LateBinding enables RealObjectOrientation
?. Classes are objects, and of course that's where your damn static members ought to go. This makes both ObjectDistribution
? and ObjectDelegation
? trivial to implement, so all of the horrible conniptions that C++ goes through to talk to databases and GUIs (esp. the
MicroSoft DotNet nightmares) turn into simple
NakedObjects that just work. Result: vastly tidier, more maintainable, better optimized and more elegant code. See
CocoaFramework for plentiful examples.
Conclusion: EarlyBinding is nothing but YagNi.