| Thread overview | ||||||||
|---|---|---|---|---|---|---|---|---|
|
August 05, 2006 The FAQ page .. | ||||
|---|---|---|---|---|
| ||||
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 .. ) | ||||
August 05, 2006 Re: The FAQ page .. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Hasan Aljudy | 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 .. )
| |||
August 06, 2006 Re: The FAQ page .. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Unknown W. Brackets | Thanks to both of you, I'll make corrections. | |||
August 08, 2006 Re: The FAQ page .. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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 bug #270) : ---- 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 | |||
August 17, 2006 Re: The FAQ page .. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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.
| |||
August 18, 2006 Re: The FAQ page .. | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | 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>. | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply