News for hackers. Stuff that matters.
Re:Advanced JavaScript Techniques by slice on Friday October 09, 2009 @02:13PM (#872086)
The lazy function technique can easily become an example of bad coding practice. Code needs to be easy to read, understand, and maintain. In most cases solution 2 is good enough, in all cases it's much simpler.

Advanced techniques should only be used when there is a clear justification to sacrifice simplicity. It is disastrous when developers use so-called "advanced" technique only to entertain themselves and show-off.

You are judged not by the niftyness of your code, but by the availability, maintainability, stability and functionality of your system as a whole.

Re:Advanced JavaScript Techniques by kls on Friday October 09, 2009 @02:50PM (#872174)
Code needs to produce predictable results without bugs. All other qualities are secondary. Good code without bugs is well encapsulated and should work as a black box. Elegance is secondary to reliability. I am not saying that it is not important, just not as important as reliability. As a general rule of thumb less lines of code translates into higher reliability. I know it does not apply to every case but it is a good starting point.