picostitch
crafting (and) JavaScript

"I made it object-oriented"

Another pearl by @KevlinHenney in his Functional Programming You Already Know is his explaination of why we actually should leave out prefixes to our functions, such as get and set.

At the same time he explains better object-orientation and a more functional style.

"get" is an imperative word, it's a noise word. But it's an imperative. If you want to start thinking about things in an non-imperative way, stop using imperative words. The words influence the way you think.

And in case you are also wondering, like me, what "imperative" really means, here is wikipedia's explaination

imperative programming is a programming paradigm that describes computation in terms of statements that change a program state

And as Kevlin explains some seconds later, very well: "get" means to change something (or move around). Either 1) move money from one account to another or 2) change or move your marital state from single to married. But getting a year from a Date object does not move/change anything.

related_tweets: