- コードは動作するか
- 読みやすいコードか
- 標準APIにある機能を独自実装していなか
- 広く使われている外部ライブラリを独自実装していないか
- 冗長(重複)したコードは無いか
- 仕様通り実装されているか
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
extension BuildContextExtensions on BuildContext { | |
ThemeData get theme => Theme.of(this); | |
TextTheme get textTheme => theme.textTheme; | |
ColorScheme get colorScheme => theme.colorScheme; | |
DefaultTextStyle get defaultTextStyle => DefaultTextStyle.of(this); |
-
大抵のシンプル化はシステムから要素を取り除くことで実現できる
- すでに利用しなくなったリモートシステムからデータフェッチする処理を削除するだけの場合もあれば、再設計が必要になることもある
- 例えば、2つのシステムが同じリモートデータにアクセスする必要がある場合、2回フェッチする必要があるが、よりシンプルなシステムは1度だけデータをフェッチして結果をフォワードできるかもしれない
-
シンプル化は効率化である
- コンピュータ・ネットワークリソースをセーブする代わりに、エンジニアリングの時間や認知(理解)にかかる負荷を節約する => つまり、未来のリリースにとって有効
-
コードを追加することと、取り除くことは同等に祝福される
- Googleのイントラでは大量のコードを削除したエンジニアのために「Zombie Code Slayer」バッチが飾られている
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import boto3 | |
import PIL.Image | |
import torch | |
from torch.utils import model_zoo | |
import torchvision | |
s3_client = boto3.client('s3') |