standardization of D

Chris Nicholson-Sauls ibisbasenji at gmail.com
Thu Apr 5 13:12:04 PDT 2007



Dan wrote:
>> "Anders F Björklund" <afb at algonet.se> wrote in message 
>>> Yeah, I find that it's kinda funny that we have gone from:
>>>
>>> int main(char[][] args)
>>> {
>>>     printf("hello world\n");
>>>     return 0;
>>> }
>>>
>>> in the original D introduction and samples to the current:
>>>
>>> version (Tango)
>>> import tango.io.Console;
>>> else // Phobos
>>> import std.stdio;
>>>
>>> void main()
>>> {
>>>     version (Tango)
>>>     Cout ("Hello, World!").newline;
>>>     else // Phobos
>>>     writefln("Hello, World!");
>>> }
> 
> Wow!  That's god-awful!  I just write:
> 
> int main(){ printf("Hello World!\n"); return 0; }
> 
> It compiles, for everyone.  Those people who use Tango, write their programs only for Tango, they don't version every last fucking call off.  That would be retarded - obviously.

I can confirm this, for myself anyhow.  Although sometimes I do add a line like:
version (Tango) {} else { static assert (false, "Tango required."); }

To the tops of main modules.  Juuuuust in case.

> With libraries, the concept is that you pick one, and compile with it.  Job finished.  
> 
> The fact that D has more than one means you *get* to pick one.
> The fact that D doesn't have tons, means you can reasonably keep both the libraries on your computer in case a program you download uses one or the other.  

For one, I'm /glad/ to see two choices.  Diversity spawns (hopefully sporting) 
competition, and competition (usually) breeds innovation.  Plus, Phobos and Tango lean 
toward different programming styles.  Phobos is very imperative-paradigm dominated, while 
Tango makes extensive use of OO-paradigm designs.  If someone almost never uses OO 
programming, then Phobos plus a third-party library or two is a fine way to go.  If -- 
like me -- they tend to use an awful lot of objects, then Tango makes a nice initial 
framework.

There are other such comparisons that can be made.

> Unless you're going to cry about 30Mb?  I can give you $0.15.
> 
> Going on about how D is unstable and so bad for commercial development because it has two libraries that are both evolving...
> 
> Oh, and PS: There *IS* a feature freeze at 1.0.
> 
> D 1.0 code will compile on everyone's post 1.0 compilers.  You write for the 1.0 spec, your program will work just as it did when D 1.0 was first released.  What's the name of that compiler flag?

That switch would be '-v1' although I didn't see it anywhere in the on-site documentation. 
  Had to spawn a console and run dmd to check.

-- Chris Nicholson-Sauls



More information about the Digitalmars-d mailing list