3 ms·
value.indent() .exclaim() .reverse() .underline() .capitalize() There’s always the OOP version of method chaining!
by williamcotton 3y ago
value.indent()
.exclaim()
.reverse()
.underline()
.capitalize()
There’s always the OOP version of method chaining!
- jonahx 3y agoThis won't look as good when you include all the boilerplate which defines those methods, and which needs to be repeated or otherwise included for every "value" type. You don't have to worry about this when they are pure utility functions.
- mhink 3y agoWhich is great until Prettier, in its infinite wisdom, decides it's better to stick four of these function invocations on one line and two on the next, so you have an obnoxious mishmash of tokens!
- pzmarzly 3y agoWhich is a problem of Prettier. I wish for the day that someone builds rustfmt but for Typescript, I will happily leave Prettier and StandardJS behind. I think it could be done today with a (big) number of ESLint plugins.