cpp-best-practices / cpp-best-practices/cppbestpractices

Never Mix Tabs and Spaces - revisited

オープン
#77 コメント 2 件 リアクション 10 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
8.8k
フォーク
902
PR マージ指標
30日以内にマージされた PR はありません

説明

I was always in the - use only spaces - group for coding.
Until recently, when I started using clang-format. It has many options:

> UseTab (UseTabStyle)
> The way to use tab characters in the resulting file.
> Possible values:
> UT_Never (in configuration: Never) Never use tab.
> UT_ForIndentation (in configuration: ForIndentation) Use tabs only for indentation.
> UT_ForContinuationAndIndentation (in configuration: ForContinuationAndIndentation) Use tabs only for line continuation and indentation.
> UT_Always (in configuration: Always) Use tabs whenever we need to fill whitespace that spans at least from one tab stop to the next one.

Now I use the setting: ForIndentation
Which uses Tabs for indenting the the block, and if more indentation is required for aligning, then spaces are used.
So it doesn't matter wether someone has 2, 4, or 8 spaces per tab, the code is always aligned correctly.

Currently my stance is: use Tab for indenting, use space for aligning.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

ファイル、テスト、エントリーポイントのいずれも指定されていません。まず、リポジトリに既存のコーディングスタイルのガイダンスを探し、この議論について合意された結論があるかどうかを確認してください。完了とするには、適切なガイダンスに文書化された、タブとスペースに関する決定済みの方針が必要です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp
領域
documentation
issue の種類
ドキュメント
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。