Why are background-colors not or rarely used for syntax highlighting? [closed]

I wonder why I rarely see any IDEs or other developers that use background colors for syntaxhighlighting.

One of the first things when installing and configuring a new IDE is adjusting the colors so that for example comments have a decent light-grey background. This really helps me seeing where documentation is and where code is when scrolling down fast.

The only time i saw something like that was in the Greenfoot Editor but that didn’t look so well at least if you are doing some more complex work and there are more nested conditions and stuff.

So why is it that background colors are rarely used; or does anyone have some good examples where they are used and how?

3

Text color is enough for that purpose. In most editors I’ve used, I can clearly see the comments, the keywords, the strings, etc. There is simply no need to visually complicate stuff with background color.

Another element is that backgrounds are used, but for the purposes other than syntax highlighting. For example, in Visual Studio:

  • Background colors are used to highlight the current line (not the configuration by default) as well as the matching brackets or every use within the file of a currently selected variable.

    This alone is a good reason not to use backgrounds for syntax highlighting. Changing background to highlight the occurrences is a very powerful visual way to show information if and only if the background stays uniform elsewhere.

  • Yellow background is used for quick search.

    This is another good example. You can see in practice how difficult such search becomes in a browser when the webpage uses too much background colors. You simply can’t see where the search occurrences are.

  • Dark red background and yellow background are used when debugging.

  • Light yellow, light blue and light red are used to show the results of code coverage.

  • Other colors are used during a diff in TFS to highlight added and removed text.

    enter image description here

Not using background colors for syntax highlighting makes it possible to keep background colors for something special. If you already use backgrounds for syntax highlighting, you’ll end up with a visual mess.

Your example of Greenfoot Editor is a different illustration. They use background for nesting, so using it also for syntax highlighting would create a mess too. Note that their case is problematic too; not, like you said, “if you are doing some more complex work and there are more nested conditions”—if your code has five nested levels, you’re screwed anyway and your first concern should not be the IDE, but the code itself, but rather because if the code is formatted correctly, nesting is visually clear, and there is no need to add colors.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật