Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

You might also be curious why the productsList variable is initialized as new list of strings at the start of the method, only for it to be overwritten by the code in the try block. This is a defensive mechanism that ensures that the productsList variable is always set to a meaningful value should the code in the try block fail for some reason. You will see an example of how such a failure might occur in Chapter 3.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

To expand on Dusty's answer:

A more tentative version of

 if the code fails


 if the code should fail

In formal speech an writing, certain auxiliaries (principally 'had', 'were', and 'should', but occasionally 'could' and 'would' and rarely a few others) in an irrealis context can be inverted with the subject to get the same effect as the 'if':

 should the code fail
 had he but known
 were he to leave now

"Irrealis" means that the event or state of affairs has either not yet occurred, or is known not to have occurred when it might have.

"If he knows" and "if he knew" are realis: they are about present and past fact, which are either true or false, even though the speaker may not know which. These cannot be turned round in this way.

"If he should know", is an uncertainty about the future; and "if he had known" expresses a possibility which is known not to have happened; these are irrealis, and can be inverted as above.

As Dusty says, the verb is subjunctive (though in fact 'were' is almost the only distinctive subjunctive verb form in modern English); but I've never heard it called "future subjunctive".

share|improve this answer
Thanks for your detailed explanation! And can you tell me what the sentence "he had but known" in the examples above meaning? –  Liu Dec 10 '10 at 3:35
It means "If he had known (but in fact he didn't)". The "but", like its more colloquial cousin "only" adds a rhetorical or emotional suggestion of "it would have been better if he had known" or "I wish he had known". –  Colin Fine Dec 10 '10 at 11:17
add comment

Should in this usage basically functions similarly to if or in case. You could rewrite the sentence in question as:

This is a defensive mechanism that ensures that the productsList variable is always set to a meaningful value if the code in the try block fails for some reason.

As far as how it functions as a part of speech, I believe it's the future subjunctive form of the auxiliary verb shall (i.e. should fail is the verb phrase)

share|improve this answer
Thanks for your answer! –  Liu Dec 9 '10 at 6:24
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.