News for hackers. Stuff that matters.
Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @11:19AM (#36271281)
It's not a secret; they're all over the place.

The article title is "Executable examples in Go". You shouldn't editorialize titles, especially when it makes the title significantly worse.

Edit: seems the article title has changed or is A/B tested so never mind I guess (can't delete since there are replies), but it's still not a "secret".

Re:Golang’s best-kept secret: ‘executable examples’ by mynameisvlad on Saturday June 10, 2023 @11:25AM (#36271339)
Are we looking at the same article? Its title quite clearly is “Go’s best-kept secret: executable examples” so the title here is only minorly editorialized.
Re:Golang’s best-kept secret: ‘executable examples’ by HerrFolgreich on Saturday June 10, 2023 @11:31AM (#36271386)
In arp242's defense, I opened the article a couple of minutes ago and it showed the same title he was faced with until I refreshed the page.
Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @11:30AM (#36271384)
It shows like that for me too now, but I am 100% sure this wasn't the case a few minutes ago. I copy/pasted the title.
Re:Golang’s best-kept secret: ‘executable examples’ by Jtsummers on Saturday June 10, 2023 @11:30AM (#36271380)
The article (at the linked page, not here) title was changed. The original was as GP described it, and in the last few minutes it was altered to match the HN title.
Re:Golang’s best-kept secret: ‘executable examples’ by jrockway on Saturday June 10, 2023 @11:29AM (#36271371)
I also like how the HN submitter changed the name of the programming language to "Golang". I guess they also call Ruby "ruby-lang" since they didn't get "ruby.org"?
Re:Golang’s best-kept secret: ‘executable examples’ by mynameisvlad on Saturday June 10, 2023 @11:33AM (#36271406)
Golang is a common way to refer to Go, especially for SEO purposes. “Go” is hard to search for.

https://go.dev/doc/faq#go_or_golang

I use “golang” for clarity all the time, and I’m sure many others do as well. There’s no ambiguity you’re talking about the language then.

Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @11:41AM (#36271481)
I personally strongly prefer to use Go, and would never use "golang" or "Golang", but I don't mind if other people do and I'd never complain about it. The reason for this is simply that I don't like the sound of the word "golang"; there are some other words I avoid for similar reasons, I think everyone has a few of those.

The thing is that the article title uses Go while the submission here uses Golang. I wouldn't be too happy if someone submitted one of my articles and changed words like that, especially if it's to something I dislike. That's also why I complained about the editorializing in the first place, because I'd be a bit peeved if someone added something like "best-kept secret" in there (but the article title changed, so that's now a moot point).

Conversely, I'd also never change "golang" to "Go" when submitting something.

Re:Golang’s best-kept secret: ‘executable examples’ by Jtsummers on Saturday June 10, 2023 @11:44AM (#36271512)
> I wouldn't be too happy if someone submitted one of my articles and changed words like that

gus_leonel appears to be a pseudonym for the author of the post. They have essentially no comments and most of their submissions are related to this Bitfield Consulting. So it's the author editorializing their own submission titles.

Re:Golang’s best-kept secret: ‘executable examples’ by Waterluvian on Saturday June 10, 2023 @11:48AM (#36271549)
I use Golang because Go is horrible to search for.

I also get into a habit of “Rust lang” because of the video game.

Yes, I could do a bunch of search engine customization stuff or pick someone else’s favourite engine. But this is simpler.

Re:Golang’s best-kept secret: ‘executable examples’ by mynameisvlad on Saturday June 10, 2023 @11:49AM (#36271555)
Based on the submitter’s posting history and change in original article title, I’m going to go on a limb and say that the submitter is the original author.

Yeah, the names don’t match, but out of all of the things they submitted, at least half are articles from this site.

But beyond that, I mean, does it matter? You might not appreciate it, sure, but you’re also not the original author. I’d get the argument if the author came in and said it, but at this point this just seems like complaining for complaining’s sake and you not agreeing with the phrasing used in the article or submission title. That’s certainly your opinion to have, but is there any benefit to expressing it? This doesn’t seem like a relevant discussion about the article contents.

Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @12:07PM (#36271713)
> I mean, does it matter? You might not appreciate it, sure, but you’re also not the original author.

Well, no, but I'd rather not assume anything: just let the author pick the title.

(I assumed that "gus_leonel" wasn't the author, since John Arundel has his own HN account under his regular "bitfield" username, but they do post a lot from bitfieldconsulting, so idk).

Re:Golang’s best-kept secret: ‘executable examples’ by mynameisvlad on Saturday June 10, 2023 @12:16PM (#36271797)
If the original author has a problem with it, they are free to come in and make the complaint themselves. It’s your opinion to have but not your argument to make and while you may not appreciate it, even if the author isn’t the submitter (I still very much think they are), they clearly did considering the article title was changed to more closely match the submission, and they have a keyboard and can make the argument for themselves if they are irked by the changes.

All this discussion seems to be doing is derailing the comment threads. Almost half the comments here are not about the article itself but your opinions on the words used in the title.

This is also a funny way to not assume anything:

> (I assumed that “gus_leonel” wasn’t the author

> Well no, but I’d rather not assume anything

I don’t see the benefit of this discussion existing in the first place, let alone continuing it, so I’m going to stop here.

Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @12:32PM (#36271952)
> If the original author has a problem with it, they are free to come in and make the complaint themselves.

Most won't know it's posted, or won't see until after it no longer matters. "Don't editorialize" is the simplest and surest way to respect the original author.

"Don't editorialize titles unless the original title is very nondescript or clickbait-y" is not a controversial HN policy.

Re:Golang’s best-kept secret: ‘executable examples’ by mynameisvlad on Saturday June 10, 2023 @12:36PM (#36272004)
I said I would stop but come on.

> Most won't know it's posted, or won't see until after it no longer matters.

They very clearly did considering they changed the article title. At this point you literally are complaining for complaining sake.

This is not a productive use of any of our time.

Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @01:00PM (#36272314)
My apologies. You were already on my blocklist of toxic HN users never worth engaging with, but it seems my extension wasn't side-loaded in Firefox after a reboot so I accidentally saw your replies. Won't happen again.
Re:Golang’s best-kept secret: ‘executable examples’ by mynameisvlad on Saturday June 10, 2023 @01:17PM (#36272461)
I guess this is what happens when you have nothing to actually rebut.

Falling back on ad hominems and irrelevant information that, frankly, nobody would ever care to know. Sometimes, you don’t have to say what’s on your mind. I would have hoped the rest of this thread would have shown you that, but clearly that didn’t happen.

Great use of all our time. At least you won’t see this comment to continue your insults of me. Something that, considering you seem to know the guidelines well, is frowned upon here.

Re:Golang’s best-kept secret: ‘executable examples’ by dang on Saturday June 10, 2023 @04:06PM (#36274535)
Whoa, please don't get personal and please don't perpetuate tit-for-tat spats on HN. I know they can be hard to extricate oneself from, but they're very much against the intended spirit here.

https://news.ycombinator.com/newsguidelines.html

Re:Golang’s best-kept secret: ‘executable examples’ by dang on Saturday June 10, 2023 @04:06PM (#36274532)
Whoa, please don't get personal and please don't perpetuate tit-for-tat spats on HN. I know they can be hard to extricate oneself from, but they're very much against the intended spirit here.

https://news.ycombinator.com/newsguidelines.html

Re:Golang’s best-kept secret: ‘executable examples’ by tekla on Saturday June 10, 2023 @11:51AM (#36271575)
Your preferences/likes/dislikes are irrelevant. "Golang" is a official way to refer to the Go language.
Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @11:59AM (#36271650)
I explicitly said that it's fine to use golang. I am saying I don't like people changing my words, which is entirely reasonable and a very different argument than "never use golang".
Re:Golang’s best-kept secret: ‘executable examples’ by jchw on Saturday June 10, 2023 @01:39PM (#36272723)
It seems as though the submitter is also the article author and changed it on the page to match the HN title.

https://web.archive.org/web/20230117212610/https://bitfieldc...

This is an interesting conundrum. Clearly the new title was chosen because it sounds more alluring; I mean, it hit the front page. But also, the OP could've easily done this prior to submitting and it would be totally normal, since people adjust article and post titles all the time.

Does come off as mildly sneaky when you do it in this order, but maybe I'm just nitpicky.

Re:Golang’s best-kept secret: ‘executable examples’ by mperham on Saturday June 10, 2023 @11:31AM (#36271388)
Re:Golang’s best-kept secret: ‘executable examples’ by jerf on Saturday June 10, 2023 @12:26PM (#36271909)
It certainly isn't a secret in the sense that they didn't want you to know about this feature, but it is a de facto secret in that you can find people who have been programming in Go for year who don't realize they exist. In addition to the other replies you can already find in this HN discussion mentioning that, I can attest to the fact that I've personally introduced them to multi-year programmers in Go as well.

I hypothesize that a very simple and easy-to-make mistake created this situation, and it is as simple as this: Godoc collapses the examples. Behind undistinguished links. Look at the current rendering for the documentation for net/http, the core HTTP package: https://pkg.go.dev/net/http Your challenge is to scroll through the package with the scrollbar, looking for the Examples.

Of course, if enough people will find this, some will find them quickly. Someone will simply jerk their mouse and scroll right too it in a quarter of a second, of course. But in general, they're not easy to find, even when I'm telling you to look for them. If you don't even know they are there they are super easy to miss. The main listing for the examples is between the Index and the Constants. In the left section breakdown, they don't get their own top-level section but are instead by default buried unexpanded below Index, where I would personally assert they don't belong. Even if you scroll to the documentation for a specific function that includes an example, such as Hijacker: https://pkg.go.dev/net/http#Hijacker , I think it's very easy to be scanning through and miss the little Example link in all the noise. And again, in this context I'm calling your attention to it; in normal circumstances I think link blindness kicks in and people can read these docs for years without catching them.

And then of course even if you do catch them it's easy to come away thinking it must be something special the standard library can do but you can't, because that is a Go thing, and so few 3rd party packages avail themselves of this. But you can easily do them yourself. It's little more than a slightly specially-formatted test function.

Re:Golang’s best-kept secret: ‘executable examples’ by arp242 on Saturday June 10, 2023 @01:05PM (#36272361)
Well, it doesn't really matter – my main complaint was that the title was editorialized in a way that I personally wouldn't appreciate for my own article, but now the article title changed and the submitter may be the article author (not entirely clear). I would have deleted my previous post if I could.
Re:Golang’s best-kept secret: ‘executable examples’ by meling on Saturday June 10, 2023 @01:27PM (#36272580)
You make some good points about the examples visibility in the docs. I suggest that you write up an issue on Go’s issue tracker.