I had code where I add some height to a div:
$('#some_id').height($('#some_id').height() + 100);
I was criticized for this by an employer, who said I shouldn't be using the selector twice. I should cache the first time by doing something like:
var el = $('#some_id');
el.height(el.height() + 100);
I assumed there would only be a tiny saving if I cached elements selected using id, so I never bothered. Am I right?