Hector's blog

A sw engineer blog.

Command-Query Separation

Command Query Separation (CQS from now on) is a principle of software design that states that every method should be either a command OR a query, not both.

Struggling With This in JS

The this keyword.

A really intelligent workmate says that if you cannot explain a concept easily to someone who’s trying to learn given concept, then you don’t really know it.

In this post I will try to explain this concept for javascript. this binding is, at least for me, a constant source of confusion. I’m mainly a backend developer and when I get to see JS code I have to go back and forth reviewing how that this keyword works. Guesses, trial and error, copy-paste pattern from StackOverflow answers have not been an effective way for me to really learn what the this concept is and more importantly to miss the opportunity to leverage the real power that sits behind the concept.

Initial Commit

Don’t you cry no more

That’s the name of the song I’m listening while I started to write this post and I think is very appropiate for this week events Kansas - Carry On wayward Son.

This week I realized how profound the impact of my actions can be and the ripple effect can be either disastrous or very constructive.