溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

C++基本原則是什么

發(fā)布時間:2021-11-25 15:45:31 來源:億速云 閱讀:112 作者:iii 欄目:大數(shù)據(jù)

這篇文章主要介紹“C++基本原則是什么”,在日常操作中,相信很多人在C++基本原則是什么問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”C++基本原則是什么”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

P: Philosophy(基本原則)

The rules in this section are very general.

這個分區(qū)中的規(guī)則都是一般且普遍適用的。

Philosophy rules summary:

基本原則一覽:

  • P.1: Express ideas directly in code

    直接用代碼表達(dá)想法

  • P.2: Write in ISO Standard C++

    使用ISO標(biāo)準(zhǔn)C++寫代碼

  • P.3: Express intent

    解釋意圖

  • P.4: Ideally, a program should be statically type safe

    理想情況下,程序應(yīng)該是類型安全的

  • P.5: Prefer compile-time checking to run-time checking

    編譯時檢查比執(zhí)行時檢查更好

  • P.6: What cannot be checked at compile time should be checkable at run time

    編譯時無法檢查的,應(yīng)該在執(zhí)行時檢查

  • P.7: Catch run-time errors early

    盡早捕捉執(zhí)行時錯誤

  • P.8: Don't leak any resources

    不要有資源泄漏

  • P.9: Don't waste time or space

    不要浪費(fèi)時間和空間

  • P.10: Prefer immutable data to mutable data

    不變的數(shù)據(jù)要優(yōu)于可變的數(shù)據(jù)

  • P.11: Encapsulate messy constructs, rather than spreading through the code

    壓縮凌亂的構(gòu)造,而不是通過代碼擴(kuò)散它們

  • P.12: Use supporting tools as appropriate

    恰當(dāng)?shù)厥褂弥С止ぞ?br/>

  • P.13: Use support libraries as appropriate

    恰當(dāng)?shù)厥褂弥С謳?br/>

Philosophical rules are generally not mechanically checkable. However, individual rules reflecting these philosophical themes are. Without a philosophical basis, the more concrete/specific/checkable rules lack rationale.

基本原則通常不是機(jī)械可檢查的。然而,反映這些基本原則單獨(dú)的規(guī)則是可檢查的。沒有基本原則作為基礎(chǔ),更多具體/特殊/可檢查的規(guī)則將缺少根據(jù)。

譯者注:所謂的機(jī)械檢查應(yīng)該是指使用檢查軟件通過規(guī)則進(jìn)行檢查。

到此,關(guān)于“C++基本原則是什么”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

c++
AI