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

docs: update range for: 0-based index rationale #20617

Merged
merged 3 commits into from
Jan 21, 2024
Merged

Conversation

verulian
Copy link
Contributor

Added a note to the Range for section in the documentation to explain the rationale behind using exclusive range notation and zero-based indexing. From spytheman in Discord https://discord.com/channels/592103645835821068/592115457029308427/1194711919572033576, This update references Edsger W. Dijkstra's 'Why Numbering Should Start at Zero' to provide theoretical backing and clarity on this design choice.

Added a note to the Range `for` section in the documentation to explain the rationale behind using exclusive range notation and zero-based indexing. From spytheman in Discord https://discord.com/channels/592103645835821068/592115457029308427/1194711919572033576, This update references Edsger W. Dijkstra's 'Why Numbering Should Start at Zero' to provide theoretical backing and clarity on this design choice.
@verulian
Copy link
Contributor Author

Not sure if there is a formatter used for .md files. I don't think v fmt works for these. Seems line length is off in what I have done here, especially due to the URL. Anyone able to clear this up?

doc/docs.md Outdated Show resolved Hide resolved
@JalonSolov
Copy link
Contributor

You can check before submitting changes with v check-md <file>.

@verulian
Copy link
Contributor Author

Thank you for the command @JalonSolov. v check-md doc/docs.md only returned:


Warnings: 0 | Errors: 0 | OKs: 248

@StunxFS maybe just manually pushed that url down one line and didn't use any mechanism to check?

Co-authored-by: Jose Mendoza  <56417208+StunxFS@users.noreply.github.com>
@spytheman
Copy link
Member

Lines with links can now be longer (up to 250 characters currently, determined by too_long_line_length_link in cmd/tools/vcheck-md.v) to avoid false positives, but sometimes .md files are read in a terminal, or in a text editor pane, so it is good to have a document that does not require horizontal scrolling too much.

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

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

Excellent addition.

@verulian
Copy link
Contributor Author

Thank you. Maybe there is a certain length we should use for rule? Maybe v check-md could throw a warning or some notification that line length should be adjusted for easier standardization?

@spytheman
Copy link
Member

It already does.

@spytheman spytheman merged commit 55287b3 into vlang:master Jan 21, 2024
4 checks passed
@verulian
Copy link
Contributor Author

Mhmm. Thanks @spytheman. Spose I need to look into this more to see how this works. Haven't had success making it give the above result from @StunxFS so I think I will just need to use my eyes when it doesn't catch something itself. I see a lot of mixed line lens. Some are over 100 chars and some are around 90. Maybe just eyeballing is the best to keep around similar surrounding contents.

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.

None yet

4 participants