Thread overview
[Issue 689] New: Clean up the spec printfs! :)
Dec 15, 2006
d-bugmail
Dec 15, 2006
Stewart Gordon
Dec 17, 2006
d-bugmail
Jul 01, 2007
d-bugmail
Jul 02, 2007
d-bugmail
Jul 03, 2007
d-bugmail
Nov 04, 2007
d-bugmail
December 15, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=689

           Summary: Clean up the spec printfs!  :)
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: jarrett.billingsley@gmail.com


We got another newcomer asking about how to successfully print things with printf() on the newsgroups again.  Being an avid anti-printf crusader, I decided to see how often printf really appeared in the specs.

I found a veritable _hornet's nest_ of heresy.

In an attempt to spread the True Way of D (writef[ln]), I hope that these vile creatures will be exiled from our fair kingdom for good.

Here's a list:

code_coverage.html
        Twice in the sieve program (and shows up in the coverage example as a
result).

cppstrings.html
        Several times in the wc program.

cpptod.html
        In the D examples in the "recursive templates" and "meta templates"
sections.

ctod.html
        In "formatted printing" it says "printf rules."  This is most certainly
not true ;)  It should say "printf is not typesafe or threadsafe and doesn't
understand most of D's types.  Use writef[ln] instead."

        In the "variadic function parameters" example.

declaration.html:
        In two examples for typeof().

dll.html:
        A printf massacre.

expression.html:
        Strangely confined to cases 1, 2, and 3 of is() expressions.

function.html:
        Two major examples in the section about D variadic arguments use printf
profusely.

html.html:
        The code uses printf.

mixin.html:
        OH MY PRINTF.  Not a single writef[ln] on the page.

overview.html:
        Again, the sieve program uses it.

statement.html:
        Lots in foreach and try-catch-finally statement examples.

template.html:
        One in the "Tuple Parameters" section.

tuple.html:
        The "Putting it all together" example has two of them.

version.html:
        One in the "debug specification" section.

phobos/std_intrinsic.html:
        Tons.

phobos/std_outbuffer.html:
        Well the class itself has printf() and vprintf() methods with no writef
alternatives, which kind of shows this class's age.



In addition, I found a few pages which don't seem to be used anymore, and can probably just be deleted:

phobos.html, std_format.html, std_openrj.html, std_stream.html

Note that these are all in the html/d directory, not html/d/phobos.


-- 

December 15, 2006
d-bugmail@puremagic.com wrote:
<snip>
> We got another newcomer asking about how to successfully print things with
> printf() on the newsgroups again.  Being an avid anti-printf crusader, I
> decided to see how often printf really appeared in the specs.
> 
> I found a veritable _hornet's nest_ of heresy.
> 
> In an attempt to spread the True Way of D (writef[ln]), I hope that these vile
> creatures will be exiled from our fair kingdom for good.  
<snip>

Indeed.  They are making D look bad.  There'll be newbies not only trying to figure how to get it to work, but also thinking "Oh h**l, D hasn't even replaced the printf abomination", when it isn't even true.

This should be made to block issue 677 when d.puremagic.com comes back to life.

Stewart.
December 17, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=689


smjg@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg@iname.com
OtherBugsDependingO|                            |677
              nThis|                            |




------- Comment #1 from smjg@iname.com  2006-12-16 20:41 -------
(Originally posted on digitalmars.D.bugs)

Indeed.  They are making D look bad.  There'll be newbies not only trying to figure how to get it to work, but also thinking "Oh h**l, D hasn't even replaced the printf abomination", when it isn't even true.


-- 

July 01, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=689


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from bugzilla@digitalmars.com  2007-07-01 13:28 -------
Fixed DMD 1.018 and DMD 2.002


-- 

July 02, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=689


smjg@iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Comment #3 from smjg@iname.com  2007-07-02 09:44 -------
The fixes for ctod.html, dll.html and mixin.html (since renamed template-mixin.html) have been mysteriously left out of the update.


-- 

July 03, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=689





------- Comment #4 from smjg@iname.com  2007-07-02 19:55 -------
That said, are the instances in dll.html anything to do with avoiding using
writef (and thereby possibly allocating GC memory or relying on objects not yet
constructed) before the GC is set up?  Even if this is so:
- It ought to be explained clearly on the page - otherwise, people are likely
to 'fix' it while trying it out.
- There still might be other suitable functions besides printf that don't rely
on anything GC-allocated.

Of course, this doesn't affect the fact that ctod.html and template-mixin.html still want fixing.


-- 

November 04, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=689


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




------- Comment #5 from bugzilla@digitalmars.com  2007-11-03 21:42 -------
Fixed dmd 1.023 and 2.007


--