Fabio Manganiello on Nostr: for ... range = function() may be the construct that finally makes Go a slightly more ...
for ... range = function() may be the construct that finally makes Go a slightly more interesting language to me.
I’ve never liked Go. First, because I’ve never trusted its affiliation to Google. Second, because it reduces expressivity below the minimum acceptable bar for a 21st century language. Programming in Go feels like programming in C, and having to write again and again the same boilerplate, without even functional or proper object-oriented paradigms to make the boilerplate less ugly and more reusable. It was supposed to make code safer and simpler by reducing the options available to developers, but it achieved the exact opposite: developers have to take care of errors handling every time, deinitialization, and more. Programming in Go feels like describing all the nuances in a Shakespeare play using only the vocabulary available to a toddler.
The new function generator + iterator paradigm however seems to fix one of the biggest problems: emulating what Python implements through context managers - initialization of the context, generators / mappers and deinitialization.
Which means that Go takes one more step towards becoming a modern language.
https://utcc.utoronto.ca/~cks/space/blog/programming/GoIteratorsAndAvoidingMistakes
I’ve never liked Go. First, because I’ve never trusted its affiliation to Google. Second, because it reduces expressivity below the minimum acceptable bar for a 21st century language. Programming in Go feels like programming in C, and having to write again and again the same boilerplate, without even functional or proper object-oriented paradigms to make the boilerplate less ugly and more reusable. It was supposed to make code safer and simpler by reducing the options available to developers, but it achieved the exact opposite: developers have to take care of errors handling every time, deinitialization, and more. Programming in Go feels like describing all the nuances in a Shakespeare play using only the vocabulary available to a toddler.
The new function generator + iterator paradigm however seems to fix one of the biggest problems: emulating what Python implements through context managers - initialization of the context, generators / mappers and deinitialization.
Which means that Go takes one more step towards becoming a modern language.
https://utcc.utoronto.ca/~cks/space/blog/programming/GoIteratorsAndAvoidingMistakes