Redundancy in languages by Walter
Ali Çehreli
acehreli at yahoo.com
Mon Jun 1 06:53:05 UTC 2020
On 5/31/20 6:14 AM, Max Samukha wrote:> I was re-reading Walter's old
article on redundancy and thought new
> people here might find it useful:
> https://www.digitalmars.com/articles/b05.html.
Thanks for the reminder. I read it again.
> It is good overall, except for a couple of arguable points, such as
> types of temporaries condemned as bad redundancy, where the issue is not
> the redundant type declaration but rather the type system allowing
> implicit lossy conversions.
Yes, implicit conversion is a concern but I didn't take the point that
way: When the type is not spelled out, it means "whatever the type of
the expression is." On the other hand, if one uses 'int' e.g. because
the type of the expression is 'int' today, the compiler cannot know
whether the programmer means "whatever the type of the expression is" or
"I want specifically int". Note that 'int' conversion may not be lossy
or wrong at all; there may be a perfectly valid 'int' conversion.
The issue is, the compiler cannot know and that's why Walter calls this
a bad redundancy.
Ali
More information about the Digitalmars-d
mailing list