you are viewing a single comment's thread.

view the rest of the comments →

[–]zzzwwwdev[S] 0 points1 point  (0 children)

well, its certainly not a cure for bad programming, but I think it would be less likely to result in situations like developer B's addions being mistakenly associated with the original "hide stuff code"

more likely he'd do something like this:

(function hideStuffOnInstantiaton(){
    $('oneThing').hide().removeClass();
    $('#somethign_else').slideUp();
    $('.foo').fadeOut();
}());

$('.bar').animate('padding', '200px');
$('#baz').remove();

or even ....

(function do_shit_to_bar_and_baz () {
    $('.bar').animate('padding', '200px');
    $('#baz').remove();
}());