What are (were) the most difficult parts of D?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed May 11 14:20:07 UTC 2022


On Wed, May 11, 2022 at 01:37:21PM +0000, matheus via Digitalmars-d-learn wrote:
> On Wednesday, 11 May 2022 at 05:41:35 UTC, Ali Çehreli wrote:
> > What are you stuck at? What was the most difficult features to
> > understand? etc.
> > 
> > To make it more meaningful, what is your experience with other
> > languages?
[...]
> Now I know they must be useful to many others, but one thing that I
> don't like are the Attributes part, for me there are so many and this
> is a bit overwhelming (Again to me), for example need to think about:
> "@safe, @trusted, @system" while still prototyping may be a
> cumbersome, and if it's giving me trouble I'll just get rid of it. :)
[...]

My suggestion is: when prototyping, don't even think about attributes.
Just templatize your functions and let the compiler infer the attributes
for you.

I myself rarely bother with attributes; I only write them when I want to
be 100% sure that a particular piece of code has that attribute.
Otherwise I just templatize it and let the compiler figure it out for
me.  Auto-inference is the way to go; life is too short to be fiddling
with attributes in every single declaration manually.


T

-- 
People walk. Computers run.


More information about the Digitalmars-d-learn mailing list