On Fri, Feb 09, 2018 at 05:49:31PM -0500, Nick Sabalausky (Abscissa) via 
Digitalmars-d wrote:
> On 02/09/2018 05:20 PM, H. S. Teoh wrote:
> > 
> > Sadly, these days it seems almost every other day somebody else
> > stumbles into a problem to which string mixins seem to be the
> > default answer.
> > 
> 
> Really? That's not been my perception.
> 
> From what I've seen, anything that requires the user to mixin a
> string, is pretty much automatically granted the black mark of death -
> no one will touch it.

Well no, the mixin is not exposed to the user.

But I do see it used quite a lot inside libraries, specifically Phobos.
Well, "quite a lot" is not a fair statement; perhaps I should better say
"more often than it probably should be".  While a mixin-based hack
certainly gains brownie points for cleverness, in the long term it
incurs a maintainability cost, and sometimes a hefty one.  If the mixin
is of significant length, it can be a nightmare to debug / fix / extend.
(And I say that because, yes, to my shame I've also done that in my own
code.)


T

-- 
To provoke is to call someone stupid; to argue is to call each other stupid.

Reply via email to