3 ms·
There is another explanation than the one given for seeing examples like this in someone else's code: // Indications of Confusion $( ".widget" ).each( func
by jccc 14y ago
There is another explanation than the one given for seeing examples like this in someone else's code:
// Indications of Confusion
$( ".widget" ).each( function() {
$( this ).css( "color", "green" );
});
I think this is at least as likely to be the remains of a block of code that was pared down and not (yet) re-implemented differently. The developer might have intended to return with replacement code and never did, perhaps this is an ongoing project on which you're a collaborator, perhaps the developer just forgot about it. It may still be bad code, but concluding wherever you find it that the reason is fundamental ignorance seems hasty.
It will always be a struggle for me to resist the bias against Other People's Code that causes me to underestimate the developer whenever I encounter something wrong. Maybe it's a minor point, but I think this bias exists in everyone and that this is an example of it.