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

x/tour: len(T) discussed before explaining #12758

Closed
KarthikNayak opened this issue Sep 26, 2015 · 6 comments
Closed

x/tour: len(T) discussed before explaining #12758

KarthikNayak opened this issue Sep 26, 2015 · 6 comments

Comments

@KarthikNayak
Copy link
Contributor

Context: https://tour.golang.org/moretypes/8

In this slide we have "// missing high index implies len(s)" before even
explaining what len(T) does. Although this is quite trivial, anyone new
to programming might not understand this.

@rakyll
Copy link
Contributor

rakyll commented Sep 26, 2015

/cc @adg @campoy

@rakyll rakyll added this to the Unreleased milestone Sep 26, 2015
@adg adg changed the title tour: len(T) discussed before explaining x/tour: len(T) discussed before explaining Sep 28, 2015
@kytrinyx
Copy link
Contributor

kytrinyx commented Oct 8, 2015

Since this is in a comment in the example, it's a bit tricky to explain it in the slide itself. Also, rewriting it to something else doesn't sit very well.

  • // missing high index implies the rest of the slice - imprecise
  • // missing high index implies the highest valid value, the length of the slice - wordy, imprecise

How about working around it by introducing len on the previous slide?

@kytrinyx
Copy link
Contributor

kytrinyx commented Oct 8, 2015

Looking at this again, len(s) is even used on the previous slide (in the for loop), so it would be pretty straight forward to add a short description about this.

@rakyll
Copy link
Contributor

rakyll commented Oct 8, 2015

I'd add a description for len saying it returns the length.

@adg
Copy link
Contributor

adg commented Oct 8, 2015

@kytrinyx agree, let's mention len earlier.

@KarthikNayak
Copy link
Contributor Author

Makes sense, a small description was what I was looking for. Thanks

On Thu, Oct 8, 2015, 8:07 AM rakyll notifications@github.com wrote:

I'd add a description for len saying it returns the length.


Reply to this email directly or view it on GitHub
#12758 (comment).

Regards,
Karthik

@golang golang locked and limited conversation to collaborators Oct 9, 2016
gopherbot pushed a commit to golang/website that referenced this issue May 26, 2021
len() is used in subsequent slides to explain other concepts.

Fixes golang/go#12758

Change-Id: I7fd4c48bc84aa2b6d57ea4c1e24149fd3f942bca
Reviewed-on: https://go-review.googlesource.com/15559
Reviewed-by: Andrew Gerrand <adg@golang.org>
X-Tour-Commit: 9d789a4a34a57a0a20e92cc41f525e4e84914f34
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
len() is used in subsequent slides to explain other concepts.

Fixes golang/go#12758

Change-Id: I7fd4c48bc84aa2b6d57ea4c1e24149fd3f942bca
Reviewed-on: https://go-review.googlesource.com/15559
Reviewed-by: Andrew Gerrand <adg@golang.org>
X-Tour-Commit: 9d789a4a34a57a0a20e92cc41f525e4e84914f34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants