1. 22

  2. 7

    In Poland (and probably many other countries) there are recycled rags for floor cleaning. The linked image is what I have in mind when I hear a word “szmata” (a rag in Polish).

    It looks gray, but really is quite colorful. When you take it in your hands and look at it very closely you will see that really nothing’s gray. Image’s resolution is not good enough to see it, but when you zoom in you can see part of the effect. When you mix the rainbow you are left with mud.

    That’s how even more colorful syntax highlighting looks like for me. I recognize shapes easier than colors. If identifiers do not have different enough shapes, maybe it could be helpful to add more shapes to them? Like this identifier is a triangle, that is a star, and yet another is a small house. That’s what probably is behind common mathematics notation. Using Latin and Greek letters give you more easily recognizable shapes. Of course too much of them and you will also end up with mud, but probably much later.

    I prefer to have very desaturated syntax highlighting scheme. I think it is a bit helpful. When you write something and it immediately changes you can quickly see if you made a typo. I like highlighting of all uses of an identifier under cursor. It’s a fast way to orient yourself with the code. It gives less noise and highly unique shape.

    1. 6

      I never understood why people emphasize keywords.

      Screenshot of my vi color scheme: I highlight comments and literals. Comments must be obviously distinguished from code, especially if there is code in a comment. Likewise, string literals with code in them must be obviously different. Other literals like magic numbers are an anti pattern and should be spotted easily.

      I like the idea of semantic colors. We could also highlight local variables different than global variables or fields, for example.

        1. 3

          Also in response to the article, two different people wrote color-identifiers-mode and rainbow-identifiers-mode for emacs.

        2. 3

          The duotone themes for atom do something similar to this. They aim to use the main colors for more important portions and muted colors for less important things, like builtins, etc.

          I’ve also experimented with this a little bit with https://github.com/belak/emacs-grayscale-theme. Unfortunately, the theming in emacs isn’t quite as flexible as atom, so it’s a bit limited.

          1. 3

            wow, I can see how coloring variables differently makes reviewing and understanding someone else’s code much easier. nifty.

            1. 2

              Wow totally love this idea. Editor and IDE makers please take note!

              1. 1

                This is pretty neat! I thought, how cool, it’ll be easier to discern similarly named variables… but then:

                Variable names with similar prefixes will be assigned similar colors.

                Hmm… maybe not. I wonder if it would be more helpful to make similarly prefixed variables use widely different colors? This mechanism isn’t a beauty contest: I think it would be helpful for tools to highlight their differences, instead of grouping them together.