On Sunday, 14 August 2016 at 23:50:23 UTC, Enamex wrote:
On Sunday, 14 August 2016 at 18:57:14 UTC, ZombineDev wrote:
Ok, maybe it's a matter of taste and opinion, but I consider
them to be bad design (idea-wise, not implementation-wise)
because they're sort of the opposite of DbI and compile-time
duck-typing. Maybe they fit nicely in Rust's world but they're
definitely something I would want NOT to use. Concepts/traits
are useless when you have DbI, because you can implement them
in a library if you need dynamic dispatch (e.g.
std.range.InputRangeObject,
std.experimental.allocator.allocatorObject, std.typecons.wrap,
etc.).
Can you demonstrate it through the example you linked to?
And sorry, what's DbI again? :D
Well, I guess it would hard for me to convince you if you don't
know what Design by Introspection means. Truth be told, when I
started learning D I also thought that concepts were the best
idea thing ever (I was coming from C++ background, though I
didn't have much experience with template metaprogramming), and
by extension Rust's traits. It was perhaps after one or two years
of using D, reviewing Phobos pull requests and watching Andrei's
talk at DConf 2015 that I was finally convinced that concepts /
traits are something not worth having.
This is one those things that need time to sink in. Just like
understanding that classic OOP is not the solution to all
problems and that maybe functional programming is something worth
looking into (i.e. it's not some academic nonsense).