"correct" formation of questions


A comment in some vb.net code is as follows:

> 現在の時刻が設定時間と一致している **か** 確認する

Meaning, (the following bit of code) checks if the current time matches the
configured one.

According to what I learnt from textbooks etc, the か in there should be a
かどうか, because theres no question word in the sentence, making this incorrect
Japanese. Is that right? I'm confused because this was written by a native
Japanese speaker.




That sentence is grammatical and natural-sounding. In fact, all of the
following patters are grammatical.

> 1) 「Mini-Sentence + か + 確認{かくにん}する」
>
> 2) 「Mini-Sentence + か + を + 確認する」
>
> 3) 「Mini-Sentence + か + どうか + 確認する」
>
> 4) 「Mini-Sentence + か + どうか + を + 確認する」

1) and 2) are used (far) more often than 3) and 4) as using 「どうか」 could at
times make it sound a bit wordy and slightly too conversational in business
situations.

Versions using 「を」 would sound a tiny bit more formal than those without it.

