Thuzi / facebook-node-sdk

Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
Other
737 stars 250 forks source link

Capitalization in Documentation #93

Open alanjames1987 opened 9 years ago

alanjames1987 commented 9 years ago

Should the documentation be using fb instead of FB as the variable holding the exported value of require('fb')?

var FB =  require('fb');

// VS

var fb =  require('fb');

Reasoning:

In JavaScript all functions can use the new keyword to create a new instance of that function, similar to how classes work in other languages. Functions intended to be used as classes are usually given a capital first letter to differentiate them from functions intended to be used as regular functions. This is not required but is generally a naming standard follow most JavaScript developers and encouraged in the Node community.

This library doesn't export a function but an object, which can't use the new keyword to create a new instance.

It's a minor change and probably petty but it would make the documentation more consistent with Node community practices.

dirkbonhomme commented 9 years ago

+1