Re: [PATCH v16 2/4] rust: types: add `ForeignOwnable::PointedTo`
From: Tamir Duberstein
Date: Mon Feb 17 2025 - 12:44:22 EST
On Mon, Feb 17, 2025 at 12:36 PM Miguel Ojeda
<miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>
> On Mon, Feb 17, 2025 at 6:24 PM Miguel Ojeda
> <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
> >
> > I understand the rationale -- what I meant to ask is if you saw that
>
> By the way, I don't agree with the rationale, because it sounds to me
> like optimizing for `git blame` readers, while pessimizing for normal
> readers.
>
> We do a lot of `git blame` in the kernel, especially since our Git log
> is quite good, but we still read the files themselves more... I can
> imagine ending up with a lot of extra lines over time everywhere, it
> could dissuade small fixes and so on.
I almost addressed this in my original reply - I regret that I didn't.
I agree with you that optimizing for git blame while pessimizing for
normal readers is not what we should do. I don't agree that putting
boilerplate on its own line is a pessimization for the normal reader -
in my opinion it is the opposite. Trivial expressions of the form
let foo = foo.cast();
can be very easily skimmed by a reader, whereas an expression of the form
unsafe { <type as trait>::associated_type::function(foo.cast()) }
become more difficult to read with every operation that is added to it.
As always, this is just my opinion.