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

Obviously your C# code is simpler; yes, I’m comparing to Java. I haven’t seen this style of iterator previously.



Compared to implementing the equivalent Iterator in Java, yes, the Go code is much simpler. But there are better solutions than Go's in several other languages - C#, Python, TypeScript, C++, even in Rust (experimentally).

They all use the same or very similar syntax to my C# sample above, and have the same semantics (plus or minus some details about memory allocation and exception safety). Go, as usual, came late to this party, and is being needlessly different and clunkier.




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

Search: