Tag Info

Hot answers tagged

5

Is it misleading to label classes or methods as a particular design pattern (Strategy, Mediator, etc.) if they only loosely fit that definition? It depends. If you have a singleton and it does not prevent instantiation, then it would be misleading to label it a singleton, since it's not a singleton. It's a global variable. Doing otherwise leads your ...


2

Labeling a pattern as [X] in Javadoc is really not so useful. Too many patterns are mis-applied because developers don't validate the patterns' assumptions (which are also not documented). Your Singleton example is trivial, as Singleton is more of an idiom than a design pattern. There's at least one project (http://www.jpatterns.org/) that uses Javadoc ...


2

I still think it makes sense to stick to phpDoc to document PHP code. It is the standard recommended by the php PSR project. It is also generalized into the annotations concept, as it is used for instance in Doctrine. Another argument for phpDoc is that Javascript and many other languages have it's analoguos commenting system. After much time spent to try ...


1

The article you linked says (emphasis mine): The following are common uses of this: The article doesn't say that this doesn't have other uses. In fact, it also explicitly says that it doesn't discuss another use of this: This article discusses the use of this with class instances. For more information about its use in extension methods, see ...



Only top voted, non community-wiki answers of a minimum length are eligible