std.compress

Jonathan M Davis jmdavisProg at gmx.com
Wed Jun 5 14:14:52 PDT 2013


On Wednesday, June 05, 2013 20:56:12 SomeDude wrote:
> On Wednesday, 5 June 2013 at 18:36:34 UTC, David Nadlinger wrote:
> > It also doesn't utilize template constraints, reinvents
> > isRandomAccessRange && hasSlicing under a poor name, uses C
> > printf (!) in the examples, has random 2-3 letter variable
> > names (dis, dip, di, si) all over the place, …
> > 
> > David
> 
> Walter explained that calling printf allowed him not to import
> half of std. I think it's a good practice to limit dependencies
> to a reasonable minimum. Of course, it's hard to come up with a
> general rule as to what "reasonable" means here.

Given that pretty much every program is going to use std.stdio in one form or 
another, I see little point in avoiding using it. And since it's an example, 
it makes even less sense. I would even argue that using printf is bad 
practice. writeln and writefln are properly typesafe, whereas printf is not. If 
you really actually _need_ to restrict how much you're importing, then using 
printf makes sense, but in general, it really doesn't.

- Jonathan M Davis


More information about the Digitalmars-d mailing list