question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is code comment removal broken?

See original GitHub issue

Forum thread: https://forum.freecodecamp.org/t/anonymous-functions-right-solutions-doesnt-pass-the-test/491397


Another example, I would expect this code to pass if the comment was removed.

const FCC = "freeCodeCamp"; // Change this line
let fact = "is cool!"; // Change this line
fact = "is awesome!";
console.log(FCC, fact); // Change this line
// var test = 'test';

challenge: https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ojeytonwilliamscommented, Mar 21, 2022

Hi there @raditotev I don’t think we want to strip js comments from challenges that use the DOM. Mostly because it increases the possibility of error (strip-comments assumes that it’s being called on code in a single language). Also because there aren’t any comments inside script tags in html challenges (to my knowledge).

I think @nhcarrigan’s approach is best - namely to refactor any tests that use getUserInput form just to use code. Once that’s done we can stop catering for getUserInput entirely.

0reactions
Nirajn2311commented, Aug 3, 2022

Fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why would removing a comment break a program? - Reddit
Most compilers should strip comments as one of their first steps, so it should usually be incredibly difficult to cause changes to emitted...
Read more >
Why is it wrong to comment out code and then gradually ...
Leaving commented code in your code base is a bad practice but that is not what you are doing if you work through...
Read more >
As a software engineer, should you always delete commented ...
In my opinion, yes. First, when you comment out code you've removed it. Leaving it clutters the code and increases the time it...
Read more >
Commenting code that is removed [closed] - Stack Overflow
Generally, code that is removed should not be commented, precisely because it clutters the codebase (and, why would one comment on something that...
Read more >
// Don't remove this comment, or the next line will break. WTF ...
// Comment formatHardDrive = true; It thought that pesky next line was still part of the comment. It wasn't literally formatting the hard...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found