3 ms·
> instead of 200 ad-hoc remakes of the same thing I think that's a good argument for including the syntax, though it raises me from 'anti' to 'ambivalent'. But
by sago 11y ago
> instead of 200 ad-hoc remakes of the same thing
I think that's a good argument for including the syntax, though it raises me from 'anti' to 'ambivalent'. But yeah, figuring out random coder's favourite OOP implementation style is an annoyance. Here Crockford seems to be a bit part of the problem: he seems to recommend a whole new approach every couple of years. His recommendations to never use 'new' (and now, don't use 'this') make it a pain to use other people's objects.
I wonder if a better consensus might be the best of all worlds.
- abecedarius 11y agoWell, I was using thisless style all along, and it's nice to get company. I'm a little saddened 'class' will probably win out.
- wnevets 11y ago> he seems to recommend a whole new approach every couple of years you make that sound like a negative. If you find a 'better' way, why not use it?
- sago 11y agoIndeed, the problem is on code bases or teams with multiple ways of doing the same thing. I define new objects with. var foo = Object.create(bar); You do var foo = new Bar(); Amy does var foo = Bar(); and Ellen does var foo = Bar.create(); For many values of 'better', the advantage is much smaller than the additional burden. Thus I have no problem with him finding better ways, but his influence and his way of presenting things as the one best solution causes issues, in my experience.