The idea of design patterns (applying patterns to programming) was presented in the late 80’s and get strength in the late 90’s, at least in the c++ world. I remember reading about it in my third company. My first thought was: “oh, men, no way, not another idiots telling me what I have to do”.

Yeah, you know. Youth.

The thing is that the design patterns idea was old when the first MVC came to internet. There are hundreds of patterns (and some of them validate the idea of “WTF are you doing, buddy?”) and in the last years internet developers are taking more and more of them to use in their crappy apps.

But, what is a design pattern? Well, remember that experiment about the water and the rook? Well, now imagine every developer looking for water, and getting the same conclusion. Wouldn’t it be nice just to apply the same formula from the start?

Now you got it. Design patterns are just a solution that we can reuse, and that can be applied to a usual problem. A software problem, in this specific case.

So, you can think? “Ey, there are multiple ways to do the things. What if I found a better solution?”. Then my answer is “Ok, good for you. Now could you be so nice to publish your solution so everyone can learn from you?”

Again, you got it. Design patterns are the effort of a bunch of developers that want to make the world (the development world) better. And there are some benefits of using them, like:

  • They provide solid solutions to common issues.
  • They can be used in any project (more or less, we’ll discuss it later)
  • They can be readapted
  • They are ‘live’, so they can be improved over time
  • They are time saving memes. You don’t need to rediscover fire when you just want to boil your potatoes
  • The solve bugs. Just because they are standardized.
  • Other developers will not have to understand your code. Because is a generical, functional, documented and maybe already used solution.

They look good, right? Now you can say: “Ok, convinced. Now why the fuck are developers that doesn’t want to understand this?”. Well, I’ll be hones. That’s because… well, how can I say it?

Because some of them are fucking difficult to understand.

Every developer has a dead-end and some of them doesn’t have time to learn every tool they need. Now some of them have kids, family, life, and they don’t want to waste ever more time in learning more tools for the work. It’s difficult, it can be frustrating, it will bring the “slow” to your apps at first…

Now that’s why. But remember: you are a developer. You need to improve. My first job was make a old-fashion-form-add-edit-delete app. I made one hundred forms for it. Then I make a autogenerated app by using text files (no JSON or XML on this days, fellows). And I feel good. And I could take some holidays. My work wasn’t perfect, but we only have to change it in one file and everything was changed.

Yeah, that where the old times. But remember: dark ages comes after Rome. Enough said.

So, in the next months I will talk about design patterns in Javascript. It will be interesting, tedious, boring and wonderful. And it will be useful for all you you. And that’s the matter.

You are a developer and you will learn until you die.

Or become a “I’m good as I am” amigo.

Your choice.