Blog

Why do people not comment their code?

Why do people not comment their code?

The most common reason must be that they have misunderstood the point of comments. You’re not supposed to explain what the code does because that’s already fully defined by the actual code. You’re supposed to explain why the code is implemented that way. If that’s obvious, there’s no need to add any comments.

Are code comments bad?

Commenting code is on the generally-recognized list of code smells. But unlike most of the others on the list, comments are not always bad. Generally speaking, you should strive to minimize comments and let the code speak for itself, but it is just as important to include comments when the code cannot.

Are code comments good or bad?

READ ALSO:   What is Thanos double sword called?

How easy is it to learn coding?

The simple answer is no. Coding is not hard to learn. If you take the time and have a lot of patience, you can really learn just about anything. Learning to code takes a good amount of time and persistence, but if you have those then we guarantee you’ll get there.

How do I learn large code bases?

Let’s take a look at a few ways in which you can start to grasp a monolithic codebase.

  1. Read the Documentation. The first place I start with a new project is reading over any available documentation or README files.
  2. Read the Commit Messages.
  3. Pairing.
  4. Read the Tests.
  5. Start with the Smallest Part.
  6. Dive In.

Do HTML comments affect performance?

3 Answers. It will still increase your page size, but shouldn’t be a problem. Having 10000 lines of commented-out HTML is going to be a problem though, but keeping your comments small, should not increase the page size by too much.

READ ALSO:   Who can override a presidential veto with a 2/3 vote of support?

What makes a good code comment?

Comments are narrative asides; important in their own way, but in no way meant to replace plot, characterization, and setting. Perhaps that’s the dirty little secret of code comments: to write good comments you have to be a good writer. Comments aren’t code meant for the compiler, they’re words meant to communicate ideas to other human beings.

Should every single line of code have its own comment?

In these worlds, a coding standard that calls for that every single line of code to have its own comment is not the right answer. Neither is forgoing comments. OTOH, making comments subject to code review is exactly the right kind of standard for critical software. It makes for more reviewable and maintainable code, but this comes at a cost.

Should you remove clarification comments in your code?

You should strive to remove clarification comments and simplify the code instead because, “good code is self-documenting.” Here’s an example of a bad — though very entertaining — clarification comment.

READ ALSO:   How do I add a team member to Kaggle competition?

Is there a way to hide comments in the code?

We need our IDEs to have options for hiding comments. Maybe an option for both block and inline comment hiding separately. This way you have the best of both options. Put lots of comments in, but have the option to hide them to keep the code looking clean and uncluttered.