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

Jose Armando Garcia jsancio at gmail.com
Mon Apr 4 18:22:15 PDT 2011


Maybe we should start by identifying which small set of "simple"
features best identify D. With a minimal list of features we want to
showcase we can talk about an example that showcase them. Here is my
list: gc, ranges/slices, safety, foreach and immutability/const. It
would be nice to add template but I don't know if it is fair to assume
that most programming have a grasp of it.

Wait, what is wrong with the current word count example?

On Mon, Apr 4, 2011 at 9:52 PM, spir <denis.spir at gmail.com> wrote:
> On 04/04/2011 11:02 PM, bearophile wrote:
>>
>> Andrei:
>>
>>> 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.
>>
>> If you try to cram most features in a simple small program you end with
>> something that looks like a little Christmas tree. I don't think this is a
>> good advertisement for D.
>>
>> On the rosettacode.org site there are many ways to implement the D
>> solutions. The C solutions are often not much general, and too much low
>> level. The C++ solutions are often over-engineered, over-generalized, and
>> sometimes not easy to understand. The Go solutions are sometimes too much
>> simple. A good D solution is quite short and to the point, simple, at the
>> level required to solve the task, not too much slow, not too much optimized,
>> very easy to read, easy to understand, not too much specific but not even
>> too much generalized. Sometimes solutions in other languages are tagged as
>> derived from the Python and D solutions, this means the D code was readable
>> enough, this is how very publicly visible D code has to be. Readability
>> first, generality but not too much of it, low level when necessary, high
>> level when possible. It's a matter of style. People run away from C++
>> because sometimes it has an image of a messy and over-engineered language. I
>> suggest to avoid this trap in D c
>
> ode that everyone sees.
>
> Very well stated. The one example to find (one only, for the home page) is
> thus one piece of code shows clearly shows the *differential* advantage(s)
> of D over well known programming languages. Else, it's useless.
>
> Denis
> --
> _________________
> vita es estrany
> spir.wikidot.com
>
>


More information about the Digitalmars-d mailing list