I disagree. I think the prototype pattern is quite well designed. It's just not well-supported across browsers. The Pseudo-Classical/Constructor pattern is the one that's broken.
Good workaround! I like it.
Indeed. I think I'll be updating the article to include your modifications. Thanks (and how should I attribute? ef4 on HN?)
A programmer trained in classical (as opposed to prototypal) languages. Languages like C++, Java, and PHP are classical. JavaScript and Self are prototypal.
Yes it should! Good catch. (This has been updated)
Simple, sure. Well-designed? Nah. And keep in mind that this is a "classical" system tacked on top of a prototypal system. Not exactly elegant.
I'm not sure it's exactly a problem. This will happen no matter which OO pattern you're using. It's just something you need to be aware of.
That is an excellent point. I mean, ideally the constructor doesn't have side effects, but this is a good defense against those that do.
I disagree. I think the prototype pattern is quite well designed. It's just not well-supported across browsers. The Pseudo-Classical/Constructor pattern is the one that's broken.
Good workaround! I like it.
Indeed. I think I'll be updating the article to include your modifications. Thanks (and how should I attribute? ef4 on HN?)
A programmer trained in classical (as opposed to prototypal) languages. Languages like C++, Java, and PHP are classical. JavaScript and Self are prototypal.
Yes it should! Good catch. (This has been updated)
Simple, sure. Well-designed? Nah. And keep in mind that this is a "classical" system tacked on top of a prototypal system. Not exactly elegant.
I'm not sure it's exactly a problem. This will happen no matter which OO pattern you're using. It's just something you need to be aware of.
That is an excellent point. I mean, ideally the constructor doesn't have side effects, but this is a good defense against those that do.