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

ES6 Classes: General language/structure touch-up #28947

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

MaoShizhong
Copy link
Contributor

@MaoShizhong MaoShizhong commented Oct 12, 2024

Because

It's not too uncommon that I find people in the community expressing frustration at the complexity of the documentation in the ES6 classes lesson, despite the intro saying there's not much extra to learn. The current verbiage has also led many to question if classes are "bad" and wonder if they shouldn't be used at all/shouldn't learn about them if they're "so controversial". This may have been more relevant around ES6 release but now they're far more common and with more features added since.

It would be beneficial to rephrase some of those parts of the lesson, while also rethinking some of the assignments to try and narrow the focus on "new syntax for concepts you already know about", with extra focus on "no need to dig too deep right now either".

This PR

  • Rephrases the introduction to focus less on potential negatives and more just informing about the nature of class syntax in JS
  • Remove some LO/assignment/KC points that seem to focus less on class syntax itself and more on historic opposition to classes at the time of release
  • Restructure LO/assignment/KC points and rephrase to emphasise a simpler intent to the assigned resources
  • Warns about specific section of assigned article that's out of scope of the lesson
  • Move "composition over inheritance" parts to OOP Principles lesson, as it's more relevant there. Allows the classes lesson to focus just on ES6 classes.

Issue

Closes #28797
Closes #29061

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project curriculum contributing guide
  • The title of this PR follows the location of change: brief description of change format, e.g. Intro to HTML and CSS lesson: Fix link text
  • The Because section summarizes the reason for this PR
  • The This PR section has a bullet point list describing the changes in this PR
  • If this PR addresses an open issue, it is linked in the Issue section
  • If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • If any lesson files are included in this PR, they follow the Layout Style Guide

At this point in time, the good/bad controversies aren't so prevalent
given it's now been 9 years since ES6 release.
Many of the resources around criticising or analysing pros/cons of class
syntax appear to be within a year or two of ES6 release, and before
additional features were added, like private properties.
This content has led to several doubts about whether it's worth learning
class syntax and whether it's "bad and shouldn't be used", despite it
now being somewhat commonplace.
Removed mixins - common pain point as it goes a lot deeper than necessary at this point
More relevant topics in that lesson as opposed to class syntax.
Less focus on "using classes might not be good" and more focus on how the
underlying mechanics are still the same prototypal inheritance with different
syntax.
@MaoShizhong MaoShizhong added the Content: JavaScript Involves the JavaScript course label Oct 12, 2024
@MaoShizhong MaoShizhong requested review from a team, thatblindgeye and bycdiaz and removed request for a team and thatblindgeye October 12, 2024 17:25
@MaoShizhong
Copy link
Contributor Author

Original intention was to reduce external doc assignments and have more in-house content, but given the lesson's focus should mostly be on new syntax, that felt too close to just reproducing documentation. A less dramatic approach felt more effective here - we can always revisit if we notice new patterns of pain points in the community.

Section goes out of scope for this TOP lesson.
Original wording could be misinterpreted to mean that Player.prototype
actually is the same object as Person.prototype, instead of inheriting
from it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: JavaScript Involves the JavaScript course
Projects
None yet
2 participants