Skip to content

Manchester | 26-ITP-JAN | Abdu Mussa | Sprint 3 | dead code #1234

Open
Abduhasen wants to merge 3 commits intoCodeYourFuture:mainfrom
Abduhasen:coursework/sprint-3/3-dead-code
Open

Manchester | 26-ITP-JAN | Abdu Mussa | Sprint 3 | dead code #1234
Abduhasen wants to merge 3 commits intoCodeYourFuture:mainfrom
Abduhasen:coursework/sprint-3/3-dead-code

Conversation

@Abduhasen
Copy link

Learners, PR Template

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

-removing unreachable and redundant code
-Removing the unused code that does not contribute to the final console log.

Questions

N/A

@github-actions

This comment has been minimized.

@Abduhasen Abduhasen added 📅 Sprint 3 Assigned during Sprint 3 of this module Module-Structuring-And-Testing-Data The name of the module. labels Mar 9, 2026
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@Abduhasen Abduhasen changed the title Manchester | 26-ITP-JAN | Abdu Mussa | Sprint 3 | 3-dead-code Manchester | 26-ITP-JAN | Abdu Mussa | Sprint 3 | dead code Mar 9, 2026
@Abduhasen Abduhasen added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Optional This is an optional task to be attempted once trainees have completed the core tasks labels Mar 9, 2026
@SlideGauge SlideGauge added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Mar 15, 2026
Copy link

@SlideGauge SlideGauge left a comment

Choose a reason for hiding this comment

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

A couple of notes in task 1 to address, task 2 is well done.

// The sayHello function should continue to work for any reasonable input it's given.

let testName = "Jerry";
let testName = "Chris";

Choose a reason for hiding this comment

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

Why did we change the name?


testName = "Aman";

const greetingMessage = sayHello(greeting, testName);

Choose a reason for hiding this comment

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

greetingMessage const was not a dead code, it was used to pass it into console log. Whilst the new result more compact indeed, a line with several function calls in it is harder to read, and the task request was to remove dead code, not refactor working code.

const greeting = "hello";

function sayHello(greeting, name) {
const greetingStr = greeting + ", " + name + "!";

Choose a reason for hiding this comment

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

Nice catch this line is not needed either

@SlideGauge SlideGauge added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Mar 15, 2026
@Abduhasen Abduhasen added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Mar 16, 2026
console.log(greetingStr);
}

testName = "Aman";

Choose a reason for hiding this comment

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

what will happen if we write a new variable without let/const keyword?

@SlideGauge SlideGauge added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Mar 16, 2026
@SlideGauge
Copy link

One thing to fix please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. Optional This is an optional task to be attempted once trainees have completed the core tasks Reviewed Volunteer to add when completing a review with trainee action still to take. 📅 Sprint 3 Assigned during Sprint 3 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants