rwaldron / idiomatic.js

Principles of Writing Consistent, Idiomatic JavaScript
Other
24.67k stars 3.47k forks source link

Indent comments by one level #163

Closed bennyschudel closed 10 years ago

bennyschudel commented 10 years ago

Hey, I prefer to inline the comments by one level and I think that this helps with a better visual separation between comments and code.


  // 6.B.1
function Device( opts ) {

  this.value = null;

    // open an async stream,
    // this will be called continuously
  stream.read( opts.path, function( data ) {

      // Update this instance's current value
      // with the most recent value from the
      // data stream
    this.value = data;

  }.bind(this) );

    // Throttle the frequency of events emitted from
    // this Device instance
  setInterval(function() {

      // Emit a throttled event
    this.emit("event");

  }.bind(this), opts.freq || 100 );
}

// Just pretend we've inherited EventEmitter ;)
rwaldron commented 10 years ago

Thanks for the suggestion, but this appears to create unnecessary visual noise.