News for hackers. Stuff that matters.
Re:Code Smells: Iteration by hinkley on Wednesday August 23, 2017 @12:12PM (#15082699)
Exhibit A:

    The getLoadNames method returns a List of Strings, which we iterate over in order to see if a particular String value is in there. 

Even in describing the algorithm we aren't informed it's a list of function names.

Edit: from the comments in the code it's pulling field names from a Mongo result set, so it's member variables more so than function names. One half of that relationship is still deterministic at runtime. Mongo records can change whenever but your ORM is dealing with Classes and their contents are known at runtime.

Re:Code Smells: Iteration by s73ver_ on Wednesday August 23, 2017 @12:33PM (#15082894)
Because for the purposes of example, it doesn't matter what the data actually is.
Re:Code Smells: Iteration by hinkley on Wednesday August 23, 2017 @12:40PM (#15082958)
I'll bet you a six pack that hasName is called in a tight loop somewhere. The cost of generating the collection on every call is far greater than the cost of iterating it was.

Can we at least agree that the chosen example has too many other confounding factors in it?