Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory Functions: Suggested style tidy-up and phrasing tweaks #29212

Open
3 tasks done
MaoShizhong opened this issue Dec 19, 2024 · 2 comments
Open
3 tasks done

Factory Functions: Suggested style tidy-up and phrasing tweaks #29212

MaoShizhong opened this issue Dec 19, 2024 · 2 comments

Comments

@MaoShizhong
Copy link
Contributor

Checks

Describe your suggestion

The factory function lesson is a great lesson but understandably tricky given the wealth of info to be taught.

Recently I've noticed a few questions where confusion stems from not quite following or even missing some comments, or otherwise questions about why the lesson's code style differs from other lessons (in case that is a signficant factor).

I think the following tweaks can help streamline the lesson a little:

  • Reposition some comments to be above the code they directly refer to rather than below
  • Split some code blocks so that some "bare" comments become normal lesson text, aiding in visibility and separating examples addressing separate concepts/steps.
  • Adjust code style to be a little more consistent with previous lessons (e.g. using a function declaration for constructor rather than traditional func exp assigned to variable).
  • Expand very slightly on opening paragraph for the section on IIFEs to help answer the question "well why can't we just write a normal factory function then call it once instead of wrapping it in an IIFE?"

Path

Ruby / Rails, Node / JS

Lesson Url

https://www.theodinproject.com/lessons/node-path-javascript-factory-functions-and-the-module-pattern

(Optional) Discord Name

No response

(Optional) Additional Comments

No response

@CouchofTomato
Copy link
Member

Are you wanting someone to review this mate?

@MaoShizhong
Copy link
Contributor Author

MaoShizhong commented Dec 20, 2024

I'm not on the team anymore :P And since it's a slightly bigger edit to lesson content, I'd rather propose the issue nad changes and await discussion/assignment before PRing.

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

No branches or pull requests

2 participants