News for hackers. Stuff that matters.
Re:Why I Don't Like Golang (2016) by weberc2 on Wednesday June 12, 2019 @09:29PM (#20171101)
> If you go with most languages definition of "slice", that would be pretty horrible just by itself.

Most languages don't have a definition of "slice" at all.

> What would be pretty much like Java's ArrayList, or Python's list if it was designed on a sane way. So, just the name would be non-standard... But the container actually migrates when it is reallocated! That's a broken design in any language.

It's not broken, it's just fast and simple. But yes, it does require you to know that Go's slices are not exactly Python's lists (which do gratuitous copies). Java's implementation does an insert on the original list (both surprising and an unnecessary copy).

There are no comments on this comment yet.