Another WTF about TDWTF



  • Just take a look at this:

    http://www.thedailywtf.com/Utility/global.js



    You'll find a good example of  "Copy & Paste" code reutilization:

    if (sendToFriendForm.style.visibility == "hidden") {
    sendToFriendForm.style.visibility = "visible";
    sendToFriendForm.style.display = 'block';
    } else {
    sendToFriendForm.style.visibility = "hidden";
    sendToFriendForm.style.display = 'none';

    }

    if (commentMenu.style.visibility == "hidden") {
    commentMenu.style.visibility = "visible";
    commentMenu.style.display = 'block';
    } else {
    commentMenu.style.visibility = "hidden";
    commentMenu.style.display = 'none';
    }

    if (rateMenu.style.visibility == "hidden") {
    rateMenu.style.visibility = "visible";
    rateMenu.style.display = 'block';
    } else {
    rateMenu.style.visibility = "hidden";
    rateMenu.style.display = 'none';
    }

    if (searchMenu.style.visibility == "hidden") {
    searchMenu.style.visibility = "visible";
    searchMenu.style.display = 'block';
    } else {
    searchMenu.style.visibility = "hidden";
    searchMenu.style.display = 'none';}
    }




    etc... etc ... etc....


  • That's Code Reuse and VB Inheritance, fool!


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.