Git Product home page Git Product logo

customcalculator's Introduction

Custom Calculator

Launch & Start Screen

customcalculator's People

Contributors

naruwo-github avatar

Watchers

James Cloos avatar  avatar

customcalculator's Issues

【コーディング規約】これを意識すること!!!

参考

https://qiita.com/yyokii/items/4c08e0c71fb6e881c47e

フォーマット

  • 半角スペース4つ分(Text Editingで設定する)。

命名

  • 出来る限り省略された名前を付けない。
  • 副作用がない場合は、名詞を使用する。
  • 副作用がある場合は、動詞を使用する

依存関係

  • 必要最低限のものだけをimportする。(UIKitをインポートする必要がある場合は、Foundationをインポートしない。)
  • import文はOS固有のフレームワークと外部フレームワークとの間に空行を1行入れて、アルファベット順に並べる。

宣言の順序

  • class、struct、enum、extension、protocolなどの全ての宣言は // MARK: - <宣言の名前>を付ける。

アクセス修飾子

  • privateとして宣言することをデフォルトとして、必要なときだけinternalまたはpublicとして外部に公開する。

  • できる限り常にvarではなくletを使う。
  • シンタックスシュガーを使用し短く書く。
  • 必要な場合を除いて、変数やプロパティの型は宣言文の左側か右側のいずれか片側から推測できるようにする。
  • Forced Unwrappingは避ける

コメント

  • コメントは「なぜ?」という問いに答えるものであり、それ以外のことはコード自体が説明すべきである。

Collections / SequenceTypes

  • isEmpty, first, lastを使用する(indexを使用しなくても良い場合は使用しない)
  • countを使用する箇所はindicesを検討する → Off-by-oneエラーを回避できる

Self

  • selfは省略する
  • クロージャ内では[weak self]、guard let節を用いて循環参照のケアをする。 また、予期せぬクラッシュをケアする為に[unowned self]は使用しない。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.