Why D languiage creator decided to NOT fix this?
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Sat Jun 29 04:29:45 UTC 2019
On Friday, June 28, 2019 9:05:54 PM MDT Les De Ridder via Digitalmars-d
wrote:
> On Friday, 28 June 2019 at 23:29:38 UTC, Why not? wrote:
> > During creation of new language it was so simple to fix this
> > serious flaw "once for always"; simply by adopting ':='
> > assignment operator from Pascal, and by leaving - as 'equality
> > testers' - BOTH single '=' and double '==' "equal" signs.
>
> I'm personally glad that D uses the familiar '=' operator for
> assignment.
One reason for it is that it makes porting code from C and other C-based
languages easier. After all, one of D's goals is for C code to be valid D
code with the same semantics or for it to not compile. That isn't
_completely_ true, but it's close, and while going with := would have still
followed that rule by causing code using = to not compile, given that the
problem with = was already solved in the same way that other languages in
the C family have generally solved it, making such a change would simply
have made porting code harder without really providing any benefit.
As I understand it, in general, Walter left things in D the same as C++
except where he felt that changes were needed. And he didn't feel that the
assignment syntax needed to be changed. As far as I recall, this is the
first time that I've ever seen anyone complain about it, so I think that
it's safe to say that the majority of D users feel the same way.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list