14

I have been learning NodeJS recently.

It seems to be standard in the Node world to write code with commas first:

var connect = require('connect')
  , HTTPSServer = require('./https')
  , HTTPServer = require('./http')
  , Route = require('./router/route')

I don't like it and my code editor via JSLint throws countless errors.

My question is: is there a justifiable reason why "nodesters" are doing this or is it just a cool new style?

Until now I have been "correcting" it by putting the commas back "where they should be" to comply with JSLint.

But it occurred to me recently that this approach is not very sustainable, especially if I am going to make use of more community modules.

Geoffrey
  • 5,407
  • 10
  • 43
  • 78
jamjam
  • 3,171
  • 7
  • 34
  • 39

1 Answers1

18

Generally, it makes for cleaner looking code (subjective), and easy spotting of errors. Happy reading

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308