LoginSignup
0
1

More than 1 year has passed since last update.

C++ Core Guidelines, Bjarne Stroustrup

Last updated at Posted at 2020-03-04

<この項は書きかけです。順次追記します。>

C++ Core Guidelines

2019年12月 8日

編集者:Bjarne Stroustrup
    Herb Sutter

この記事は公式の訳ではなく、個人の理解を確認するための試訳です。
趣旨を理解することが目的で、直訳することが目的ではありません。
主語または述語を省略することがあります。
あるいは、主語または目的語を追加することがあります。

あるまとまりになったら、githubに掲載するかもしれません。

This is a living document under continuous improvement. Had it been an open-source (code) project, this would have been release 0.8. Copying, use, modification, and creation of derivative works from this project is licensed under an MIT-style license. Contributing to this project requires agreeing to a Contributor License. See the accompanying LICENSE file for details. We make this project available to "friendly users" to use, copy, modify, and derive from, hoping for constructive input.

この文書は、継続的に改善しています。公開ソース(コード)事業として、これは0.8版です。 この事業からの二次的著作物の複写、使用、修正、および作成は、MIT形式の許諾条項の下に許可しています。 この事業に貢献するには、貢献者許諾条項に同意する必要があります。 詳細は、付属の許諾(https://github.com/isocpp/CppCoreGuidelines/blob/master/LICENSE )を参照してください。 建設的な入力を期待して、この事業は「友好的な利用者」が使用、複写、変更、派生できるようにします。

Comments and suggestions for improvements are most welcome. We plan to modify and extend this document as our understanding improves and the language and the set of available libraries improve. When commenting, please note the introduction that outlines our aims and general approach. The list of contributors is here.

改善のための意見、提案は大歓迎です。 理解が向上し、言語と利用可能なライブラリを改善したら、この文書を変更し、拡張する予定です。 意見を書くときは、私たちの目的と一般的なやり方の概要を説明する序文(https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#S-introduction )に注意してください。 貢献者一覧はこちら(https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#SS-ack )です。

Problems:
The sets of rules have not been completely checked for completeness, consistency, or enforceability.
Triple question marks (???) mark known missing information
Update reference sections; many pre-C++11 sources are too old.
For a more-or-less up-to-date to-do list see: To-do: Unclassified proto-rules

課題:
一連の規則は、完全性、一貫性、または強制力について完全には検査していません。
三重疑問符(???)は、既知の欠落の印です
参照節を更新します。 多くのC ++ 11以前のソースは古すぎます。
多少なりとも最新の「だいたい・更新・やること一覧」については、やること:未分類試作規則(https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#S-unclassified )を参照してください。

You can read an explanation of the scope and structure of this Guide or just jump straight in:

この案内の範囲と構造の説明を読むか、次のように直接飛べます。

(一覧訳省略)

Abstract
This document is a set of guidelines for using C++ well. The aim of this document is to help people to use modern C++ effectively. By "modern C++" we mean effective use of the ISO C++ standard (currently C++17, but almost all of our recommendations also apply to C++14 and C++11). In other words, what would you like your code to look like in 5 years' time, given that you can start now? In 10 years' time?

この文書は、C ++を適切に使用するための一連の指針です。 この文書の目的は、人々が最新のC ++を効果的に使用できるようにすることです。 「最新のC ++」とは、ISO C ++標準(現在はC ++ 17ですが、推奨事項のほとんどすべてがC ++ 14およびC ++ 11にも適用できます)を効果的に使用することを意味します。 言い換えると、あなたは5年後にはコードをどのように見せたいと思いますか? 10年後には?

The guidelines are focused on relatively high-level issues, such as interfaces, resource management, memory management, and concurrency. Such rules affect application architecture and library design. Following the rules will lead to code that is statically type safe, has no resource leaks, and catches many more programming logic errors than is common in code today. And it will run fast -- you can afford to do things right.

この指針は、界面、資源管理、記憶管理、並行性などの比較的高水準の問題に焦点を当てています。 このような規則は、応用の構造とライブラリの設計に影響します。 規則に従うと、静的に型保証されたコードにつながり、資源漏れがなくなり、現在のコードで一般的なものよりも多くのプログラミング論理誤りを受け取れます。 そして、高速に実行します。あなたは正しいことをする余裕ができます。

We are less concerned with low-level issues, such as naming conventions and indentation style. However, no topic that can help a programmer is out of bounds.

命名規則や字下げ形式などの低水準の問題にはあまり関心がありません。 ただし、プログラマを助けない話題はありません。

Our initial set of rules emphasizes safety (of various forms) and simplicity. They may very well be too strict. We expect to have to introduce more exceptions to better accommodate real-world needs. We also need more rules.

最初の一連の規則では、安全性(さまざまな形式)と単純さを重視しています。 非常に厳しすぎる可能性があります。 実際の必要に応じて、より多くの例外を導入する必要があると予想します。 さらに規則が必要です。

You will find some of the rules contrary to your expectations or even contrary to your experience. If we haven't suggested you change your coding style in any way, we have failed! Please try to verify or disprove rules! In particular, we'd really like to have some of our rules backed up with measurements or better examples.

あなたの期待に反する、又はあなたの経験に反するいくつかの規則を見つけるでしょう。 コーディング形式の変更を提案していない場合、失敗します! 規則を検証または反証してみてください! 特に、いくつかの規則で、測定値、又はより良い例を示して応援してください。

You will find some of the rules obvious or even trivial. Please remember that one purpose of a guideline is to help someone who is less experienced or coming from a different background or language to get up to speed.

いくつかの規則は明らかであるか、ささいなものであることを見つけるでしょう。 指針の目的の1つは、経験の浅い、または異なる背景または言語を使用している人が、速くなるのを助けることです。

Many of the rules are designed to be supported by an analysis tool. Violations of rules will be flagged with references (or links) to the relevant rule. We do not expect you to memorize all the rules before trying to write code. One way of thinking about these guidelines is as a specification for tools that happens to be readable by humans.

規則の多くは、分析器で支援できるように設計しています。 規則違反は、関連する規則への参照(または連携)で旗を立てます。 コードを書く前に、すべての規則を記憶することを期待していません。 たまたま人間が読める、道具のための仕様としてこの指針を考え方てください。

The rules are meant for gradual introduction into a code base. We plan to build tools for that and hope others will too.

この規則は、コードに基づいた段階的な導入を目指しています。 私たちはそのための道具を作ることを計画しており、他の利用者もそれを期待しています。

Comments and suggestions for improvements are most welcome. We plan to modify and extend this document as our understanding improves and the language and the set of available libraries improve.

改善のための意見や提案は大歓迎です。 理解が向上し、言語と利用可能なライブラリを改善したら、この文書を変更し拡張する予定です。

In: Introduction
This is a set of core guidelines for modern C++ (currently C++17) taking likely future enhancements and ISO Technical Specifications (TSs) into account. The aim is to help C++ programmers to write simpler, more efficient, more maintainable code.

In:序文
この文書は、将来の拡張の可能性とISO技術仕様(TS)を考慮した、最新のC ++(現在はC ++ 17)の核となる指針です。目的は、C ++プログラマが簡単で、より効率的で、より保守しやすいコードを書けるようにすることです。

参考資料(reference)

優れたモダンなC++を書くのに役立つC++ Core Guidelines
https://www.infoq.com/jp/news/2015/10/cpp-guidelines-stroustrup-sutter/

Use the C++ Core Guidelines checkers
https://docs.microsoft.com/ja-jp/cpp/code-quality/using-the-cpp-core-guidelines-checkers?view=vs-2019

Cpp-Core-Guidelines
https://sites.google.com/site/kandamotohiro/cpp-core-guidelines

on Qiita

C++ Core GuidelinesとGuidelines Support Library
https://qiita.com/shohirose/items/bea42ec65b8aae871018

C++ Core Guidelines CheckerとGSLの導入
https://qiita.com/TomoyukiAota/items/28b39d77646daa74291a

on AUTOSAR

1.

Guidelines for the use of the C++14 language in critical and safety-related systems
https://www.autosar.org/fileadmin/user_upload/standards/adaptive/19-11/AUTOSAR_RS_CPP14Guidelines.pdf

B.5 Traceability to C++ Core Guidelines
Defining function- like macros is prohibited, see: A16-0-1.
The following table demonstrates the traceability to C++ Core Guidelines [11]. This is not considered as a reproduction, but a mean to compare the two standards.
Note that the copyright of C++ Core Guidelines allows a derivative work anyway.

2.

General Requirements specific to Adaptive Platform
https://www.autosar.org/fileadmin/user_upload/standards/adaptive/19-11/AUTOSAR_RS_General.pdf

の参照(reference)

[7] C++ Core Guidelines https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md

にあったため読み始めました。

Autosar list of reference, abbreviation and term.(1-47/237): English(40d)
https://qiita.com/kaizen_nagoya/items/10b0fe6530bacdf376f9

<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>

文書履歴(document history)

ver. 0.01 初稿 20200204 朝
ver. 0.02 Reference追記 20200204 正午
ver. 0.03 AUTOSAR C++ 追記 20200204 午後2時

最後までおよみいただきありがとうございました。

いいね 💚、フォローをお願いします。

Thank you very much for reading to the last sentence.

Please press the like icon 💚 and follow me for your happy life.

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1