Skip to content

jrmoller/programming-patterns

 
 

Repository files navigation

Examples of patterns

Please take a look at the Client class for each pattern to see how it is used.

Note: The examples are without validation and should not be used as it is.

References

Principles

Remember, principles are not mandatory rules but guidelines.

Fail fast.
Do validation as early as possible.

One return statement
Only one return statement per function, multiple returns may be overlooked.

Less is more.
Remember to be explicit - Do not confuse it with shortened code which is not necessarily more readable.

Just in time.
Start small and transparent. Use patterns when requirements changes, to make it more maintainable. You do not have to begin with a pattern.

Using camelCase for abbreviations
Example: "XML Http Request" becomes "XmlHttpRequest" not "XMLHTMLRequest"

About

Programming patterns in PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%