Website message overhaul, pass 2

Jerry jlquinn at optonline.net
Fri Nov 25 12:29:03 PST 2011


Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> writes:

> On 11/20/11 7:09 AM, Robert Clipsham wrote:
>> - The code sample at the top is terrible, the equivalent C is only a
>> couple of lines longer and it doesn't show off any of what makes D
>> better! Admittedly you're limited in what you can do here as the code
>> needs to be fairly understandable by non-D programmers, but what's there
>> is... Not good at all.
>
> I'd be curious how with only a couple of lines more you address in C
> lines of arbitrary length and proper error handling. Same goes about
> C++ (in addition to the speed issue) - code that does the right thing
> and is not very slow is quite subtle and I doubt two out of five C++
> programmers know how to write it.

I had one minor thought on the average line length code example.  If you
eliminate the initialization of lines and sumLength, it would
demonstrate default initialization.  


>> - Rotating the example is a brilliant idea, particularly if powered by a
>> continuous contest.
>
> Yah, looking forward to that. It's going to be interesting.
>
>> - This is less about the message, but how about an "explain this" link
>> in the corner of examples with little hints for C/C++/Java programmers,
>> so when clicked additional comments appear in the code or bubbles appear
>> above on hover or something, they would include small bits of text like
>> "auto can be used in place of a type to infer the type from what is
>> being assigned"... But better worded of course.
>
> Good idea.

What do you think about offering equivalent code from other languages?
Not necessarily all language for any given example, but if there are
enough equivalents from enough other languages, it might more directly
highlight the strengths of D for newbies with those backgrounds.

So in this case a perl comparison wouldn't be illuminating but a C++ one
would.  If all the various paradigms that D supports get illustrated
that way it might give a broader feeling for how D will make things
easier on many fronts.

Jerry


More information about the Digitalmars-d mailing list