It's not just a matter of taste, consider
if (!File.Exists(fileName)) throw new ArgumentException("..."); var s = File.OpenText(fileName);
This is similar to your example, but there are several reasons (concurrency, permissions) why the OpenText() method can still fail, even with a FileNotFound error. Thus, Exists-check simply gives a false sense of security and control.
This is a reasonable thing, when you write the GetItemByIdx method, it probably looks quite reasonable. But if you look around in a random piece of code, there are usually many assumptions that you could check before continuing. It is just not practical to check them all over again. We must be selective.
So, in a simple pass method like GetItemByIdx, I would mind the redundant checks. But as soon as a function adds more functionality or there is a very explicit specification that says something about idx, this argument is rotated.
As a rule, an exception should be chosen if a clearly defined condition is violated and that the condition is relevant at the current level. If the condition refers to a lower level, then let this level process it.
source share