What went wrong?
>>59139189
They looked at Java and tried to improve it by making it more like C.
Then they looked at C and tried to improve it by making it more like Java.
It's literally the fastest growing language ever FUCK OFFFFFFFF
Nothing.
I just don't get slices. Why couldn't they just leave arrays as they are
>>59139189
Go is nice. However if you are looking for an easy to learn, well documented, safe and fast compiled language I suggest you learn D.
The only downside of D is it's based on a cancer called C
>>59139839
True programmers use C
>>59139458
so?
The second is javascript, that doesn't make it good.
>>59139816
better performance.
>>59140457
literal how. I don't see how slices improve performance at all over arrays.
>>59139816
aren't slices arrays underneath, and just a language feature for dynamically sized arrays?
>>59139839
>However if you are looking for an easy to learn, well documented, safe and fast compiled language
but you just described go?
Not really, it seems like an overly convulted way to do something everyone already knows how to do in other languages especially for operations like growing and shrinking and edition
https://stackoverflow.com/questions/15945030/change-values-while-iterating-in-golang
>>59139816
If you use a slice as an array they are exactly the same.
>>59140309
True programmers use assembly
>>59140593
D is faster than Go and better docummented than Go
>>59140761
I don't see anything in that stack question or thread that proves you can't use a slice like an array. Just use a pointer.
>>59140742
If you want reference type semantics, use a reference type.
type Node struct {
Attr []*Attribute
}
Then this code from SO works exactly as written:
for _, attr := range n.Attr {
if attr.Key == "href" {
attr.Val = "something"
}
}
>>59139189
http://nomad.so/2015/03/why-gos-design-is-a-disservice-to-intelligent-programmers/
>>59140773
Anything big written in D? Actually curious.
>>59140803
https://wiki.dlang.org/Current_D_Use
I use terminix everyday, it's written on D. If you seek asylum from C and want to create Linux Desktop application, D is an excellent choice followed by Rust
>>59140775
>Slicing does not copy the slice's data. It creates a new slice value that points to the original array. This makes slice operations as efficient as manipulating array indices. Therefore, modifying the elements (not the slice itself) of a re-slice modifies the elements of the original slice:
>A slice cannot be grown beyond its capacity. Attempting to do so will cause a runtime panic, just as when indexing outside the bounds of a slice or array. Similarly, slices cannot be re-sliced below zero to access earlier elements in the array.
https://blog.golang.org/go-slices-usage-and-internals
>>59140782
All this switching of pointer and values is confusing coming from C like languages. I don't see why they have to apply this paradigm on the language itself rather than the compiler.
>>59140828
shout out for terminix
>>59140793
>tfw too intelligent for Go
>>59140897
Comfy.
>>59140828
Yeah boi, D is the secret redpill
>>59139189
autistic logo