D Core Guidelines?

bachmeier no at spam.net
Fri Sep 1 15:46:49 UTC 2023


On Friday, 1 September 2023 at 11:51:53 UTC, sighoya wrote:

> Personally, I think the code in the standard library should 
> reflect how we write technical solutions to problems.

I'm not a fan of that. Just to pull out a random function from 
the standard library:

```
void remove(scope const(char)[] name) @trusted nothrow @nogc
```

That's absolutely hideous. Fine if someone else wants write that 
stuff, but I'd rather use Java to reduce the verbosity.

Idiomatic D code is code that passes the tests. Some folks think 
there's no such thing as too many attributes. I think one 
attribute is too many. Some think everything but main should be 
private. I seldom use private. D is useful in many domains, and 
for solo programmers as well as large teams, so it's futile to 
come up with general guidelines.


More information about the Digitalmars-d mailing list