On Sat, May 14, 2022 at 11:00 AM Josh McKenzie <jmcken...@apache.org> wrote:
> > Incidentally, I've found similar value in @ThreadSafe, const, readonly, > etc - communications of author's intent; being able to signal to future > maintainers helps them make modifications that are more consistent with and > safer with regards to the original intention and guarantees of the author. > > Assuming you trust those guarantees that is. :) > I think author's intent is important, which is why I also think that judicious/effective commenting and naming are important (and I'm glad that naming is called out in the guidelines explicitly). However, I also think that these are also opportunities to help the compiler and tooling help us, similar to how Benedict's draft calls out effective use of the type system as a way to encode semantics and constraints in the code. These annotations, while clunky and verbose, do open the door in some cases to static analysis that the Java compiler is incapable of doing. I don't know exactly where it is, but I think there's a balance between use of annotations to help tooling identify problems while not becoming onerous for current and future contributors. I know this is more difficult in Java than, say, Rust, but I'm an eternal optimist and I think we can find that balance :) Cheers, Derek -- +---------------------------------------------------------------+ | Derek Chen-Becker | | GPG Key available at https://keybase.io/dchenbecker and | | https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org | | Fngrprnt: EB8A 6480 F0A3 C8EB C1E7 7F42 AFC5 AFEE 96E4 6ACC | +---------------------------------------------------------------+