curriculum icon indicating copy to clipboard operation
curriculum copied to clipboard

Objects and Object Constructors: Add examples of grouping functionality with objects

Open takinabradley opened this issue 1 year ago • 15 comments

Because

I feel that the content in the Organizing Your JavaScript Code section of the curriculum rushes too quickly into all sorts of fancy features and ways to create objects, without giving learners a very great foundation on why we're bothering to teach them all that stuff in the first place.

This PR

  • Replaces the "Objects as a design pattern" section of the lesson with content showcasing how objects can be used to group functionality- and not just data.
  • The previous content that was there has been moved to a section named "Objects as a data structure"

Issue

Closes #27375

Additional Information

I do feel that this PR starts to clutter up the lesson, and that perhaps this lesson could be broken into two or three different ones- but I feel this is about the easiest way we can gently start to introduce these ideas to learners within the current structure of the curriculum.

Pull Request Requirements

  • [x] I have thoroughly read and understand The Odin Project Contributing Guide
  • [x] 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
  • [x] The Because section summarizes the reason for this PR
  • [x] The This PR section has a bullet point list describing the changes in this PR
  • [x] If this PR addresses an open issue, it is linked in the Issue section
  • [x] If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
  • [x] If any lesson files are included in this PR, they follow the Layout Style Guide

takinabradley avatar Feb 16 '24 14:02 takinabradley

The last commit expanded the idea I already had, but with more detail. This makes the lesson rather long, but is more in the spirit of the content I had in mind when creating the referenced issue.

This is also failing Markdownlint because a few descriptive links include the this keyword in inline code blocks.

takinabradley avatar Feb 18 '24 11:02 takinabradley

@takinabradley do you need a new review of your work? Also could you please resolve your conflict? Otherwise this pull request should be closed.

zachmmeyer avatar Jun 22 '24 23:06 zachmmeyer

@zachmmeyer

Yes, I still do. Other than the few nits from Josh, I haven't heard many thoughts here from other maintainers about the issue/PR.

I haven't looked at this work in months, though. Going to have to give it a re-read myself and see what I think about the work at present. I've done a good bit of reading and learning since then lol

takinabradley avatar Jun 23 '24 19:06 takinabradley

@JoshDevHub

Sorry, didn't see your comment when I checked Github. If you'd like, I'll work on separating stuff out into a separate lesson within the next couple days. I think I already have another branch where I ideated on how that would look, but I'll have to go through it again.

takinabradley avatar Jul 01 '24 13:07 takinabradley

+1 from me about separating into a lesson on the conceptual uses of objects, and a lesson on constructors. That seems like a significantly clearer approach to the two separate concerns.

This would of course also require adding the new lesson details to the JS lessons list in the web app repo, along with adding it to each pathway's JS course lessons.

mao-sz avatar Jul 01 '24 15:07 mao-sz

@JoshDevHub @MaoShizhong

I banged out the separate lesson called "Organizing Code With Objects" just now. Let me know what y'all think when you get a chance.

takinabradley avatar Jul 01 '24 15:07 takinabradley

Sorry about the extra changes. Just reading through and making small improvements to the flow between these two lessons.

takinabradley avatar Jul 03 '24 02:07 takinabradley

A few more chunks of changes there as I reread the lesson and make use of the spaciousness of a whole new lesson.

Biggest changes are the the "Objects As Machines" subsection, where I attempted to convey the ideas there in a more concrete way, and the addition of a exercise where learners are to model the behavior of a piggy bank.

takinabradley avatar Jul 23 '24 10:07 takinabradley

Also, should I update the "This PR" information to reflect the extent of the changes as they are now?

takinabradley avatar Jul 23 '24 11:07 takinabradley