The power of abstractions
The other day I was doing a code review and noticed that a mechanism for i18n was added to a new project we’re working on. There was a line like this:
{ key: 'something',
label: i18n.t('something'),
value: i18n.n(user.salary, 'currency')}
This is very simple and common I’d say. Even so I left, as I so usually do, a suggestion as a comment:
Suggestion: wrap
i18n.t
andi18n.n
in an abstraction that we control.