4 ms·
thats the problem with all these syntax sugar features in languages. you literally can't change them without blowing up your entire ecosystem.
by jatone 5y ago
thats the problem with all these syntax sugar features in languages. you literally can't change them without blowing up your entire ecosystem.
- djur 5y agoHow would this problem be different if Ruby did not have syntax support for regexes and instead offered a regex module in the standard library?
- FrancoisBosun 5y agoIf it isn’t syntax then it is a function/method call. By being a method call, one can define default options, allowing overridability.
- djur 5y agoThey could easily add another regex flag to indicate a "safe" regex. That really isn't the problem here. The problem is that adding a safe regex engine doesn't retroactively fix the thousands and thousands of regexes in gems which can't be unilaterally forced over to the new engine.
- jatone 4y agoactually that is the problem. no they can't 'easily' add a new flag (or they would have). it doesn't fix the problem of being broken by default and any fundamental change in behavior will lead to problems as well. the point is the language is broken fundamentally and because its syntax sugar there isn't anything you can do realistically. a function call can be replaced, deprecated, and then removed and all of that can be automated and be non-disruptive over a few releases.