Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Question about lazy vs explicit instantiation #60

Open
callumlocke opened this issue Jan 15, 2014 · 1 comment
Open

Question about lazy vs explicit instantiation #60

callumlocke opened this issue Jan 15, 2014 · 1 comment

Comments

@callumlocke
Copy link

From the docs for [Instantiation]:

Use Explicit instantiation over Lazy instantiation whenever possible.

Why? What is the downside of lazy instantiation?

@matthew-andrews
Copy link
Contributor

I believe this to be a coding style question. We use both approaches on a case by case basis within the web app. It makes no difference to what actually gets executed as the lazy approach will instantiatd fruitmachine module on your behalf:
https://github.com/ftlabs/fruitmachine/blob/master/lib/fruitmachine.js#L46.

Maybe we could consider making the documentation more neutral @wilsonpage :-)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants