1

Consider the following sentences:

It is a recursive function. It is initially called on the root node of the DOM tree (body element).

To combine them I thought to say

It is a recursive function and is initially called on the root node of the DOM tree (body element).

To refine it I thought to say:

It is a recursive function which is initially called on the root node of the DOM tree (body element).

But I doubt the last sentence is grammatical. Can "which" be used to relate such sentences? Because it doesn't distinguish something from other similar things. It is just one function.

Other examples:

He is a boy. He goes to school every day.

Can I say :

He is a boy who goes to school every day!

2

2 Answers 2

1

The difference between the use of and and which is very subtle and technical. And is a coordinating conjunction that can link two equally important things. In this specific case, and links two equally important verb phrases:

It is [something] and is called on [something].  

Which is a subordinating conjunction, which is generally used to join a less important clause to a more important one. The clause (idea) that begins with the subordinating conjunction is the subordinate clause. Subordinate (aka dependent) clauses are often deemed less important ideas because they act as modifiers to the main (independent) clause. In this example, the idea

It is a recursive function is the main point, and the fact that it is initially called on the root node of the DOM tree is more for context. The emphasis here is on the core concept of a recursive function rather than its specific use.


Even though the raw content of the two sentences is the same, the subtle difference between the coordinating and and the subordinating which implies a change in the relative importance of the ideas.

2

Both examples are fine; whether or not there are any other (recursive) functions, there could be, and that's all that's necessary for the relative clause to be grammatical. Similarly, there are certainly very many boys, and while many of them go to school, restricting it with that clause is still meaningful: you're referring to one of those particular boys.

2
  • yes but the second sentence doesn't provide any distinguishing feature for it, it just say how is it used.
    – Ahmad
    Commented Jun 30, 2015 at 19:40
  • @Ahmad: Edited to clarify. Commented Jun 30, 2015 at 19:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .