re: Which types of loops are most popular in the programming languages you use? VIEW POST

FULL DISCUSSION
 

Go only has for loops so there's not much of a choice there 😂

In Python I use for as well combined with various iterators. List comprehensions are favored over map and reduce there.

 

I like go's for a lot. It can be a for, a while, or an infinite loop. It's all in how you use it.

The same idea shows up all over the place in it: "here's some minimal core, fiddle it however you want". It's one of its main attractions ♥️

 
 

Though go is kind of cheating since it's "for" loop can behave in many ways.

 

Honestly it's one of many reasons Go is great, no bikeshedding about iteration

 

The for loop in Go is more flexible than the one in C though. I just started with Go, and it's surprising how much they chose to diverge from other C-like languages.

code of conduct - report abuse