Re:Do not use 'week year': YYYY
by layer8 on Tuesday January 04, 2022 @08:42AM
(#29794580)
Format strings are intended to be configurable (possibly per user-interface language) and not necessarily hardcoded. A strongly-typed builder API might be useful, but if you need both programmatic specification and external configuration, format strings can fulfill both purposes, whereas only having a builder API doesn’t.
[ Parent
| on HN ]
The best part is your format language can be extensible to support things like inline JNDI lookups...
Re:Do not use 'week year': YYYY
by steerablesafe on Tuesday January 04, 2022 @09:02AM
(#29794810)
That's perhaps true, but there is no reason why we can't have both. There are many hard-coded format strings in practice.
Right, my intent was to explain that format-string APIs are there for good reasons and not an arbitrary choice.
Re:Do not use 'week year': YYYY
by yencabulator on Tuesday January 04, 2022 @10:31AM
(#29795791)
`{year}-{month}-{date}` then.