Hacker News new | past | comments | ask | show | jobs | submit login

> Index usage: Go allows to loop over elements instead of indexes and also provides the correct range of indexes in for-loops. More functional expressions would mystify execution, while Go is more WYSIWYG of languages.

Indexes are the default though, you have to explicitly ignore them if you want to use the values directly.

More importantly, there are several simple operations that simply require indexes: most error prone is trying to create a pointer to an element in a slice. The natural, high level way of doing that would be

    pointers := []*element{} 
    for _,value := rang elements {
        pointers = append(pointers, &value)
Which looks very nice, but does the completely wrong thing. You absolutely must use the index version of you want to do this. Same would be true if you were to capture the value in a closure.

True, there are gotchas in the basic data structures and pointer usage.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact