[dmd-beta] 2.067.0-b2

Jacob Carlborg via dmd-beta dmd-beta at puremagic.com
Wed Feb 18 10:20:20 PST 2015


On 18 feb 2015, at 13:35, Martin Nowak via dmd-beta <dmd-beta at puremagic.com> wrote:

> The other problem is an unfortunately inevitable backwards incompatibility introduced by making synchronized nothrow.
> Vibe.d is one of the few programs that inherit from core.sync.*
> classes which now have nothrow lock/unlock methods.

Tango has the same problem.

> This should be understood as a lecture, how bad an idea it is to allow deriving from a class as part of the public API. It creates the strongest possible coupling with little to no chance for ABI compatibility.


Yeah. Classes and methods need to be designed to be overridden. There’s a book, Effective Java (similar to Effective C++), which recommends all methods should be final unless explicitly designed to be virtual.

That’s also a reason why, at least in Eclipse code, there are interfaces with a “2” appended because they couldn’t afford to break backwards compatibly by changing an existing interface.

-- 
/Jacob Carlborg




More information about the dmd-beta mailing list