Skip to content

London | 26-ITP-May | Khaliun Baatarkhuu | Sprint 3 | Dead code - #1537

Open
khaliun-dev wants to merge 5 commits into
CodeYourFuture:mainfrom
khaliun-dev:coursework/sprint-3-dead-code
Open

London | 26-ITP-May | Khaliun Baatarkhuu | Sprint 3 | Dead code#1537
khaliun-dev wants to merge 5 commits into
CodeYourFuture:mainfrom
khaliun-dev:coursework/sprint-3-dead-code

Conversation

@khaliun-dev

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I have learnt to see what parts of code are considered unreachable and redundant. Also, saw a glimpse of what "filter → transform → aggregate" pattern looks like, with the second exercise.

Questions

None.

Removed redundant greeting string construction and unreachable console log.
Removed unused variables and functions to clean up the code.
@khaliun-dev khaliun-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 20, 2026
@tiakavousi tiakavousi added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 25, 2026

@tiakavousi tiakavousi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice work identifying the redundant and unreachable code.
One suggestion I'd make is to apply the changes directly to the original code rather than keeping both the original and the updated versions, and to remove the explanatory comments once you've finished in both excercises.

In a real codebase, reviewers should be able to quickly spot the actual changes in a pull request. Keeping dead code or temporary explanations can make the diff harder to read. Think of these exercises as if you're working on production code: clean up the redundant code, refactor where needed, and leave the file in a clean, maintainable state.

@tiakavousi tiakavousi added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Jul 25, 2026
Removed unreachable code and redundant variable.
Removed unused variables and functions to clean up the code.
@khaliun-dev

Copy link
Copy Markdown
Author

hi @tiakavousi , thank you for reviewing my PR. I have removed all the unnecessary fluff and made it a clean as possible.
Can you please have another look and, if it's good, put a "completed" label?

Cheers.

@khaliun-dev khaliun-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 25, 2026
Comment thread Sprint-3/3-dead-code/exercise-1.js Outdated
// Find the instances of unreachable and redundant code - remove them!
// The sayHello function should continue to work for any reasonable input it's given.

let testName = "Jerry";

@tiakavousi tiakavousi Jul 25, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks much cleaner now !

one small suggestion: I think this is a dead assignment, because it's overwritten before being used.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

oops , you are right. I have changed it to const to make the code cleaner.

@tiakavousi tiakavousi removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 25, 2026
Changed variable testName from 'Jerry' to 'Khaliun' and updated its declaration to const.
@khaliun-dev khaliun-dev added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 25, 2026
// The sayHello function should continue to work for any reasonable input it's given.

let testName = "Jerry";
const testName = "Khaliun";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You could keep let testName = "Khaliun" instead of changing it to const if it might be reassigned later.
From a dead code perspective, code has been cleaned up nicely.

@tiakavousi tiakavousi added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants