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/playground: some popup examples aren't worth including #49896

Open
rogpeppe opened this issue Dec 1, 2021 · 2 comments
Open

x/playground: some popup examples aren't worth including #49896

rogpeppe opened this issue Dec 1, 2021 · 2 comments
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@rogpeppe
Copy link
Contributor

rogpeppe commented Dec 1, 2021

The new version of the Go playground includes the following examples:

  • Hello, World!
  • Conway's Game of Life
  • Fibonacci Closure
  • Peano Integers
  • Concurrent Pi
  • Concurrent Prime Sieve
  • Peg Solitaire Solver
  • Tree Comparison
  • Clear Screen
  • HTTP Server
  • Display Image
  • Multiple Files
  • Sleep
  • Test Function
  • Generic min

Some of these are important and useful demonstrations of the playground's capabilities, and useful building blocks for people to use as a starting point for their own examples. In that category, I'd include these:

  • Hello, World! - gotta start somewhere
  • Clear Screen - a playground-specific capability
  • HTTP Server - showing that it's OK to run a network-based program
  • Display Image - another playground-specific capability
  • Multiple Files - demonstrates the txtar format and local modules
  • Sleep - showing it's OK to sleep
  • Test Function - we can define test functions too
  • Generic min - generics available here!

I believe the other examples are less useful - they add clutter to the useful examples, and some of them demonstrate practices that are theoretically interesting but probably not a good idea in practice. In that latter category I'd include the following:

  • Fibonacci Closure
  • Peano Integers
  • Concurrent Pi
  • Concurrent Prime Sieve
  • Tree Comparison

While the above are all interesting, I don't believe they deserve the privileged place in the playground that they currently occupy. For example, it's common for newcomers to Go to overuse channels in situations that they're not really suited for, and using them in examples like "Concurrent Pi", "Concurrent Prime Sieve" and "Tree Comparison" probably won't help in that regard.

I'd suggest that we restrict the examples in the playground to those that demonstrate playground-specific capabilities or act usefully as building blocks for examples that people might build. In other words, let's remove the above set of examples from the pop-up, please 😃 .

As an alternative, maybe include a link to a page showing other examples with playground links, which would allow each link to be framed by some explanation and could scale to include many more possible examples.

@gopherbot gopherbot added this to the Unreleased milestone Dec 1, 2021
@ALTree ALTree added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Dec 1, 2021
@robpike
Copy link
Contributor

robpike commented Dec 1, 2021

It would be a shame to hide some of these, which are solutions that look different and interesting in Go. Perhaps all that's needed is a comment, especially on some of the ones that are more ideas than practice.

@seankhliao
Copy link
Member

Or maybe order them in the dropdown list with the ones demonstrating functionality coming first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants