Skip to content

Conversation

@hjmjohnson
Copy link
Member

Replace #190 with recommendations implemented.

Follow-up to ITK pull request
InsightSoftwareConsortium/ITK#3713 commit
InsightSoftwareConsortium/ITK@69151c3
"STYLE: Remove backslash + indent from literals, to avoid unwanted spaces"

Follow-up to ITK pull request
InsightSoftwareConsortium/ITK#3713 commit
InsightSoftwareConsortium/ITK@69151c3
"STYLE: Remove backslash + indent from literals, to avoid unwanted spaces"
@github-actions github-actions bot added area:Appendices Issues affecting the Appendices part language:LaTeX Changes to LaTeX code type:BookStyle Changes to book style files type:Documentation Documentation improvement or change labels Jan 16, 2026
@hjmjohnson
Copy link
Member Author

@N-Dekker, I was unable to write to your branch, so I created this new PR with the recommended updates.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a new coding style guideline about using backslashes as line continuation characters in C++ code. The guideline warns about readability issues and unintended consequences when using backslashes, particularly in comments and multi-line string literals.

Changes:

  • Added a new "Backslashes" section to the coding style guide
  • Provided concrete examples showing problematic backslash usage and better alternatives
  • Established that backslashes are discouraged in standard C++ code but allowed in preprocessor macros

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

\small
\begin{minted}[baselinestretch=1,fontsize=\footnotesize,linenos=false,bgcolor=ltgray]{cpp}
// Wil we go to sleep or not? \
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in the code comment: "Wil" should be "Will".

Suggested change
// Wil we go to sleep or not? \
// Will we go to sleep or not? \

Copilot uses AI. Check for mistakes.
Comment on lines +3297 to +3298
Backslashes are allowed when defining a lengthy preprocessor macro definitions to allow for
improved readability when it spans multiple lines.
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar issue: "macro definitions" is redundant when preceded by "preprocessor macro". Either use "preprocessor macro definitions" or "macros" (removing "definitions"), or simply "lengthy preprocessor macros".

Suggested change
Backslashes are allowed when defining a lengthy preprocessor macro definitions to allow for
improved readability when it spans multiple lines.
Backslashes are allowed when defining lengthy preprocessor macros to allow for
improved readability when they span multiple lines.

Copilot uses AI. Check for mistakes.
\end{minted}
\normalsize
The use of a backslash as line continuation character is discouraged in standard c++ code blocks.
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent capitalization: "c++" should be "C++" to match the capitalization used elsewhere in the document (see line 3267 where "C++" is correctly capitalized).

Suggested change
The use of a backslash as line continuation character is discouraged in standard c++ code blocks.
The use of a backslash as line continuation character is discouraged in standard C++ code blocks.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Appendices Issues affecting the Appendices part language:LaTeX Changes to LaTeX code type:BookStyle Changes to book style files type:Documentation Documentation improvement or change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants