Skip to content
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

Information on dict vs shape is unclear/incomplete/buried #1276

Open
jwatzman opened this issue Jul 31, 2022 · 0 comments
Open

Information on dict vs shape is unclear/incomplete/buried #1276

jwatzman opened this issue Jul 31, 2022 · 0 comments

Comments

@jwatzman
Copy link
Contributor

Where is the problem?

The pages on shapes and dicts.

What is the problem?

When to use a dict and when to use a shape is a question that IME often trips up people new to the language, especially folks coming from PHP who aren't used to thinking about those use-cases as materially different. See, for example, this SO question as a recent example which prompted this report -- but I've given the same explanation to FB bootcampers many times too.

At the very very end of the page on vec, keyset, and dict, is this note:

If you want different keys to have different value types, or if you want a fixed set of keys, consider using a shape instead.

IMO, that footnote is pretty unclear and is unlikely to help anyone who isn't already familiar with this idea, and is also a bit hard to see at the bottom of an otherwise very busy page. This idea seems to deserve its own section or even page, more than that footnote?


Please don't change anything below this point.


  • Build ID: HHVM=HHVM-4.164.0:HSL=v4.108.1:2022-07-26T17:24:38+0000:1fa47f258c6b68f8ec01899aa82fd6ffa0957109
  • Page requested: /hack/arrays-and-collections/vec-keyset-and-dict
  • Page requested at: Sun, 31 Jul 2022 15:07:23 +0000
  • Controller: GuidePageController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants