Skip to content

Conversation

@Logofile
Copy link
Member

@Logofile Logofile commented Aug 9, 2024

This documentation change includes the following:

  • Adds 1-1-1.md to describe the 1-1-1 rule/best practice
  • Groups some content under a new best-pratices.md topic
  • Updates the section in Dos and Don'ts for defining message types in separate files
  • Adds link to the style guide
  • Adds clarification information to the Java Generated Code guide

PiperOrigin-RevId: 659566969
Change-Id: Ibc191468b743180ddc49ff149664fe8a5e938cdc

* Adds 1-1-1.md to describe the 1-1-1 rule/best practice
* Groups some content under a new best-pratices.md topic
* Updates the section in Dos and Don'ts for defining message types in separate files
* Adds link to the style guide
* Adds clarification information to the Java Generated Code guide

PiperOrigin-RevId: 659566969
Change-Id: Ibc191468b743180ddc49ff149664fe8a5e938cdc
@Logofile Logofile merged commit 2498df9 into protocolbuffers:main Aug 9, 2024
@npotts
Copy link

npotts commented Aug 13, 2024

Who is responsible for the creation of these rules?

Some of these suggestions make some sense, but none of the tradeoffs are presented or discussed.
Is there an oversight committee or real-world usage that was consulted?
Are these suggestions because of different language problems?

I am curious because this seems like shift from "probably a good idea" to "thou shalt seperate", and for a guide, there should be room for nuance.

@Logofile
Copy link
Member Author

We've been making a shift from "show all the ways" to more-opinionated documentation for the past several years. These guidelines are the best practices that have coalesced after seeing what happens when they're not followed by teams and implementations within the company. You are, of course, free to deviate where you feel the practices don't match your implementation.

As for the "why" question, I may be able to inject some of that into the 1-1-1.md document. For example, the recommended limitation on enum sizes stemmed partly from the Java language limitation of 1,700 values.

@npotts
Copy link

npotts commented Aug 14, 2024

Thanks for the followup! That is good to know and helpful to understand the "why".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants