Same word - written with kana and kanji in two places in the same paragraph. Why?


I am aware that some Japanese words can be written in either kana or kanji and
that the rules about it are not set in stone. This has already been discussed
in some questions and answers here (e.g. [Usage of kanji for words usually
written in kana](https://japanese.stackexchange.com/questions/11746/usage-of-
kanji-for-words-usually-written-in-kana)) but my question is more specific.

My question is about why sometimes the same word would appear once written in
kanji and once written in kana very close to each other. For example, in
Haruki Murakami's story I'm reading now (「かえるくん、東京を救う」), there's two different
way of spelling of 何/なに and 僕/ぼく _within the same short paragraph_. This is a
continuous utterance by the same one character in the story.

> みみずくんがその暗い頭の中で **何** を考えているのか[...]
>
> [...]彼は **なに** も考えていないのだと **僕** は推測します。
>
> **ぼく** には説明のつけられないことです。

Why is it spelled differently like that? Does it have any meaning? Is it just
style? The sentences with 「考えている」 are very similar to each other, yet 何/なに is
spelled differently.

The same difference in spelling is not limited to those words or this
paragraph. It happens throughout the story and affects different words.

**UPDATE**

I feel that the answers below, while helpful, didn't really provide the
ultimate answer to my question (or maybe such an answer just doesn't exist). I
especially feel that concentrating on ぼく written with kana to mean childish
language is not on the mark as the context of the story doesn't suggest that
(I don't blame the helpful people who answered the question for that - they
don't know this context).

I can also add an example from another story 「蜂蜜パイ」 from the same collection
of short stories. Again two different ways of spelling are in the same
passage, close to each other, spoken by the narrator this time.

> [...]今度は左手を袖の中に **ひっこめた** 。  
>  それはすぐに袖の中に **引っ込められ** 、[...]




People normally use consistent way of writing. I would say it's his style to
mix 僕 and ぼく. When you use ぼく instead of 僕, the meaning doesn't change;
however, the impression it gives to the reader is slightly different. It gives
a somewhat childish, soft impression because hiragana is used. 「きみ」 sounds a
bit more tender than 「君」 for the same reason. I guess you could say so for
なに/何 also, but for words other than first person, second person, or third
person, I think there's not much difference in writing in kana and kanji.

This may not be relevant, but another situation where ぼく and 僕 are
distinguished is when talking to a little boy. 「ぼく」, 「わたし」 are sometimes used
as "you" when talking to a child.

> ぼく、迷子？

is asking "Are you lost, boy?" but you wouldn't (at least I wouldn't) use

> 僕、迷子？

since 僕 has a more mature impression than ぼく.

