YUIBlog at Yahoo have a nice video on Joseph Smarr from Plaxo talking about javascript best practices. I have been saying for a long time that it is not always good to code javascript in a strictly OO fashion, but instead use namespaces for protection. In some places it is good, but the mindset with javascript should be that “How can I solve this with the fewest lines of code” and not “How can I solve this the most ‘beautiful’ way”.
Don’t get me wrong, I really like beautiful solutions, but just not when they are done with 100 lines of code to be OO, when it could be done with 10 lines.
Joseph Smarr has some other good points where he argues in a similar fashion as Yoda, “You must unlearn what you have learned”, meaning that regular coding best practices sometimes does not apply to javascript.
//Anders
