-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
add basic overview of when to use type declarations #39812
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems helpful and in the right place. There are other reasons to add types, but these are the most common and most relevant for newcomers.
Maybe slightly less emphasis, though? Feels a bit like shouting, though I understand why these points are worth emphasizing. |
With regard to bold/emphasized text, I was influenced a lot by Jakob Nielsen's usability studies, which suggests that online readers typically scan text rather than reading from top to bottom, and so it is useful to highlight key ideas in bold to aid scannability. However, I can certainly cut down on this if people prefer; I've already updated it to trim the emphases somewhat. Let me know if you want me to go further. |
Nice! |
Questions about when to declare function arguments come up over and over on discourse, and so it seems useful to put a basic summary early in the chapter on Functions, rather than deferring it to later chapters.