4 ms·
lua has s:gsub, which is basically the same thing... or are you saying js should've popped into existence with thousands of stdlib functions?
by snek 7y ago
lua has s:gsub, which is basically the same thing... or are you saying js should've popped into existence with thousands of stdlib functions?
- mschuster91 7y agoPHP at least is sane enough to provide the C stdlib, dito for Java. JavaScript... well, remember left-pad? That's what happens when people are forced to re invent the wheels.
- krapp 7y agoleft-pad wasn't a fault of the language, but the modern javascript ecosystem and its tools. Javascript development got along fine for years when all anyone had was JQuery plugins, no one was complaining about the lack of a C style stdlib, and no single point of failure for the entire ecosystem created an internet-wide catastrophe every week.
- ben-schaaf 7y agoEveryone complained about the lack of a C style stdlib. That's why jQuery was written and everyone used it.
- krapp 7y agoPeople complained about incompatible versions of the DOM between IE and everyone else, and about how awkward AJAX and DOM manipulation was, and those are the problems JQuery solved. That's providing a common API and mostly forcing Microsoft to follow spec, not a "C style stdlib," though. I don't think many people were upset that javascript didn't natively support, say, proper integers or static types or (ugh) "classes" or what have you, at least not until people started wanting to use javascript outside of its intended purpose.
- wruza 7y agoYou don’t count to thousand looking for: - replace all occurences, - remove n-th element, - binary search for an item, - sort an array without implicit string coercion in a good stdlib. Lua is explicitly minimalist, so it is not a good example here.