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

Javascript OOP Principles: Rework "Single responsibility" example #26384

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

radtradcath
Copy link
Contributor

@radtradcath radtradcath commented Sep 25, 2023

Because

The example for the 'Single responsibility' in 'OOP Principles' lesson is written in a contradictory way which may confuse students:

  • The example firstly states the incorrect way by saying "So instead of this";

  • Then proceeds to show the correct way of solving the issue by saying "You should extract all the DOM manipulation into its own module and use it like so";

  • Lastly, contradicts the above by saying "In fact - the function isGameOver shouldn’t be calling the DOM function anyway. That should go elsewhere (directly in the game-loop).";

The example must make clear that there are two issues with the given code block and address each problem separately to avoid the apparent contradiction.

This PR

  • Rework the introduction to the example stating the number of problems;
  • Address the first problem and its solution;
  • Address the second problem and its solution;

Issue

Closes #26243

Additional Information

Pull Request Requirements

  • I have thoroughly read and understand The Odin Project 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

As addressed in issue TheOdinProject#26243, the example for the Single Responsibility in the lesson was written in a contradictory way. The rework solves this problem by making clear that there are two issues with the example code, then address each problem separately.
@github-actions github-actions bot added the Content: JavaScript Involves the JavaScript course label Sep 25, 2023
@01zulfi 01zulfi requested review from a team and bycdiaz and removed request for a team September 25, 2023 17:23
Copy link
Member

@bycdiaz bycdiaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels reasonable. Thanks for the adjustment!

@bycdiaz bycdiaz merged commit 22bcfe0 into TheOdinProject:main Sep 28, 2023
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
Development

Successfully merging this pull request may close these issues.

Javascript OOP Principles: Rework "Single responsibility" example
2 participants