What's Your Method of not forgetting the end brackets, parentheses

Posted by JMC Creative on Programmers See other posts from Programmers or by JMC Creative
Published on 2011-01-03T17:14:11Z Indexed on 2011/01/03 17:59 UTC
Read the original article Hit count: 206

disclaimer: for simplicity sake, brackets will refer to brackets, braces, quotes, and parentheses in the couse of this question. Carry on.

When writing code, I usually type the beginning and end element first, and then go back and type the inner stuff. This gets to be a lot of backspacing, especially when doing something with many nested elements like:

jQuery(function($){$('#element[input="file"]').hover(function(){$(this).fadeOut();}));

Is there a more efficient way of remembering how many brackets you've got open ?

Or a second example with quotes:

<?php echo '<input value="'.$_POST['name'].'" />"; ?>

© Programmers or respective owner

Related posts about coding-style

Related posts about efficiency