什么是Glue Code?

在编程资料中,经常会看到Glue Code这个词组。

Glue的意思是“胶水,粘合剂”的意思,那么顾名思义,Glue Code就是粘合代码的意思。

更确切的讲,按照维基百科上的解释:

In programming, glue code is code that does not contribute any functionality towards meeting the program's requirements, but instead serves solely to "glue together" different parts of code that would not otherwise be compatible.

翻译过来,大概意思就是:

在编程中,用glue code所描述的代码并不用来实现程序所需要的任何功能,它仅仅用来将多段代码粘合在一起,从而不至于产生兼容性问题。

回应此文

你也可以选择引用此文章.