Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Basics (Retired) Prepare and Plan Workspaces

Stefan Kowalski
Stefan Kowalski
117 Points

Color of code

Why my code in workspace does have a different color? For instance "class has blue, program has black, comment has green.

2 Answers

Steven Parker
Steven Parker
210,936 Points

What you are seeing is the result of an editor feature called "syntax highlighting". The editor knows enough about the language to identify certain code elements, and it applies a color to each type to help distinguish them visually.

As you've noticed, keywords are shown in blue, and comments are shown in green. And perhaps you haven't seen it yet, but literal strings are shown in red.

Stefan Kowalski
Stefan Kowalski
117 Points

Thank you for replay. I've formed probably wrong my question because when I've launched my workspce. I have different colors than Jeremy in Video has. In my workspace class is blue in video class is blue, method is blue I video is read.

Steven Parker
Steven Parker
210,936 Points

It's possible that the specific colors changed as part of an editor upgrade that happened since the video was made.