May 04, 2006
Dave wrote:
> 
> An idea for whatever the style outcome - post a link to something like this somewhere, or otherwise a "Sample Code" page. The idea would be to provide people in a hurry (a) nice short example(s) showing some of the primary D features. For example, I would think this would be something C++ coders could quickly scan and be intrigued by:

(Excellent demo code deleted.)

Yes, that's an excellent idea!!

And your code looked very good. This is probably the best way to give a seasoned C++ guy a heavy-duty teaser, and make him drool. All within 60 seconds. Definitely more efficient than reams of explanations and superlatives. And more believable than any "who gets most ticks in a contrived comparison chart".

Absolutely a link to this from David Giledis draft!
May 04, 2006
David Gileadi wrote:
> nick wrote:
>  >> What we need is a dprogramming.com marketing site, with examples,
>  >> tutorials, a beginniner package, and flashy stuff.

True.

>  > I will donate an existing layout or make a new one.

From what the mockup looks like, you'd be a good choice for the job!

> Here's a mockup I've started, having been thinking much along the same lines as Kyle.  It's loosely based on www.mono-project.com  Hopefully it can help the discussion.
> 
> http://img114.imageshack.us/my.php?image=mockup5ey.jpg (forgive the imageshack hosting)

It really looks nice! It kind of immediately invites you to pay a visit.

Oh, and that particular style also (IMHO) reflects seriousness, dependability, real professionals behind it, and overall something that isn't dying away tomorrow.

> Obviously the front page needs a lot more content.  I was thinking that the "What is D?" section should have links to the following:
> 
>   - Comparison
>   - Examples
>   - FAQ
>   - Docs
>   - License
> 
> I also think there should be a small section before or after giving a quick explanation of what D is, why I should use it, maybe what platforms it works on, etc.
> 
> The "What's New" section might contain the latest releases from the changelog as well as any community announcements (maybe culled from d.announce). 

Definitely!

It's just imperative that the page contains something "new" or "fresh" each time you go see it. Stale pages are "so Eighties". ((I know the WWW was only invented in the nineties.))

> Of course this would require someone to maintain the list :)
> 
> Finally I beg Walter's forgiveness for modifying the DigitalMars logo. I just think it looks better this way :)

FWIW, I too think your version of the DM logo looks a lot better.

It's also more balanced. And it puts fewer restraints on using it in different sizes tha the original, where the graphic quickly gets too small, or the word Mars too big. And it looks more like it's been designed by professionals. ((Sorry, Walter!))
May 04, 2006
nick wrote:
> nick wrote:
>> I threw together a very quick mockup in html/css and just copy pasted
>> some content into that shell. It could looks tons better with more than
>> 15 minutes worth of work:
>>
>> http://hcoop.net/~natamas/random/tabs.png
> 
> Had a bit more time so I followed up on that previous layout(Try
> changing the font size: ctrl+wheel.):
> 
> http://hcoop.net/~natamas/d/template.html
> 
> 
> I'll admit it up front, there is 1 table in there so that I don't have
> to do any crazy CSS hacks.
> 
> Any criticism? (too dark, D too big, etc.)
> Anyone interested in using something like this?
> 

Get rid of the D at the top and when you click on links make sure the box outline doesn't show up. Other than that it's good.
May 04, 2006
Georg Wrede wrote:
> David Gileadi wrote:
>> nick wrote:
>>  >> What we need is a dprogramming.com marketing site, with examples,
>>  >> tutorials, a beginniner package, and flashy stuff.
> 
> True.
> 
>>  > I will donate an existing layout or make a new one.
> 
>  From what the mockup looks like, you'd be a good choice for the job!

Thanks for the kind words!  I'm a bit short on time right now--taking three classes this summer and working full time--so that's why I posted the unfinished version.  However if there's interest I'll definitely continue work on this.

