Hello, Node.js community!

I've been using Node.js for about 8 months now, and have been constantly 
learning as much as I can about it as well as bettering my knowledge on JS 
as well. Its a fantastic product, and can't remember the last time I had 
this much fun hacking away at things! 

My question is in regards to OOP: Is there a "standard" or specific method 
that most of the community uses or is it mainly all just personal 
preference? I've been browsing as much code as I can on Github, looking at 
the different methods and what not. Such as Pseudo-classical, Prototypal, 
etc.

Currently I include this in my constructor(s):

function Tester(name) {
  if (!(this instanceof Tester)) {
    return new Tester(name);
  }

  this.name = name;
}

Tester.prototype.say = function () {
  console.log('Hello, ' + this.name);
}

var person = new Tester('Scott');
person.say();

To that, I have read the "Good Parts" book and some others, and also wonder 
if there is a style that's preferred based on certain methods or use-cases 
that might be deprecated or soon will be? Like getting away from the using 
'new' style of coding.

Sorry if this is such a n00b question. When I write code, programs, I just 
want to make sure that I have done my research and am doing it the right 
way, vs a "wrong?" way.

Thanks all, in advance!

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to