www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - The FAQ page ..

reply Hasan Aljudy <hasan.aljudy gmail.com> writes:
This has probably been brought up more than once! but oh well,
The faq page is misleading,
http://digitalmars.com/d/faq.html
It's old, contains false and/or useless statements, such as this:

[quote]
Why is [expletive deleted] printf in D?

printf is not typesafe. It's old fashioned. It's not object-oriented. 
It's not usable with user-defined types. printf is guilty as charged. 
But it's just so darned useful. Nothing beats it for banging out a quick 
dump of a value when debugging.

Note: printf is actually not really part of D anyway, but since D 
provides easy access to C's runtime library, D gets it when needed.

[/quote]

Shouldn't the answer to that should be more like:
printf is not part of D, and its use is *not* recommended, use 
std.stdio.writef and std.stdio.writefln isntead.


and:
[quote]
Will D be open source?

The front end for D is open source, and the source comes with the 
compiler. There is a SourceForge project underway to create a Gnu 
implementation of D from this.
[/quote]
I guess gdc hasn't been released yet <g>

The question (and answer to) "How do I get printf() to work with 
strings?" is totally useless and misleading. I was a victim of it for a 
long time .. that is, before I discovered writefln, which wasn't at the 
time mentioned very much on the site, if ever.
If the question must stay, then shouldn't the answer be something like 
"Just use writef, it works with D string automagically!".

That's all I found (for now at least .. )
Aug 05 2006
parent reply "Unknown W. Brackets" <unknown simplemachines.org> writes:
Under:

When should I use a foreach loop rather than a for?

This example:

T* end = &foo[length];
for (T* p = &foo[0]; p < pend; ++p)

Is incorrect.  It should be:

T* pend = &foo[length];
for (T* p = &foo[0]; p < pend; ++p)

The same mistake repeats in the next example.

-[Unknown]


 This has probably been brought up more than once! but oh well,
 The faq page is misleading,
 http://digitalmars.com/d/faq.html
 It's old, contains false and/or useless statements, such as this:
 
 [quote]
 Why is [expletive deleted] printf in D?
 
 printf is not typesafe. It's old fashioned. It's not object-oriented. 
 It's not usable with user-defined types. printf is guilty as charged. 
 But it's just so darned useful. Nothing beats it for banging out a quick 
 dump of a value when debugging.
 
 Note: printf is actually not really part of D anyway, but since D 
 provides easy access to C's runtime library, D gets it when needed.
 
 [/quote]
 
 Shouldn't the answer to that should be more like:
 printf is not part of D, and its use is *not* recommended, use 
 std.stdio.writef and std.stdio.writefln isntead.
 
 
 and:
 [quote]
 Will D be open source?
 
 The front end for D is open source, and the source comes with the 
 compiler. There is a SourceForge project underway to create a Gnu 
 implementation of D from this.
 [/quote]
 I guess gdc hasn't been released yet <g>
 
 The question (and answer to) "How do I get printf() to work with 
 strings?" is totally useless and misleading. I was a victim of it for a 
 long time .. that is, before I discovered writefln, which wasn't at the 
 time mentioned very much on the site, if ever.
 If the question must stay, then shouldn't the answer be something like 
 "Just use writef, it works with D string automagically!".
 
 That's all I found (for now at least .. )
Aug 05 2006
parent reply Walter Bright <newshound digitalmars.com> writes:
Thanks to both of you, I'll make corrections.
Aug 05 2006
next sibling parent Bruno Medeiros <brunodomedeirosATgmail SPAM.com> writes:
Walter Bright wrote:
 Thanks to both of you, I'll make corrections.
I know one more in http://digitalmars.com/d/cpptod.html ,Type Traits, the following D code is wrong in one or more ways (this is where I found ---- template IsFunctionT(T) { static if ( is(T[]) ) const int IsFunctionT = 1; else const int IsFunctionT = 0; } void test() { typedef int fp(int); assert(IsFunctionT!(fp) == 1); } ---- -- Bruno Medeiros - MSc in CS/E student http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
Aug 08 2006
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
Walter Bright wrote:

 Thanks to both of you, I'll make corrections.
And a typo in the process I see: "The runtime library is completely open sourc." While we're on this topic, what are your plans for finally updating ctod.html to the fact that writef exists? Stewart.
Aug 17 2006
parent Walter Bright <newshound digitalmars.com> writes:
Stewart Gordon wrote:
 Walter Bright wrote:
 
 Thanks to both of you, I'll make corrections.
And a typo in the process I see: "The runtime library is completely open sourc."
I'll fix it.
 
 While we're on this topic, what are your plans for finally updating 
 ctod.html to the fact that writef exists?
Some day <g>.
Aug 18 2006