強調,突出的目的顛倒原有語序的句式而語意不變
觀察者迅速捕獲核心資訊從而消除資訊的不確定性
@array = (1, 2, 3, 4, 5);
foreach $element (@array) {
if ($element == 4) {
last;
}
print "$element\n";
}
# 邏輯複雜度高,結構層次分明
@array = (1, 2, 3, 4, 5);
foreach $element (@array) {
last if $element == 4;
print "$element\n";
}
# 緊湊簡潔,可讀性更強
# 強調價值,"附帶的條件操作"