the best language I have ever met(?)

Igor Shirkalin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Nov 18 12:31:57 PST 2016


On Friday, 18 November 2016 at 19:43:49 UTC, H. S. Teoh wrote:
>> I was a little bit afraid of my missunderstanding in terms of 
>> sentiments.  You've got me right (I don't quite feel the 
>> meaning of that in these non-cyrillic letters:). But what I 
>> understand is the path you have walked and what I have in my 
>> mind.
>
> Yes, I meant 'sentiments' as in опыта, not as in 
> сентметальность. :-)
I used to mean 'sentiments' as "сентиметальность", but "опыт - 
сын ошибок трудных" (Пушкин) is what realy in behind :)


>> Simple example about D: I spent two hours to write a line 
>> (borrowed from Python), related with lazy calculations, but 
>> finally I got it with deep great thinking, and it was like 
>> understanding of Moon alienation from Earth.

> Great!  Would you like to share the code snippet?

Sure. Let we have a uint_array of values. And we need to get a 
string of these values in hex separated with ','. In Python it 
looks like

<code python>
      ', '.join(map(hex, uint_array))
</code python>

After 2 hours of brain breaking (as D newbie) I have come to:

<code D>
uint_array.map!(v=>"%x".format(v)).join(", ")
</code D>
Why 2 hours? Because I have started with 'joiner' function and 
aftewords found out the 'join'.

To my mind there is more simple form for this task in D (about 
formatting).

>> What is your using of D?
> Sadly, I have not been able to use D in a professional 
> capacity. My coworkers are very much invested into C/C++ and 
> have a very high level of skepticism to anything else, in 
> addition to resistance to adding new toolchains (much less

> languages) to the current projects.  So my use of D has mainly 
> been in personal projects.  I do contribute to Phobos (the

Same here.
But my coworkers are not addicted to programming at all :)

> standard library) every now and then, though.  It's my way of 
> "contributing to the cause" in the hopes that one day D may be 
> more widespread and accepted by the general programming 
> community.

I don't hope about "D some day", I'm sure about that (5 to 30 
years).
The idea is "I D", not "I C++" :)




More information about the Digitalmars-d-learn mailing list