News for hackers. Stuff that matters.
Re:I Love Go; I Hate Go by masklinn on Tuesday August 02, 2016 @04:51AM (#12208574)
> Is that really the _best_ way to delete from a slice in Go?

Yep[0], and it needs a special case to remove the last element of the slice (if the index is user-provided). If you don't care about the slice order you can also swap the element you want to delete with the last element of the slice and shrink the slice by one element. Also fun, it can leak memory.

[0] https://github.com/golang/go/wiki/SliceTricks

Re:I Love Go; I Hate Go by bbatha on Tuesday August 02, 2016 @10:52AM (#12210361)
That article is a concession speech on why generics are useful. Every single "trick" in the article is titled with the name of the equivalent method in more powerful languages. I don't think its possible to look at that list of tricks or the amount of boiler plate to get simple methods like `sort` or `keys` and assert the language is "simple" and better off for it.
Re:I Love Go; I Hate Go by masklinn on Tuesday August 02, 2016 @12:48PM (#12211242)
Not even that, Go does have generics for its special magical builtin types (map, slice, channels, … are generic) or functions (close, delete or the aforementioned append are generic)