3 ms·
It saddens me whenever a core web spec picks a sub-optimal solution purely because a 3rd party tool already picked the optimal one. I find it ironic that the c
by darrinmn 5y ago
It saddens me whenever a core web spec picks a sub-optimal solution purely because a 3rd party tool already picked the optimal one.
I find it ironic that the css "when/else" draft spec uses "if" for describing the conditional scenarios in plain english. As if the spec itself admits the syntax they are choosing is clearly sub-optimal.
- veidelis 5y agoIt was the same with Array includes and contains, wasn't it?
- kretaceous 5y agoAlso, Array.flat was chosen instead of Array.flatten because of a popular 3rd party library's function of the same name. I think it was Lodash.
- abdusco 5y agoIt was mootools. https://developers.google.com/web/updates/2018/03/smooshgate https://developers.google.com/web/updates/2018/03/smooshgate
- mananaysiempre 5y ago... And underscore/lodash use the _(...) wrapper approach pioneered by jQuery’s $(...) precisely to avoid monkey-patching builtin objects like Mootools did (as well as some others I think, but I don’t really remember).
- Izkata 5y agoPrototypeJS also had the monkey-patch approach.
- adastra22 5y agoWould if/else have been considered optimal to you if you hadn’t already been conditioned (ha!) that way by other programming languages? “When” actually seems better in a purely declarative language.
- andreareina 5y agoMaybe it's prior exposure to lisp, but I wouldn't expect "when" to have an "else" clause. Can't think of an idiomatic natural-language case with that structure either.
- IshKebab 5y agoI have never used SASS and if/else is obviously better than when/else.