Skip to content

Intent, not syntax #1748

Closed
Closed
@JJ

Description

@JJ

This is something I have found quite repeatedly through the documentation, and for that matter throughout almost everything that is written for every single language: Examples usually focus on syntax, and not on intent. This is the last one I have found, but I'm sure you can think of many others: lazy 1..5 when documenting lazy. This is an absolutely correct and serviceable example. The problem is that when we are dealing with relatively uncommon features such as this one, we would avoid cargo-culting by learners by using examples that could be actually used in real-life code.
In this particular case, I guess that a sequence that needs heavy-weight computation and particularly that needs to compute every member based in the last one would be the case. This might be hard to think about, and focusing on syntax is generally OK because, after all, reference docs are not tutorials. However, in some cases, making the intent of the feature clearer would help newcomers to better understand the language and put it to use.
I'm sure you can come up with many other examples you have bumped upon; if that's the case and you can work on then (or assign them to me), that would be fine. If you think this is not a priority now or simply don't agree, I'd like to hear your opinion.

Metadata

Metadata

Assignees

Labels

RFERequest for enhancement. Try to use alternative wording that explain the concept more clearlymetaRFCs, general discussion, writing style, repository organization, etc.wishlist"nice to have" issues; might require a lot of work or a big change or be low priority

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions