Rant after trying Rust a bit

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 25 15:32:20 PDT 2015


On Saturday, 25 July 2015 at 02:28:49 UTC, Jonathan M Davis wrote:
> On Saturday, 25 July 2015 at 01:22:15 UTC, Tofu Ninja wrote:
>> On Saturday, 25 July 2015 at 00:49:38 UTC, Walter Bright wrote:
>>> On 7/24/2015 2:27 PM, Tofu Ninja wrote:
>>> No it isn't. Google QueryInterface(). Nobody lists all the 
>>> interfaces at the top level functions, which is that Rust 
>>> traits and C++ concepts require.
>>
>> The only time you don't use the right interface for your needs 
>> is if you plan on casting somewhere down the line. But 
>> certainly there are people who don't do that, I for one feel 
>> it's bad practice to need to use casts to circumvent the type 
>> system like that.
>
> I confess that I've always thought that QueryInterface was a 
> _horrible_ idea, and that if you need to cast your type to 
> something else like that, you're doing something wrong. 
> *shudder* I really have nothing good to say about COM 
> actually...
>
> - Jonathan M Davis

Well yes and now. When you design is new and shinny, sure, that 
is a sign that somewhere it is broken. When you are patching a 
hundred of thousand line of code, you may not be able to get the 
refactoring in all at once in a realistic manner and need to 
build some debt. Hopefully, as the refactoring progress, these 
hacks are removed, but not having just makes cost of change 
prohibitive, which is bad.


More information about the Digitalmars-d mailing list