>> Here's a mockup I've started, having been thinking much along the same lines as Kyle.  It's loosely based on www.mono-project.com  Hopefully it can help the discussion.
>>
>> http://img114.imageshack.us/my.php?image=mockup5ey.jpg (forgive the imageshack hosting)
> 
> It really looks nice! It kind of immediately invites you to pay a visit.
> 
> Oh, and that particular style also (IMHO) reflects seriousness, dependability, real professionals behind it, and overall something that isn't dying away tomorrow.
> 
>> Obviously the front page needs a lot more content.  I was thinking that the "What is D?" section should have links to the following:
>>
>>   - Comparison
>>   - Examples
>>   - FAQ
>>   - Docs
>>   - License
>>
>> I also think there should be a small section before or after giving a quick explanation of what D is, why I should use it, maybe what platforms it works on, etc.
>>
>> The "What's New" section might contain the latest releases from the changelog as well as any community announcements (maybe culled from d.announce). 
> 
> Definitely!
> 
> It's just imperative that the page contains something "new" or "fresh" each time you go see it. Stale pages are "so Eighties". ((I know the WWW was only invented in the nineties.))
> 
>> Of course this would require someone to maintain the list :)
>>
>> Finally I beg Walter's forgiveness for modifying the DigitalMars logo. I just think it looks better this way :)
> 
> FWIW, I too think your version of the DM logo looks a lot better.
> 
> It's also more balanced. And it puts fewer restraints on using it in different sizes tha the original, where the graphic quickly gets too small, or the word Mars too big. And it looks more like it's been designed by professionals. ((Sorry, Walter!))
May 04, 2006
clayasaurus wrote:
> nick wrote:

> Get rid of the D at the top and when you click on links make sure the box outline doesn't show up. Other than that it's good.

Yeah, I can see that the big D is getting no love at all.

The boxes around the links is firefox's doing; not mine. They don't show up in IE (or Safari if I recall correctly). Firefox draws a box around every link you click. If there is a hack around that, let me know and I'll put it in.
May 04, 2006
Dave wrote:
> An idea for whatever the style outcome - post a link to something like this somewhere, or otherwise a "Sample Code" page. The idea would be to provide people in a hurry (a) nice short example(s) showing some of the primary D features. For example, I would think this would be something C++ coders could quickly scan and be intrigued by:

I think this is very good. Can I use it, or perhaps you can put it on wikipedia?

> #!/usr/bin/dmd -run
> /* sh style script syntax is supported! */
> 
> /* Hello World in D
>    To compile:
>    dmd hello.d
>     or to optimize:
>    dmd -O -inline -release hello.d
> */
> 
> import std.stdio;
> 
> void main(char[][] args)
> {
>     writefln("Hello World, Reloaded");
> 
>     // auto type inference and built-in foreach
>     foreach(argc, argv; args)
>     {
>         // OOP!
>         CmdLin cl = new CmdLin(argc, argv);
>         // improved printf!!
>         writefln(cl.argnum, cl.suffix, " arg: %s", cl.argv);
>         // Garbage Collection or explicit memory management!!!
>         delete cl;
>     }
> 
>     // Nested structs, classes and functions!
>     struct specs
>     {
>         // all vars. automatically initialized
>         int count, allocated;
>     }
> 
>     specs argspecs(char[][] args)
>     {
>         specs* s = new specs;
>         // no need for '->'
>         s.count = args.length;
>         s.allocated = typeof(args).sizeof; // built-in properties for native types
>         foreach(argv; args)
>             s.allocated += argv.length * typeof(argv[0]).sizeof;
>         return *s;
>     }
> 
>     // built-in string and common string operations
>     writefln("argc = %d, " ~ "allocated = %d",argspecs(args).count,argspecs(args).allocated);
> }
> 
> class CmdLin
> {
>     private int _argc;
>     private char[] _argv;
> 
> public:
>     this(int argc, char[] argv)
>     {
>         _argc = argc;
>         _argv = argv;
>     }
> 
>     int argnum()
>     {
>         return _argc + 1;
>     }
> 
>     char[] argv()
>     {
>         return _argv;
>     }
> 
>     char[] suffix()
>     {
>         char[] suffix = "th";
>         switch(_argc)
>         {
>         case 0:
>             suffix = "st";
>             break;
>         case 1:
>             suffix = "nd";
>             break;
>         case 2:
>             suffix = "rd";
>             break;
>         default:
>         }
>         return suffix;
>     }
> }
May 04, 2006
nick wrote:
> Yeah, I can see that the big D is getting no love at all.
> 

