Skip to content

Create design-document-template.md #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Conversation

romulocintra
Copy link
Collaborator

@romulocintra romulocintra commented Oct 5, 2021

Proposal for a design doc template

Create design document closes #202

Create design document closes #202
@mihnita
Copy link
Collaborator

mihnita commented Oct 5, 2021

I would not try to define here a design document template, unless we want to end with endless debates about that.
I would rather point to a few templates that are "good enough" and list what we really want to get from a design document.


Here is some info about the Design Documents at Google:
https://www.industrialempathy.com/posts/design-docs-at-google/

Not because it is perfect, but because it is good enough, and I am familiar with it (vs looking for design documents on the web, reading / understanding / judging what they mean, and if they are good enough.

If others can contribute something they know about, would be great.


And note that it is not a "universal recipe" for design documents.

That article say

That is, given the context (facts), goals and non-goals (requirements), the design doc is the place to suggest solutions and show why a particular solution best satisfies those goals.

The point of writing a document over a more formal medium is to provide the flexibility to express the problem set at hand in an appropriate manner. Because of this, there is no explicit guidance for how to actually describe the design.

Having said that, a few best practices and repeating topics have emerged that make sense for a large percentage of design docs:

We can point to design documents or "deep dive" documents from ICU4X as examples.


What I think is critical to be in a design document that is not visible in code:

  • alternatives considered & trade-offs
  • "the design doc is the place to suggest solutions and show WHY a particular solution best satisfies those goals"

There is no need for code in a design document.
In fact I think it is counter-indicated, especially for something cross-platform, cross-programming-language like MF2.

The design document should rather contain pseudo-code to describe how things behave (not implementation),
and maybe public APIs / method signatures / interfaces.

Code can be used as a prof that something can be implemented, can do what it claims to be doing, and help the designed figure out the proper public APIs
But it is not part of the design doc, it only informs the design doc.

Copy link
Collaborator

@mihnita mihnita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to create a design doc template, if we don't want to spend weeks on it.

We should point to a few good existing templates, and some examples of design documents.

Because design documents
"They are more what you'd call guidelines than actual rules"
https://imageproxy.ifunny.co/crop:x-20,resize:640x,quality:90x75/images/ef717be29ae4c022fa0fb844dcdf70dfd9fe7ca3bf770262a60ba4c5471b24ef_1.jpg

@romulocintra
Copy link
Collaborator Author

romulocintra commented Oct 5, 2021

Copy link
Collaborator

@mihnita mihnita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposal

We should:

  • point to 2-3 good existing templates
  • point to some examples of design documents (ICU4X?)
  • list 2-3 things that we really-really want to be part of the design doc, even if everything else is discarded / optional, to not make things too heavyweight

@mihnita
Copy link
Collaborator

mihnita commented Oct 6, 2021

Hi @mihnita did you check https://github.com/unicode-org/message-format-wg/blob/e335be9a06fe0aea54f9c93bdb5ed4ff262d6308/guidelines/design-document-template.md

Yes.
What am I supposed to do with it? It is in some random branch, and did not go through a PR.
This is the PR where we discuss it, no?

@romulocintra
Copy link
Collaborator Author

Hi @mihnita did you check https://github.com/unicode-org/message-format-wg/blob/e335be9a06fe0aea54f9c93bdb5ed4ff262d6308/guidelines/design-document-template.md

Yes.

What am I supposed to do with it? It is in some random branch, and did not go through a PR.

This is the PR where we discuss it, no?

This is a PR with a proposal for a simple design doc. I suggest maybe having this as a base template and mention others that you listed there.

The idea is only have something to get started with.

Copy link
Collaborator

@eemeli eemeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a pretty decent minimal template to use. Included some line-specific nitpicky suggestions.

### Motivation
Motivation to have this design document

### Examples & Prior Art
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would tag various sections with "optional" if it is ok to leave them out of the document.
We don't want a very bureaucratic thing and duck taping ("you left out X")

So, prior art: optional


Discuss any background and motivation not already in the summary above. Give implementation details and all posible alternatives to solve the problem including affectations to other components.

### Code / Implementation / Experiments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code , implementation, should NOT be in a design document.

Implementation is only needed to prove that something can be implemented as proposed.
If nobody says "this can't be done" or "this would not work", then there is no need for implementation.

And if it is needed, then it is in some repo, with the design document pointing to it "it's possible, here it is"
But no code / implementation in the design doc.

Discuss any background and motivation not already in the summary above. Give implementation details and all posible alternatives to solve the problem including affectations to other components.

### Code / Implementation / Experiments
Code examples, alternative solutions
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code examples should only be about how the proposed APIs should look like when used, no internals.

## Design

Discuss any background and motivation not already in the summary above. Give implementation details and all posible alternatives to solve the problem including affectations to other components.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What needs to be in a design document:

Goals and non-goals

Alternatives considered and trade-offs

Since we got to a design document it means there is no one solution that everybody agrees that is perfect.
So there are obviously trade-offs.

This would be the "meat" of the design document, as it explains how the trade-offs are balanced.

APIs (probably sub-section for each alternative in "Alternatives considered"

The APIs section should include signatures.
Should also include explanations on what they do, if not obvious.
Behavior described as pseudo-code.
But behavior is not implementation.

It is also useful to show how the APIs are invoked by the developer, the proper sequence in normal use.

@eemeli eemeli mentioned this pull request Oct 11, 2021
romulocintra and others added 2 commits October 11, 2021 09:06
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Add intro and other template links
@@ -0,0 +1,34 @@
<!--
This document intends to provide a simple boilerplate to start a design document, fields aren't strictly required and other templates can be found here:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mihnita @eemeli added this header with some examples of Design Docs. The intention of this document is to have a boilerplate where people can start. Nevertheless, you can use whatever you like most. If you have any other Design Doc of reference I can add it to the list

@stasm stasm mentioned this pull request Oct 17, 2022
10 tasks
@romulocintra romulocintra deleted the design-doc-template branch October 19, 2022 15:49
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.

Definition of Design Document
3 participants