# Code comments

You don't need comments in the code.

Shapes, classes, call signatures are [self-documenting in TypeScript](/best-practices/constraints/typescript.md). Clear names explain what is what. [Declarative code](/best-practices/source-code/declarative.md) is easy to read and reveal the flow of control and data without the prose.

There is always a better way, then adding comments. Comments rarely solve problems.

The *only exception* to this rule is to add comments to a piece of code that is unexpected or misleading but not fixable for technical reasons (for example it's 3rd party API). If it's your code, fix it.

Not writing comments doesn't mean you don't share [helpful information](/best-practices/source-code/thereadme.md) in its appropriate place.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thekarel.gitbook.io/best-practices/source-code/comments.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
