3 ms·
Format strings are intended to be configurable (possibly per user-interface language) and not necessarily hardcoded. A strongly-typed builder API might be usefu
by layer8 5y ago
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.
- steerablesafe 5y agoThat's perhaps true, but there is no reason why we can't have both. There are many hard-coded format strings in practice.
- layer8 5y agoRight, my intent was to explain that format-string APIs are there for good reasons and not an arbitrary choice.
- yencabulator 5y ago`{year}-{month}-{date}` then.
- layer8 5y agoMore like `{numeric-year-no-leading-zeros}-{zero-padded-numeric-month}-{zero-padded-numeric-day-of-month}`. It’s virtually impossible to make it both succinct and unambiguous.
- jameshart 5y agoThe best part is your format language can be extensible to support things like inline JNDI lookups...