Re: const in functions

2023-03-12 Thread FozzieBear via Digitalmars-d-learn
On Sunday, 12 March 2023 at 15:09:45 UTC, Salih Dincer wrote: ... So I don't agree with part of this comment (made elsewhere in this thread): "You can live without 'const' until your code interacts with other people's code." Code interacts with other code. Code should always be clear as

Re: Can nice D code get a bit slow?

2023-03-09 Thread FozzieBear via Digitalmars-d-learn
On Wednesday, 8 March 2023 at 10:49:32 UTC, Markus wrote: btw. As far as I can tell (using the example in the link below), compiled D (using the ldc compiler with -O3) will optimise the call just fine. However, not including the 'final' keyword would not mean the end of the world ;-) ht

Re: Can nice D code get a bit slow?

2023-03-09 Thread FozzieBear via Digitalmars-d-learn
On Thursday, 9 March 2023 at 10:05:35 UTC, FozzieBear wrote: .. But that assumes you even know how long 7 nanoseconds are .. cause I don't. Well, it turns out, that light takes about a nanosecond to travel 1 foot. So that means, the performance impact from using a virutal call, would be eq

Re: Can nice D code get a bit slow?

2023-03-09 Thread FozzieBear via Digitalmars-d-learn
On Wednesday, 8 March 2023 at 10:49:32 UTC, Markus wrote: Hi, sorry for the broad and vague question. I have read in some reddit post about benchmarks, that some code didn't use the final keyword on methods in a sense that final would make it faster, I believe. I thought, without any D knowle