On Jan 12, 2012, at 12:49 PM, Matthias Reuter wrote: >> Guidelines are opinionated by design. >> Those two in particular spread FUD. > > Actually, I find both quite useful. Could you elaborate on what parts are > "FUD" and why?
just to name few: - avoid ASI. why? better to understand how it works. - avoid assignment in conditionals. why? because of the fear that a developer can be confused? - avoid comma operator. why? same as above. - use always ===. why? and if i need coercion or to trigger valueOf? - avoid ++/--. why? very useful unary operators. - avoid bitwise operators. why? because js doesn't have integers, hence they are slow? not true any more, since js engines optimize the code. and i find bitwise math very powerful. - … and so on... Those guidelines are one by Google, and one by D.C. When you write code that has to go in Google's codebase or in D.C.'s codebase, you should/must follow their guidelines. But the same cannot be considered universally valid. If you like them, follow them. I don't like them and i use different guidelines for my codebase. When someone will have to contribute to my code, they will have to follow my guidelines. My advice is to study and understand how things works, instead of following what "guru" says. It is about expressiveness. If you fear that a future developer (or a future you) can be confused by your code, just use comments to explain how your code works. > > Matt > >> On Jan 12, 2012, at 12:24 PM, J.R. wrote: >> >>> I try to follow these two guidelines: >>> >>> - Google JS Style Guide: >>> <http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml#JavaScript_Language_Rules> >>> >>> - Douglas Crockford's code conventions: >>> <http://javascript.crockford.com/code.html> >>> >>> -- >>> Joao Rodrigues (J.R.) > > -- > Follow me on twitter.com/gweax > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/[email protected]/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/[email protected]/ > > To unsubscribe from this group, send email to > [email protected] > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
