开发者

What's the difference between lazy loading and lazy evaluation?

Is there a difference between "lazy loading" and "lazy evaluation" (both of which are tags on Stack Overflow), or are they synonymous?

Response to comment: The tag wikis (which I'd looked at before asking the question) has the former referring to deferring of initialization, and the other tal开发者_JAVA技巧ked about deferring of evaluation. Is it possible to initialize something without evaluating it?


lazy evaluation refers to how expressions are evaluated. For example:

f(x) && g(x)

g(x) will not be called unless f(x) is true.

Lazy loading refers to initializing objects only when they are needed

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