News for hackers. Stuff that matters.
Re:Yagni Exceptions (2021) by goto11 on Monday October 17, 2022 @07:58AM (#33232365)
Lets say I write a HTML page.

   <h1>Hello world</h1>
Is less work and complexity than:

   <h1>{{ UserMessage("Hello world") }}</h1>
Introducing this abstraction before it is needed is a waste of resources and opportunity cost. Lets say you have the first solution, and someone decides "world" should be a link. Easy, you insert an <a>-tag. In the second example such a change would be much more complicated. You have suddenly made your work much more difficult for no benefit at all.

Sure, if you discover at some point in the future that you actually need translations, then you have to work through all text and decide which strings need to be translatable. Yes, that is work, but you have done that anyway! There is no extra work. And every text which have been deleted between the abstraction was introduced and the translation became necessary, would have had an extra cost which is wasted anyway.

Re:Yagni Exceptions (2021) by valenterry on Monday October 17, 2022 @08:24AM (#33232560)
Oh, if you write HTML then you are already using semantic wrappers. I.e. you already used <h1> which clearly indicates your intend.