I just use Object.create[1]. Constructor functions give the illusion of classical inheritance but JavaScript doesn't have classical inheritance and I think it's best to simply break the notion off from your brain by not using stuff that makes JS appear to be something it is not. JavaScript uses prototypes. Prototypes or just objects from which you derive other objects. Object.create makes this very obvious. Under the hood you are still using prototypes in the same way as you would by using constructor functions you just don't have to worry about the Constructor.prototype object as it is abstracted from view.
The second biggest problem with the method you are using (after performance/memory consumption) is not having access to either instanceof or isPrototypeOf. If you are doing anything complicated having access to one of those two can by crucial.
You shouldn't be defensive, I'm just another programmer like you. I (and hopefully others in this thread) just want to share my own experiences and let you know what options are out there. Feel free not to use them, find your own preferences.
The article I linked to gives a shim for Object.create if you need to target IE7/IE8. All other browsers already support it, including all mobile browsers.
Yeah, the descriptor object is, in my opinion, a design mistake when they did Object.create. Modifying property descriptors is an exceptional need, and there are other ways to do it when you have that need (Object.defineProperty and Object.defineProperties).
However, that's an optional parameter. You don't need to use it. You can just define properties like you normally would to an object. For example:
var one = Object.create(null);
one.foo = 'bar';
var two = Object.create(one);
two.fee = 'fi fo fum';
If you want extra sugar to make the definition of own properties more eloquent (by having them in a single object literal) there are libraries/snippets that will do that for you. Here is one I wrote (which is just a very small snippet around Object.create): http://code.matthewphillips.info/thingjs/
You're right, there is no need to be defensive. For some reason though I felt like being attacked here. Maybe words like 'piece of shit' (not from you) have something to do with this.
I am not used to participate in technical debates like this. All I know is that the I like the minimalistic way of OOP in JS and that it works for me. All I tried to do is share my experience. I no longer feel the need to prolong this discussion as I am no longer capable of providing arguments. I am left wondering why a perfectly reasonable way of coding JS is dismissed here so aggressively. For me hackernews has been a big dissappointment (first thread/comments here). I had hoped to either learn something new or find support for my method. Instead I have felt attacked for my opinion. As a natural response I try to defend myself; however this rhetoric gets in the way of reason and rational argumentation.
I understand how you feel, as you know programmers tend to be overly frank about their opinions on software, and it sucks to be on the receiving end of that. But if you ever want to talk about JavaScript or coding or whatever, my emails in my profile.
The second biggest problem with the method you are using (after performance/memory consumption) is not having access to either instanceof or isPrototypeOf. If you are doing anything complicated having access to one of those two can by crucial.
[1]https://developer.mozilla.org/en/JavaScript/Reference/Global...