does D already have too many language features ?

Julian julian.fondren at gmail.com
Mon Apr 8 22:15:52 UTC 2019


On Monday, 8 April 2019 at 21:52:37 UTC, Alex wrote:
> Personally, I might suggest you go learn Haskell.

I would interpret this as a request to take a long walk on a 
short pier.
It probably depends on the receiver's feelings for Haskell.

> Or better, you could learn both. Every language will have it's 
> pro's and con's. Language features are never a con.

Some examples of cons:

- Perl's Java-style new. Never used in favor of ->new(), but 
since it's
in the language we have this top-voted SO question:

https://stackoverflow.com/questions/11695110/why-is-this-program-valid-i-was-trying-to-create-a-syntax-error

- Perl's single-quote "dot syntax". Never used in favor of ::, 
but since it's
in the language you have to escape single quotes in cases like 
"$who's"
so that doesn't look like an invocation of an 's' method.

- Perl's @ interpolation of arrays into strings. Almost never used
deliberately, but since it's in the language you have to escape 
email
addresses in strings.

- Perl's scalar/list context system. It's super cute, and it also 
means
that blah("hi") either returns "hi" or "ih" ... depending on the 
call.

   sub blah {
     my $x = shift;
     reverse($x)
   }

It's not all Perl, but the more common 'con' is a feature that 
opens
a window while closing a hallway of doors for a language's future
development.


More information about the Digitalmars-d mailing list