3 ms·
I like examples with more colors? For me, colors serve as a sort of a token highlighter. It's easy to see the different kinds of tokens.
by cyberax 1y ago
I like examples with more colors? For me, colors serve as a sort of a token highlighter. It's easy to see the different kinds of tokens.
- ricardobeat 1y agoI get the impression you did not follow through with the whole article, as that is the point being made. In the colorful examples, variable declaration, access, parameters, method calls and event the mistyped return have similar colors, making the token types indistinguishable. There are also way too many colors to be able to recall anything. Removing color from variables is a bit too far for me though, I expect the declaration and any subsequent access to be visually consistent.
- t-writescode 1y agoI’m the same way. The squiggly lines would tell me if `return` is spelled wrong more than a slightly off color would. But colors help me separate “this whole thing is a string” from “this is a string but with code inside it”. Comments being gray doesn’t make them less visible for me, just visibly different which is all I’m looking for. 99% of the colors don’t actually matter to me. It’s the distinguishing of conceptual elements that are adjacent to each other that matters more to me.