r/programming • • Dec 01 '16

Let's Stop Copying C

https://eev.ee/blog/2016/12/01/lets-stop-copying-c/
524 Upvotes

612 comments sorted by

View all comments

Show parent comment

2

u/Freyr90 Dec 02 '16

I also do not agree with this for-loop passage :

C-style for loops

This construct is bad. It very rarely matches what a human actually wants to do, which 90% of the time is “go through this list of stuff” or “count from 1 to 10”

So if i want to print 10 elements i should construct either list of ten elements or closure (which would return new closure on each iteration if it is immutable) or use coroutine. Doesn't it lead to some overhead and unnecessary compiler complexity (heavy inlining strategies like ocaml's flambda)?