liveBook · Manning

Comment

A comment is text or markup designated by a format's syntax as an annotation or non-content rather than ordinary executable or data content.

How 10 Manning books explain it

A Pythonic Adventure: From Python basics to a working web app

A code comment is explanatory text in source code that is ignored during execution and documents intent or behavior.

How it is used
Uses comments to document functions and clarify code during AI-assisted reviews and explanations.
How deep it goes
Shows docstrings and inline comments in a working function, without developing broader commenting principles.
Examples
Demonstrates comments in the Python read_menu function, including documentation, file-handling notes, and exception explanations.
What you can do after
Apply it by adding docstrings and inline comments that explain a Python function's purpose, operations, and error handling.

Read how A Pythonic Adventure: From Python basics to a working web app explains comment →

Software Testing with Generative AI

A code comment is an explanatory annotation embedded in source code that is generally ignored during program execution.

How it is used
Improves communication, API usability, automated-test maintenance, and understanding of unfamiliar code.
How deep it goes
Explains purpose, balance, prompting, and verification, but stops short of language-specific comment syntax or compiler behavior.
Examples
Uses Java Timesheet and Report API examples, generated annotations, delimiter prompts, and a follow-up data-flow visualization.
What you can do after
Apply it via LLM prompting to annotate existing code, then verify preservation, accuracy, usefulness, and alignment with implementation.

Read how Software Testing with Generative AI explains comment →

The Quick Python Book, Fourth Edition

A comment is source text ignored during program execution that explains or annotates code for human readers.

How it is used
Annotates Python code for human readers, especially when clarifying specific implementation choices.
How deep it goes
Explains # syntax, string exceptions, placement, and documentation trade-offs but stops short of interpreter internals.
Examples
Demonstrates assignments, strings containing #, function-processing comments, and a temperature-median rationale.
What you can do after
Apply comments through # syntax and choose docstrings when documentation must remain available to Python tools.

Read how The Quick Python Book, Fourth Edition explains comment →

Web Design Playground, Second Edition

Source markup that records explanatory or organizational text without displaying it as page content.

How it is used
Organizes HTML, records explanations, hides unfinished markup, and labels page sections for people reading the code.
How deep it goes
Defines comments, gives their delimiters, demonstrates section markers, and warns that source viewers can still read them.
Examples
Uses personal notes, explanatory labels, disabled markup, copyright information, and START OF HEADER or END OF HEADER markers.
What you can do after
Apply HTML comment syntax to document, organize, or temporarily hide source markup without displaying it in the browser.

Read how Web Design Playground, Second Edition explains comment →

Modern C

A comment is source text in a C program that the compiler ignores as non-executable documentation.

How it is used
Documents C code, improving readability without contributing executable behavior.
How deep it goes
Defines block and line forms and distinguishes interface from implementation documentation, without detailing compiler internals.
Examples
Uses block comments explaining a program's purpose and implementation comments recording coprimality and a theorem-based step.
What you can do after
Apply C comment syntax to document purpose, interface behavior, implementation rationale, and coding assumptions.

Read how Modern C explains comment →

Learn Rust in a Month of Lunches

A comment is source text that the compiler ignores as program instructions and that can contain explanatory or documentation text.

How it is used
Uses comments to explain code to current and future programmers without changing program instructions.
How deep it goes
Distinguishes line, block, and documentation comments with focused syntax examples, but defers advanced documentation details.
Examples
Shows inline explanations, multiline block comments, TODO reminders, and documented structs and methods.
What you can do after
Apply Rust comment syntax to annotate code and expose formal descriptions through generated documentation.

Read how Learn Rust in a Month of Lunches explains comment →

Modern C, Third Edition

A comment is source text that the C compiler ignores and that can document a program.

How it is used
Documents program purpose, interfaces, and non-obvious implementation details while remaining invisible to the compiler.
How deep it goes
Defines block and line delimiters and develops criteria for useful documentation, without descending into compiler internals.
Examples
Uses block comments, end-of-line comments, and a theorem-based rationale for advancing an approximation step.
What you can do after
Apply block and line comment syntax to document purpose and non-obvious implementation choices.

Read how Modern C, Third Edition explains comment →

Simple Object-Oriented Design: Create clean, maintainable applications

A code comment is explanatory natural-language text embedded in source code to convey rationale, behavior, caveats, or other information not expressed by the code itself.

How it is used
Clarifies decision rationale and code-block boundaries to reduce the cost of reading, maintaining, and debugging code.
How deep it goes
Explains comment purposes and refactoring tradeoffs but does not prescribe a formal comment syntax or style standard.
Examples
Uses complex conditional decisions and comment-separated code blocks, plus prompts to compare good and bad comments.
What you can do after
Evaluate/understand when a comment should preserve rationale or structure that refactoring and naming do not communicate.

Read how Simple Object-Oriented Design: Create clean, maintainable applications explains comment →

Learn SQL in a Month of Lunches

An SQL comment is text in an SQL statement or script that is ignored during execution and can document intent or context.

How it is used
Documents query intent and context for colleagues, maintainers, and the future author of a script.
How deep it goes
Explains inline and block syntax, portability, and accidental whole-query commenting, but does not detail comment parsing internals.
Examples
Uses commented SELECT queries that return random rows, recent titles, skipped rows, and an updated replacement query.
What you can do after
Apply it via SQL comment syntax to document, disable, and clarify queries without changing executable results.

Read how Learn SQL in a Month of Lunches explains comment →

Learn AI-Assisted Python Programming, Second Edition

A source-code annotation that is ignored during program execution and can provide human-readable information or instructions.

How it is used
Uses comments to document code for people and prompt Copilot to suggest code or additional comments.
How deep it goes
Defines execution behavior, human-readable summaries, and Copilot prompting, without descending into language implementation details.
Examples
Uses hash-prefixed output instructions alongside Python print statements, including a Hello Copilot example.
What you can do after
Apply comments to document Python code and prompt Copilot with plain-language programming instructions.

Read how Learn AI-Assisted Python Programming, Second Edition explains comment →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.