Learn English – had you done something, something else would happen or would have happened

past-tense

Example with a context (an excerpt from "The Art & Science of Java: An Introduction to Computer Science" by Eric Roberts):

For example, executing the line

println("Top student " + topStudent)

would produce the following output:

Top student = John Doe (#20456)

Had you left out the implementation of the toString method, Java would instead use the default definition of the toString method from the Object class. The result in that case would be something like this

Top student = John Doe@154865

which is rather less informative.

I don't really understand what actually made the author choose to use Java would instead use over Java would have instead used in that sentence. To me personally, would have instead used sounds like a better choice because it makes total sense that if you had done something in the past, something different would have happened, but since you didn't do that, it didn't happen either. What gives?

Best Answer

  • Executing this line would produce the following output.

I regard "would produce" as employing the present (or possibly future) tense, indefinite aspect, and subjunctive mode.  The subjunctive "would" is more appropriate than the indicative "will" because this is a conditional result of a hypothetical action.  The conditional proposition is suggested by the gerund "executing", and we can't examine the mode of a gerund.

  • Had you left that out, Java would instead use the default.

I regard "had left out" as employing the present tense, perfect aspect, and subjunctive mode.  This subordinate clause presents the conditional proposition.  I regard "would use" exactly the same as I regard "would produce" -- present indefinite subjunctive.

Both "would use" and "would produce" are doing the same job and using the same form.

The conditional proposition in both cases could be purely hypothetical. You need never have executed such a line, and perhaps never will.  You need not have neglected that method, and perhaps never would. 

Had you left the class's method out yesterday (and not fixed it since), Java would instead use the default when it runs your code tomorrow.

 

The "would produce" and "would use" both describe the present (and, because of the meaning of "will", future) behavior depending on the program's condition.  The passage in its entirety is consistent with a present-tense narrative describing hypothetical situations.

I suspect the author wants you to understand that, if you did something different in the past, something would be different in the present.  Your phrasing only suggests that one difference in the past would have caused another difference in the past.