Optimizing Swift code for separation of concerns and simplicity #tryswiftconf
- akatsuki174
- 1221
- 0
- 0
- 0
@Javi raising some really good points about Separation of Concerns. #tryswiftconf pic.twitter.com/VH7BoQ9Nrh
2018-03-01 12:03:21「How からwhatを切り離す」ってコードレビューするときに使うとわかってもらえそうでいいフレーズだ。#tryswiftconf
2018-03-01 12:03:28Kitura tutorial #tryswiftconf ブースが隣の IBM のエンジニアの方に Kitura をがっつり教えてもらった! pic.twitter.com/ReGiYcBCke
2018-03-01 12:04:18# Example1 - utf16.countして、範囲外か確認する - なんでutf16を数えたのかを数ヶ月後にすぐ思い出せるようにしたい - characterCountUsingBackendPolicy: Int - return utf16.count - let characterLimit = 140 - sendButton.isEnabled = characters <= characterLimit #tryswiftconf
2018-03-01 12:06:27#tryswiftconf @Javi about writing good Swift by separating concerns without adding complexity: “[Code is read much more than it’s written. If I read this code in the future, how easy will it be to understand?]” pic.twitter.com/wnwabSemrA
2018-03-01 12:06:58var filteringBlockedContent: [Reply] ブロックしているコンテンツかどうかを分離 #tryswiftconf
2018-03-01 12:08:03例文だからだろうけどちょっとtoo muchなように感じるなぁ。これなら extension 煮切り出さなくても filter とコメントとかで対応できる気がしちゃう。 #tryswiftconf
2018-03-01 12:08:05Next example is AutoLayout. AutoLayout is pretty verbose so it can lead to obscure codes #tryswiftconf
2018-03-01 12:08:14OSやSwiftのAPIを直接呼び出すところを、その場面に応じた意味のある拡張メソッドに置き換えると、あとで見た時に何をやっているかわかりやすいってことか #tryswiftconf
2018-03-01 12:08:27Operators can be pretty useful to make codes readable #tryswiftconf
2018-03-01 12:08:54