Code example on www.d-programming-language.org?

Ary Manzana ary at esperanto.org.ar
Tue Apr 5 07:19:49 PDT 2011


On 4/4/11 5:03 PM, Andrei Alexandrescu wrote:
> We have a rather aged code example on www.d-programming-language.org.
> What would you think would be a good replacement? The ideal snippet
> would make a compelling tour of the language's and stdlib's most
> important features while at the same time being simple and concise.
>
> Andrei

I like the (guess what's I'm going to say... :-P) Ruby home page where 
it shows small snippets of specific features. This features are randomly 
selected on each page visit.

http://www.ruby-lang.org/en/

What I like about it is that you can see in a glance that one feature of 
the language is really nice and simple to use and makes you think 
everything else must be like that. ;-)

If you want to show every possible feature of the language it's kind of 
overkill, both for you and for the user who's going to read it.

If the user wants to know more, point her to the full documentation, or 
to a short guide of the main features.

Again, Ruby has a nice page for this: 
http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/

It shows you how to start programming in Ruby if you come from C++, or 
from Java, or from X. That's very nice because for C++ you can say 
"Shorter syntax, garbage collection, etc.", for Java you can say "You 
will have classes and interfaces, just like in Java", for Ruby you can 
say "You can have closures doing this and that", etc.


More information about the Digitalmars-d mailing list