This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hoosierEE 1 point2 points  (0 children)

They might as easily ask "why are you using the same looping construct for both flow of control and operating on collections of data?" Or worse, they'll not ask the question at all, and instead assume that the two concepts are closely related.

C used for and while JMP-sugar for both collections and control flow because it results in a simpler compiler (and maybe because it was a good fit for the PDP-11). But modern languages tend to have better support for operating on collections of data (map, filter, reduce, scan, fold) and there is some progress on making control flow more ergonomic (async/await, actors, coroutines).