[OT] What are D's values?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Sat Oct 16 07:04:16 UTC 2021


On Tuesday, 12 October 2021 at 16:51:40 UTC, H. S. Teoh wrote:
> Unlike some people here, I find that having more than one way 
> to do something is a *good* thing. (When the choices are 
> meaningful, that is. When there are multiple ways of doing 
> something but the choices are not meaningful, that's a 
> different question.)

It is not good when you have to read code written by others. 
Especially if it rarely used. (We can easily deal with "i++" and 
"i=i+1" because they occur frequently.)

However, with meta-programming, people will write libraries that 
create N ways of doing the same thing. So not only do you need 
discipline when doing language design, but also when designing or 
choosing libraries, if you want to encourage people to write more 
readable code. Powerful meta-programming features like D/C++ 
provide also has some negative consequences.

For larger long-lived programs, readable code often is on of the 
most important characteristic (in term of costs). In that regard, 
it might be desirable to use a language that is restrictive, but 
is geared towards the domain.

I think the most well designed languages are designed for a 
specific use context, and  that context guides the "values". 
Languages like D and C++ (and JavaScript) has not been designed 
for a specific context and the end result is a bit messy as a 
result. I am not sure if one can separate values and intended use 
context...



More information about the Digitalmars-d mailing list