6 ms·
I don't understand why you consider loops an abstraction. They are some of the most basic building block.
by IceSentry 3y ago
I don't understand why you consider loops an abstraction. They are some of the most basic building block.
- freehorse 3y agoLoop as an abstraction of copy-paste.
- dragonwriter 3y agoLoops are an abstraction over conditional branching and, depending on the kind of loop, some other things.
- nonethewiser 3y ago> Loops are an abstraction over conditional branching How?
- einichi 3y agoWhat do you think is being evaluated on each iteration of a loop?
- usrusr 3y agoGoto. 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.
- quickthrower2 3y agoThey considered it a dedupe not an abstraction It would be unnecessary to have a loop over keys of a dictionary to call function xyz when you can just repeat the xyz calls (it would look nicer too) Unless the dictionary is huge and dynamically loaded.
- extr 3y agoPeople are getting caught up on the loops thing. All I meant was in my line of work I often end up with many special cases of general processes. Writing a loop prematurely always bites me - I end up writing control flow for handling the one-offs, it somehow always becomes more obtuse than just listing things out literally.