(Please do not CC me; I am subscribed.)
* Matt Harden <
matt....@gmail.com> [140601 21:54]:
> Even without motivation to delete, things become stale over time. I'm
> thinking decades from now when people want to study the early history of
> the then legendary language known as Go. The mailing list seems likely to
> be archived over the long term. I'm not so sure about the playground.
>
> Wouldn't it be neat if the ML repeater automatically included the code from
> any playground links as attachments?
Long term retention was initially a secondary concern of mine, but this
concern was assuaged by previous assertions that the links would be
retained indefinitely.
My primary concern, however, is one of efficiency. golang-nuts is a
high-volume mailing list, and being able to quickly recognize which
threads are of interest to me is much more important than the longevity
of the playground links. Needing to click a link and switch to a
different app to determine if a small snippet of go code is interesting
is a huge distraction.
The best of both worlds would be to have each
play.golang.org link
include approx. 5 to 20 lines of the most relevant part of the code, but
this requires the human who creates the link to select the relevant
part. If the "share" link included up to 20 lines of the selection if
anything was selected (with "..." or some other marker to indicate
missing top and/or bottom parts of code), the entire code if nothing was
selected but the code was less than 20 lines, and no code otherwise, I
believe reading through the list would be much more convenient. The
code should be indented with a small number of spaces (e.g. 2).
As an example,
http://play.golang.org/p/duRF5gXJEP
package main
import "fmt"
func main() {
fmt.Println("Hello, playground")
}
would look like that, but a longer snippet,
http://play.golang.org/p/kMhHvbl4SG
...
conn, err := net.Dial("unix", os.Getenv("SSH_AUTH_SOCK"))
if err != nil {
log.Fatal(err)
}
defer conn.Close()
ag := agent.NewClient(conn)
auths := []ssh.AuthMethod{ssh.PublicKeysCallback(ag.Signers)}
config := &ssh.ClientConfig{
User: username,
Auth: auths,
}
client, err := ssh.Dial("tcp", server, config)
if err != nil {
log.Fatalln("Failed to dial:", err)
}
...
might look like the above; note that the same amount of indentation is
removed from all lines, so relative indentation is preserved, but the
snippet is not shifted way to the right just because the selection
happens to be several levels of indentation deep.
I would also be in favor of replacing tabs with a fixed number of spaces
(four is my preference) to help prevent right-creep, but that is just an
implementation detail. (For clarification, just in the snippet copied
with the link, not in the playground.)
For comparison, the link
http://play.golang.org/p/duRF5gXJEP and the
longer snippet
http://play.golang.org/p/kMhHvbl4SG convey _much_ less
information in the message. To see what these are, you must click the
links and change your mental focus to a different app (which in my
workflow is in a different "workspace", for some definition of
workspace).
The playground link allows readers to easily run the code, modify it,
and run it again. Having a small, relevant part of the code in the
message helps with continuity and efficiency when trying to read quickly
through a high-volume mailing list when only a subset of the messages
are of interest to a given reader.
...Marvin