【Perl,PHP】LLバトルロワイヤル20【Ruby,Python】at TECH
【Perl,PHP】LLバトルロワイヤル20【Ruby,Python】 - 暇つぶし2ch848:デフォルトの名無しさん
12/02/12 10:59:48.20
>>825
そんな暗号の様なコードは読み手に不要な知識を要求するので可読性が低い
大規模開発ではこの程度のコード量の増加は誤差の範囲

def f(x, y)
    if !x.kind_of?(Integer) then
        raise TypeError
    end
    if !y.kind_of?(Integer) then
        raise TypeError
    end
    z = x + y
    if !z.kind_of?(Integer) then
        raise TypeError
    end
    return z
end

def g(x)
    if !(-1 < x && x < 1) then
        raise RuntimeError
    end
    print x
end


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch