I found the following sentence:
In part of my spare time, I work on fun projects.
I am not sure as to whether there should be a comma. If it is there, then this obeys some rules, for example on adverbial participle (is that the correct term?).
If it is not correct to put a comma here, then maybe the following sentence would be correct?
When I have spare time, I work on fun projects.
Best Answer
It is absolutely correct to have the commas where you placed them. I explain below.
"In part of my spare time" is an adverbial phrase and in formal contexts, I would definitely retain the comma, as it precedes the subject of the sentence. A comma should always be used in this way, but it is sometimes acceptable to omit it when the adverbial is short enough that leaving out the comma will not hamper the reader's grasp of the intended meaning. Thus, a sentence such as
is acceptable in informal contexts. However, one is more likely to find a comma inserted in formal situations:
Now, to the second sentence:
"When I have spare time" is a dependent clause, or more specifically, an adverbial clause. As it precedes the independent clause, it should be followed by a comma. Again, it is possible in some contexts to leave out the comma when the preceding independent or adverbial clause is short enough that leaving it out would not obscure the intended meaning, but contexts such as these are hard to find. In publications like novels or magazines, one might readily find a construction such as this:
This reads easily without a comma. Consider this, though:
It would be difficult to argue for the omission of a comma in this case.
The comma also indicates a pause in communication. The writer can thus choose to insert it or leave it out to create the desired effect. You could bear this in mind while deciding on your commas. Include them where you feel a pause makes sense.