Fundamentals 9 min read

Critique of Go 1.23 Iterators and Their Impact on Language Complexity

Aliaksandr Valialkin criticizes Go 1.23’s new iterator feature, arguing it adds hidden control‑flow, memory overhead and readability challenges to an already minimalist language, and warns that such complexity undermines Go’s goals of simplicity, productivity, and performance.

Java Tech Enthusiast
Java Tech Enthusiast
Java Tech Enthusiast
Critique of Go 1.23 Iterators and Their Impact on Language Complexity

Aliaksandr Valialkin, a well‑known Go contributor, recently wrote a strongly worded article about the upcoming iterator feature in Go 1.23, sparking a heated community debate.

The article points out that Go’s new iterator (range‑over‑function) adds considerable complexity to an otherwise simple language. Existing Go code already lacks many high‑level abstractions (monads, option types, LINQ, borrow checkers, etc.), and the author argues that these omissions are intentional to keep the language lightweight.

Generics, introduced in Go 1.18, have seen low adoption after two years, and the new iterator feature further increases the mental load on developers. The author lists three main costs of adding such features:

Reading code becomes harder.

Debugging is more difficult because many abstractions must be skipped to reach business logic.

Adding new functionality becomes harder due to the added constraints.

Go currently provides many inconsistent ways to iterate over values (e.g., archive/tar.Reader.Next , bufio.Reader.ReadByte , sync.Map.Range , etc.). The new "range over function" syntax introduces pull/push iterators, which hide control‑flow statements (return, break, defer, etc.) inside anonymous functions, making the code harder to follow and potentially causing extra memory allocations.

Example of the old explicit callback style:

// old explicit callback method
tree.walk(func(k, v string) { println(k, v) })

Example of the new range‑over‑function style:

for k, v := range tree.walk { println(k, v) }

The author demonstrates how a simple loop that returns a value is transformed into verbose, less‑readable code that may allocate memory (e.g., using strings.Clone ) and require additional state variables.

In conclusion, the author warns that Go is moving toward more implicit and complex execution, suggesting that the core team should focus on simplicity, productivity, and performance rather than adding features that increase language complexity.

IteratorsGogenericscomplexityLanguage Design
Java Tech Enthusiast
Written by

Java Tech Enthusiast

Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.