On Sunday, 26 March 2023 at 18:07:03 UTC, ryuukk_ wrote:
What i find even more weird is writing fast code is ugly in D

Look at this ugly code

```D
__gshared int fast_code_ugly;
```

Because it should be rare that __gshared is used. And if you need it, you won't be worried about how the storage class looks because you'll be concentrating on if your design is thread-safe.

It should be the opposite

Then by default, @safe code can not access global variables and there can easily be accidental races between threads.
  • Why are globals ... ryuukk_ via Digitalmars-d-learn
    • Re: Why are... ryuukk_ via Digitalmars-d-learn
    • Re: Why are... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: Why... ryuukk_ via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
          • ... ryuukk_ via Digitalmars-d-learn
      • Re: Why... IGotD- via Digitalmars-d-learn
      • Re: Why... IGotD- via Digitalmars-d-learn
        • Re:... Guillaume Piolat via Digitalmars-d-learn
    • Re: Why are... Nick Treleaven via Digitalmars-d-learn
      • Re: Why... ryuukk_ via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
        • Re:... Nick Treleaven via Digitalmars-d-learn
          • ... ryuukk_ via Digitalmars-d-learn
            • ... Dennis via Digitalmars-d-learn
              • ... ryuukk_ via Digitalmars-d-learn
                • ... Dennis via Digitalmars-d-learn
                • ... bachmeier via Digitalmars-d-learn
                • ... Guillaume Piolat via Digitalmars-d-learn
                • ... Adam D Ruppe via Digitalmars-d-learn

Reply via email to