Isset($_GET['foo'])



  • Oh god.

    if (
            (isset($_GET['foo']) && $_GET['foo'] == '1') ||
            (isset($_GET['foo']) && $_GET['foo'] == '2') ||         
            (isset($_COOKIE['foo']) && $_COOKIE['foo'] == 1 &&
                    ( ! isset($_GET['foo']) ||
                    (isset($_GET['foo']) && $_GET['foo'] != 0))
                    )
            )
    {
    

    I've looked at the source control logs for this code, and the person responsible for it gradually pieced this monster together over a period of several months. Each addition is accompanied by a gleefully sneering commit message deriding those who requested the extra checks. As if management's responsibility is to avoid making requests that require complex code to be written, and there is no onus on the developer to find creative ways of managing complexity. This is the work of a developer with >10 years experience, by the way.



  • He's not a developer, he's a code monkey. A code monkey with 10 years of experience, but still a code monkey.



  • This would be a classic case of "one year's experience ten times".



  • O wow, this must be one of those 10x programmers!


Log in to reply