News for hackers. Stuff that matters.
Re:Fun with Go Iterators by nine_k on Thursday October 10, 2024 @01:55PM (#41801404)
But this is apples and oranges. Process 1 creates and calls lambdas, etc.

A proper comparison could be:

  # Case 1.
  for n in range(len(data)):
    data[n] = transform1(data[n])
    data[n] = transform2(data[n])

  # Case 2.
  for n in range(len(data)):
    data[n] = transform1(data[n])
  for n in range(len(data)):
    data[n] = transform2(data[n])
Re:Fun with Go Iterators by thrww120956 on Friday October 11, 2024 @04:41AM (#41807573)
It illustrates how this kind of code is used in the wild - array functions vs a for loop. What you did is not even a fruit, if I go along with your metaphor.