- Joined
- Feb 3, 2013
Sometimes I like to turn it around and see if people can understand code that someone else wrote. Like, show them some nested loops.
Good: "They're examining every element in a 3-dimensional array until they find one that meets the criteria"
Awful: "OK uh, first x=0,y=0,z=0, then they call f(array[0][0][0]), then if f returned true you break, otherwise you go to the next iteration and x=0,y=0,z=1..."
Ridiculously simple, but so is FizzBuzz and people fail that all the time too.
Good: "They're examining every element in a 3-dimensional array until they find one that meets the criteria"
Awful: "OK uh, first x=0,y=0,z=0, then they call f(array[0][0][0]), then if f returned true you break, otherwise you go to the next iteration and x=0,y=0,z=1..."
Ridiculously simple, but so is FizzBuzz and people fail that all the time too.