You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
-
I can't remember where I heard it, but there is an argument that in general commented out code is not harmless as it never gets refactored. Note that this presupposes you will eventually un-comment and re-use that block of code.Peter M– Peter M2018-08-24 13:27:41 +00:00Commented Aug 24, 2018 at 13:27
-
@PeterM The point here is that it's fine as long as you get rid of it. You should not be leaving commented code in your code base. Something I often do when refactoring is comment out variables to see how many errors that creates to help me understand how much work it will be. Depending on what I intend to do, I might leave it like that until I've resolved all those issues and then finalize the change by deleting the commented code.JimmyJames– JimmyJames2018-08-24 14:48:11 +00:00Commented Aug 24, 2018 at 14:48
-
1I have several code bases I work on that are littered with TODO comments. It’s honestly not so bad because it’s usually 1-2 lines. The thing I like about TODO comments is that my IDE has a “TODO” tab near the terminal that auto-populates with that list of comments, with a preview of the comment and the file/line number. Point is, it’s useful when in a particular company they don’t gasp use Issues even though they use Git/Github. Yeah, well what can you do, try to convince management to use Git Issues instead of Google Sheets? Yeah, tried and failed. Oh well. TODO comments it is!Chris Cirefice– Chris Cirefice2018-08-27 00:05:35 +00:00Commented Aug 27, 2018 at 0:05
Add a comment
|
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you