开发者

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

开发者 https://www.devze.com 2023-04-07 12:00 出处:网络
Is there a difference between \"lazy loading\" and \"lazy evaluation\" (both of which are tags on Stack Overflow), or are they synonymous?

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

精彩评论

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

关注公众号