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: Add section on code smell to OOP Principles lesson #29040

Open
3 tasks done
cyphersept opened this issue Nov 2, 2024 · 1 comment
Open
3 tasks done

Javascript: Add section on code smell to OOP Principles lesson #29040

cyphersept opened this issue Nov 2, 2024 · 1 comment

Comments

@cyphersept
Copy link
Contributor

Checks

Describe your suggestion

Code smell is a useful concept that should be explicitly taught much earlier, and not mentioned for the first time in a highly dense, technical article that most people struggle to read buried in the testing section.

One of the most common questions I see beginners ask is "Am I writing bad code?," and while the curriculum does a good job of explaining what good code looks like, it's much harder for beginners with little experience to evaluate whether their code meets the standard of often abstract and technical definitions, in data structures they can't easily parse yet.

Code smell allows someone to evaluate "is my code bad" without needing to think about the abstracts, using just the "feel" of their programming workflow. It's also easier to keep to the "if it ain't broke, don't fix it" school of refactoring by keeping learners focused on how their code structure is affecting their ability to work with it, instead of adhering to some theoretical technical standard that doesn't matter for their use case (looking at you, unnecessary time complexity optimizations).

I think the OOP lesson is the best place for this topic, as learners have enough projects under their belt that they'll have the context to immediately understand the ideas, and because it introduces a good code standard (SOLID). Code smell pairs nicely with this concept by helping learners identify when they might need to re-evaluate whether their code meets good standards. Generally, "is my code bad" is much easier for the brain to mentally evaluate constantly in the background, whereas "is my code good" is a much more complicated checklist that will be visited once or twice as a final check, or will otherwise bog you down with indecision and over-engineering. Code smell teaches people to re-evaluate their code quality if and only if they're having perceivable issues.

Both of these can explain the bulk of the concept, so the TOP lesson would only need to add a short introduction on how code smell fits into the coding process.

Path

Node / JS

Lesson Url

https://www.theodinproject.com/lessons/node-path-javascript-oop-principles

(Optional) Discord Name

phosphorflux

(Optional) Additional Comments

No response

@CouchofTomato
Copy link
Member

@TheOdinProject/javascript Can someone give their view on this please.

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