OK, since the day is shot anyway...
What do experienced programmers expect? It seems like there was a lot of confusion on CB about the first or last element (both wrong).
I expect the answer is 2, which I've confirmed by testing. But obviously, I've seen the source code.
If I were looking at that statement without seeing the source code, I would have to test or read the source code to expect anything at all. Since the statement is called lowercase (I might've used convert_to_lowercase), one is unlikely to use this function to count the number of input arguments. So intuitively, the statement should not return 2. In summary, the point of my effort.
The solution I'd prefer to implement would return Jim. But the most robust answer would probably be to throw an exception.
|