On Thu, Feb 11, 2016 at 09:55:49AM -0500, Nick Sabalausky via Digitalmars-d wrote: > On 02/10/2016 02:47 PM, H. S. Teoh via Digitalmars-d wrote: > >On Wed, Feb 10, 2016 at 02:32:37PM -0500, Andrei Alexandrescu via > >Digitalmars-d wrote: > >>On 02/10/2016 02:25 PM, Nick Sabalausky wrote: > >>>I see no non-trivial cost. > >> > >>I, to, am not getting the cost story. H.S. Teoh, could you please > >>substantiate? -- Andrei > > > >Sorry, I meant technical debt. My point was that this function needs > >to provide more value than what's effectively just an alias for > >writefln("%s, %s, %s", x, y, z). > > > > Having used an equivalent to the proposed "dump" for many years (and > an inferior equivalent at that), I can attest that it definitely > provides sufficient value over write* functions. With write*, there's > always either excess verbosity that just gets in the way of my "flow", > or I can opt the succinct route and wind up looking at a dump of > numbers finding it difficult to know what number is what variable. Any > homemade wrapper/alias only creates even MORE work when trying to use > it. Anyone may be skeptical of the reasons, but it doesn't matter > because again, this is all direct personal experience, not > hypothetical theorizing. > > In short: Yes. Yes it does provide sufficient value. And the > "technical debt" is still vastly less than the time, effort and bother > of having to defend yet another clear improvement on the D perpetual > debate forums.
Fair enough. Personally, though, I find a bunch of comma-separated values very unhelpful. It would be much better if they were labelled, e.g., if: int x, y, z; dump(x,y,z); outputs: x=1, y=2, z=3 it would be much better than just: 1, 2, 3 which is unclear which values belongs to which variable. Trivial to figure out in this case, but it's not as obvious when interspersed between other program output & debug messages. But maybe that's just a matter of habit, and difference in personal debugging style. T -- Making non-nullable pointers is just plugging one hole in a cheese grater. -- Walter Bright