C is Brittle D is Plastic

Sergey kornburn at yandex.ru
Sun Mar 22 16:32:25 UTC 2026


On Sunday, 22 March 2026 at 15:05:41 UTC, Kapendev wrote:
> The same can be said for replacing the `->` operator with a `.`.
> For example: `int a = variable.value;`
> Is `variable` a pointer or a number in this example?
> You don't know. Do you care? No, and if you do then you should 
> know what your code is doing in the first place lol

This is wrong example Kap.

Imagine you have a function.. with many rows.
And then you a calling another function there like:
```d
// ... many rows above
another_func(foo.bar, foo.baz, x);
// ... many rows below
```

here for x parameter you need to give a reference to foo. But you 
don't know which type foo now - is it a pointer or not..
You will have to go somewhere above search the foo somewhere - 
then go back to another_func and change the x..


More information about the Digitalmars-d mailing list