Proposal: removeDirectoryRecursive should not follow symlinks

Bardur Arantsson spam at scientician.net
Tue Jan 6 06:58:44 UTC 2015


On 2015-01-06 02:16, Johan Tibell wrote:
> Let me make a wider comment about backwards compatibility. Many successful
> programming languages (e.g. Java) *never* break backwards compatibility.

That is not quite correct. They're certainly averse to it, but for
example the JDK developers changed String's fundamental behavior wrt.
whether "substring" should copy the relevant string slice or whether it
should just point into the original string. You might argue that the
semantics didn't change, but this change *did* (predictably) break quite
a few programs which suddenly experienced pathological memory allocation
behavior and crashed with OoM's where they had none before.

> They deprecate (and only if the old API is too error prone for the
> programmer) and add a new API. In my opinion breaking backwards
> compatibility is almost never worth it*. Our libraries are already full of
> #ifdefs and maintaining our core libraries (which I maintain some of) is a
> headache because the code gets worse every time we "clean it up".
> 
> * And it's only worth it sometimes because we're still a relatively small
> language, by usage.
> 

I don't disagree with the general point, but this in this case we're
talking about absurdly dangerous and incorrect behavior which (as Austin
points out is trivially exploitable by messing around in /tmp and
waiting until e.g. a "clean-tmp" cron jobs starts running). AFAICT there
isn't even a function that *does the right thing* in System.Directory!
If someone wants this crazy behavior they can damn well code it
themselves ;)

Regards,



More information about the Libraries mailing list