Echo JS 0.11.0

<~>
vnk 3443 days ago. link 2 points
I can't really respect an "article" which starts by stating something and then completely ignores it.

The article starts with an overly simplified definition of the term "Design Pattern". And even though it's been simplified, it then ignores it. I will not discuss how the definition is wrong (or at least half-wrong), but it is sad when you do mention both problems and solutions...

> A design pattern is a general, reusable solution to a commonly occurring problem.

...and then simply fail to explain the problem and the solution. You just present a piece of code with a one line explanation, like:

> The singleton patterns restrict the number of instantiations of a "class" to one.

or

> An object maintains a list of dependents/observers and notifies them automatically on state changes.

Really, this helps nobody. This produces code without knowledge. Mumbles incantations without any explanations. Stupid copy-pasta without understanding.

What is the need, the situation that requires "restricting the instantiations of a "class" to one"? Why would you want an object to maintain and notify a list of observers? (Also, inserting the defined inside the definition? Tsk.)

The example on Factories almost makes me cry. As all explanation, you mention that the pattern "can be really useful when the creation process is complex" and then make a create method around a constructor which assigns *one* property to the new object. I don't want to sound rude, but are you even trying?

I cannot really understand how people upvote this. But then again maybe this is related to the fact that Echojs is so empty of discussion.

Replies