Re:New case studies about Google’s use of Go
by kixiQu on Friday August 28, 2020 @02:36PM
(#24308443)
This seems like a misunderstanding of quadratic complexity. If every i in every foo is checked/operated upon once, that's still linear, no matter if the nesting structure requires nesting flow control.
Isn't this just an issue of having types, versus not?
Although I do remember trying racket, where they solved the same problem by naming functions dict-remove set-remove hash-remove vector-drop etc, which does the job but never have I been more offended thinking I was going in for its abstraction capabilities
Yes, I would rather take the explicitly verbose Go code
To be clear: If foo is a dict, we have one loop. If foo is a list, we have two loops. If accidentally happens to be a string, even then it is nested loops