Home
Blog
Code Word Highlights
Updated
Dot Net Perls

Code Word Highlights

Nearly every developer uses syntax highlighting for viewing code. It helps to have keywords and function names highlighted in different colors. However, even when writing about code (in paragraphs of text), it helps to have code words be highlighted somehow.

For example, suppose you are writing about Dictionary, a specific class in C#. But a person might not know this and think you are writing about a dictionary, like a way to check definitions of words. So it helps to highlight the code term Dictionary if that is the subject.

I put some time into adding code word highlighting on the site. It works by:

Using a hard-coded HashMap (or Dictionary if you prefer) of terms.
Using heuristics—a term with a capital letter inside it, or an underscore, is probably code.

I think the new approach makes the site easier to read and use. It can be overwhelming on pages with too many highlights, but overall I find it an improvement.

Dot Net Perls is a collection of pages with code examples, which are updated to stay current. Programming is an art, and it can be learned from examples.
Donate to this site to help offset the costs of running the server. Sites like this will cease to exist if there is no financial support for them.
Sam Allen is passionate about computer languages, and he maintains 100% of the material available on this website. He hopes it makes the world a nicer place.
An RSS feed is available for this blog.
Home
Changes
© 2007-2025 Sam Allen