Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Loops are an abstraction over conditional branching and, depending on the kind of loop, some other things.


> Loops are an abstraction over conditional branching

How?


Goto. In the end it's all about manipulation of the instruction pointer.

Loops as deduplication is a very specific subset of looping that is very popular in some languages and almost nonexistent in others. If you don't have destructuring and convenient list literals you might never ever see it in the wild.

But even the Java 7 version (iterating an ImmutableList.of multi-nested Maps.immutableEntry of new FunctionN) can be workable despite its hilarious amount of repeated type annotations, if you have learned to stop worrying and love the tooling. Stuff like typescript makes it a breeze, so much that one might occasionally forget that it's not the regular form of looping.


What do you think is being evaluated on each iteration of a loop?




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

Search: