Pattern is something I heard a lot in the developer community. Might be awesome to get some deeper insight what it actually is.
What is a Pattern, anyway?
Patterns are proven approach on solving over a recurring problems we might encounter during code production.
It matters because it has been tested over and over again on lots of scenarios.
Rather than having to write our own approach only to realize that it's not working as you might expected. Not saying that you shouldn't, but it would be wiser in terms of efficiency and effectivity to use an existing pattern.
Preventing minor issues (edge cases).
Applicable to lots of scenarios (not tied to a specific problem).
May decrease file size by reducing repetition also known as DRY (don't repeat yourself).
Add to a developer's vocabulary.
- Improved over time through collective experience.
Know It's Brother
Design Pattern has it's opposite, named anti-pattern.
Well, as you might guess, it is a pattern that sucks!
Apparently it has been known for quite some time that using an anti-pattern leads to destruction.
So it might be better to just avoid it.
An example of anti-pattern is using
document.write due it's capability to overwrite your whole document. Disaster indeed.
Patterns Into Sections
Patterns generally divided into three major classifications:
Take a closer look of the following image (taken from Slideshare):
I'll be covering each and every one of these into several blog posts.