早期绑定与晚期绑定:比较的优点和缺点是什么? [英] Early binding vs. late binding: what are the comparative benefits and disadvantages?

查看:166
本文介绍了早期绑定与晚期绑定:比较的优点和缺点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在讨论计算机语言的发展时,艾伦·凯(Alan Kay)说,他的Smalltalk最重要的一个属性就是后期绑定.它使该语言具有可延展性和可扩展性,并允许不适当的耦合随着时间的流逝而重构.你同意?早期绑定是否具有补偿性的优势,可以解释为什么它似乎是两个可以使用两者的领域的主要范例?

When discussing the evolution of computer languages, Alan Kay says that the single most important attribute of his Smalltalk is late binding; it gives the language its malleability and extensibility, and allows inappropriate coupling to be refactored out over time. Do you agree? Are there compensating advantages for early binding that explain why it seems to be the dominant of the two paradigms for domains where either could be used?

基于使用javascript,jQuery,jsext,actionscript,php,java,RoR和asp.net实施Web应用程序的经验,我的个人经验(不够广泛或不够权威)结合和减少肿胀.我相信早期绑定可以帮助检测和防止某些类型安全错误,但是自动补全和良好的IDE以及一般的良好编程习惯也可以.因此,在避险方面恢复我的理性见解之前,我倾向于扎根于后期约束方面.

My personal experience (which is not broad or deep enough to be authoritative), based on implement web applications with javascript, jQuery, jsext, actionscript, php, java, RoR and asp.net seems to suggest a positive correlation between late binding and bloat reduction. Early binding I'm sure helps detect and prevent some typesafety errors, but so do autocompletion and a good IDE, and good programming practices in general. So I tend to catch myself rooting for the late binding side, before my risk-avoidance side restores my rational perspective.

但是我真的对如何权衡取舍没有很好的认识.

But I really don't have a good sense for how to balance the tradeoffs.

推荐答案

传统上,早期绑定的最大优势在于性能:后期绑定语言必须在运行时携带有关其所有数据的类型信息,而失去了这样做的机会编译时进行了一些优化.但是,随着计算机速度的提高以及虚拟机对实时优化的智能化,这种差异变得不那么重要了.

Traditionally the big advantage of early binding is for performance: a late binding language has to carry type information about all its data at runtime, and loses the opportunity to do some optimizations at compile time. This difference has become much less significant, though, as computers get faster, and as VMs get smarter about optimizing on the fly.

这篇关于早期绑定与晚期绑定:比较的优点和缺点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