It'll probably involve more tables to get this done well enough, but I suggest moving it to the top of the sidebar currently at the left. Then you can bump the rest of the page up quite a bit, only the menu being somewhat lower than the rest. D'll still be at the top, but not in the way, like it currently is. You might have to make it a bit smaller for it to fit properly, but I don't think that matters.

Also, I'd suggest an <img> tag with alt text instead of a background image as it currently is: with images off, or a browser that doesn't show them at all, there's nothing at the top of the page remotely resembling a header.

<nitpick>

Your HTML doesn't validate: if you're going to specify a doctype why not conform to it? Might as well leave it out unless you're going to fix it.

I'm not entirely sure, but I don't think you need those &nbsp; entities in the banner and sash divs.

If you can, move the header's HTML code to the bottom of the file: in a text-only browser, it's annoying to have to skip past the menu on every page. Then you can make a "skip to menu" link which is hidden with display: none (off the top of my head... I _think_ Lynx & co. display such anyway, but I'm not sure... it might be some other attribute, but it can be done).

</nitpick>

Other than that, the layout's quite good. <g>
May 04, 2006
Walter Bright wrote:
> Dave wrote:
>> An idea for whatever the style outcome - post a link to something like this somewhere, or otherwise a "Sample Code" page. The idea would be to provide people in a hurry (a) nice short example(s) showing some of the primary D features. For example, I would think this would be something C++ coders could quickly scan and be intrigued by:
> 
> I think this is very good. Can I use it, or perhaps you can put it on wikipedia?


Sure! I'll put it on Wikipedia too.

- Dave

>> #!/usr/bin/dmd -run
>> /* sh style script syntax is supported! */
>>
>> /* Hello World in D
>>    To compile:
>>    dmd hello.d
>>     or to optimize:
>>    dmd -O -inline -release hello.d
>> */
>>
>> import std.stdio;
>>
>> void main(char[][] args)
>> {
>>     writefln("Hello World, Reloaded");
>>
>>     // auto type inference and built-in foreach
>>     foreach(argc, argv; args)
>>     {
>>         // OOP!
>>         CmdLin cl = new CmdLin(argc, argv);
>>         // improved printf!!
>>         writefln(cl.argnum, cl.suffix, " arg: %s", cl.argv);
>>         // Garbage Collection or explicit memory management!!!
>>         delete cl;
>>     }
>>
>>     // Nested structs, classes and functions!
>>     struct specs
>>     {
>>         // all vars. automatically initialized
>>         int count, allocated;
>>     }
>>
>>     specs argspecs(char[][] args)
>>     {
>>         specs* s = new specs;
>>         // no need for '->'
>>         s.count = args.length;
>>         s.allocated = typeof(args).sizeof; // built-in properties for native types
>>         foreach(argv; args)
>>             s.allocated += argv.length * typeof(argv[0]).sizeof;
>>         return *s;
>>     }
>>
>>     // built-in string and common string operations
>>     writefln("argc = %d, " ~ "allocated = %d",argspecs(args).count,argspecs(args).allocated);
>> }
>>
>> class CmdLin
>> {
>>     private int _argc;
>>     private char[] _argv;
>>
>> public:
>>     this(int argc, char[] argv)
>>     {
>>         _argc = argc;
>>         _argv = argv;
>>     }
>>
>>     int argnum()
>>     {
>>         return _argc + 1;
>>     }
>>
>>     char[] argv()
>>     {
>>         return _argv;
>>     }
>>
>>     char[] suffix()
>>     {
>>         char[] suffix = "th";
>>         switch(_argc)
>>         {
>>         case 0:
>>             suffix = "st";
>>             break;
>>         case 1:
>>             suffix = "nd";
>>             break;
>>         case 2:
>>             suffix = "rd";
>>             break;
>>         default:
>>         }
>>         return suffix;
>>     }
>> }
May 04, 2006
On Fri, 05 May 2006 04:36:30 +1000, Dave <Dave_member@pathlink.com> wrote:


> Sure! I'll put it on Wikipedia too.

Hope you don't mind but here is a more annotated version that shows off a couple of other goodies.

#!/usr/bin/dmd -run
/* sh style script syntax is supported! */
 /* Hello World in D
   To compile:
   dmd hello.d
    or to optimize:
   dmd -O -inline -release hello.d

   To get generated documentation:
    dmd hello.d -D
*/
 import std.stdio;  // References to commonly used I/O routines.
 void main(char[][] args)   // 'void' here means return 0 by default.
{
    // Write-Formatted-Line
    writefln("Hello World, "   // automatic concatenation of string literals
             "Reloaded");
     // auto type inference and built-in foreach
    foreach(argc, argv; args)
    {
        // OOP!
        CmdLin cl = new CmdLin(argc, argv);

        // improved 'printf' !!
        // user-defined class properties.
        writefln(cl.argnum, cl.suffix, " arg: %s", cl.argv);
        // Garbage Collection or explicit memory management!!!
        delete cl;
    }
     // Nested structs, classes and functions!
    struct specs
    {
        // all vars. automatically initialized
        int count, allocated;
    }

    // 'char[][]' reads right to left - an array of an array of chars.

    specs argspecs(char[][] args)
    // Optional (built-in) function contracts.
    in{
        assert (args.length > 0); // assert built in
    }
    out(result){
        assert(result.count == CmdLin.total);
        assert(result.allocated > 0);
    }
    body{
        specs* s = new specs;
        // no need for '->'
        s.count = args.length;  // The 'length' property is number of elements.
        s.allocated = typeof(args).sizeof; // built-in properties for native types
        foreach(argv; args)
            s.allocated += argv.length * typeof(argv[0]).sizeof;
        return *s;
    }

    // built-in string and common string operations, eg. '~' is concatenate.
    char[] argcmsg  = "argc = %d";
    char[] allocmsg = "allocated = %d";
    writefln(argcmsg ~ ", " ~ allocmsg,
         argspecs(args).count,argspecs(args).allocated);
}
/**
   Stores a single command line argument.
*/
 class CmdLin
{
    private {
     int _argc;
     char[] _argv;
     static uint _totalc;
    }

 public:
    /************
      Object constructor.
      params:
        argc = ordinal count of this argument.
        argv = text of the parameter
     */
    this(int argc, char[] argv)
    {
        _argc = argc;
        _argv = argv;
        _totalc++;
    }

    ~this() // Object destructor
    {
        // Doesn't actually do anything for this example.
    }

     int argnum() /// A property that returns arg number
    {
        return _argc + 1;
    }
     char[] argv() /// A property that returns arg text
    {
        return _argv;
    }
     wchar[] suffix() /// A property that returns ordinal suffix
    {
        wchar[] suffix;  // Built in Unicode strings (utf8,utf16, utf32)
        switch(_argc)
        {
        case 0:
            suffix = "st";
            break;
        case 1:
            suffix = "nd";
            break;
        case 2:
            suffix = "rd";
            break;
        default:  // 'default' is mandatory with "-w" compile switch.
            suffix = "th";
        }
        return suffix;
    }

    /***************
      * A property of the whole class, not just an instance.
      * returns: The total number of commandline args added.
      *************/
     static typeof(_totalc) total()
    {
        return _totalc;
    }
}

-- 
Derek Parnell
Melbourne, Australia
May 04, 2006
Bruno Medeiros wrote:
> 
> Try this for a great show of the potential of CSS and separation of content and presentation:
> http://www.csszengarden.com/

Ouch!

I used to think I know something about CSS and the separation of content from presentation. This site simply embarrassed me.

---

So, what Digital Mars, most of us, and my own sites in particular should do, is: we ought to redo our sites in trivial HTML, and then get a round of offers from CSS Designers!

By the time the site as such is "complete and ready", the CSS designer can give one an exact quote. Everybody saves money, time, and effort.

---

As to D sites, something of the same might do the trick. That is, if a D site runs Wiki, or even a self-made web engine, then just see to it that the only formatting is the span tags.

Then it would be convenient and easy for those (not of us) who have an artistic eye, to figure out and suggest worthy visual designs.