Effect of words highlighting on reading comprehension
I can speak to this question somewhat from a cognitive psychology standpoint. We memory researchers would think of text highlighting like this in terms of distinctiveness. (An article by McDaniel and Bugg (2008) may shed some light.) Simply put, highlighting a word in a different color than the rest of the text draws what we call item-specific processing towards that word. You'll have a better memory for it, for sure -- and maybe this ties into goals more relevant when writing code.

Increasing item-specific processing, however, comes with a cost: It detracts from organizational processing, which is involved with interrelating sentence (or code) elements, memory for order, and so forth.

Also note that the more items that are made distinctive, the less of a benefit making an additional item distinctive provides (e.g., if words are multicolored already, making a new word red or green doesn't really do anything to the distinctiveness of that word).

So when you use a lot of different highlighting colors, like in the example image, two things are happening: (1) too much distinctiveness is being used, washing out benefits from distinctiveness; and (2) increasing item-specific processing for individual items damages memory and processing for the structure. In essence, the example given is the worst of both worlds.

To answer your question, it might make sense to only use highlighting (or colors, fonts, etc.) to highlight key points, etc.; much like what we already do in writing for the web. Like anyone who highlights a textbook knows, it doesn't do any good to highlight an entire chapter.