Live data from Hacker News

Highlighting My Code Based on How Much I Care

hank.bond

51–60 of 73 posts

Re: Highlighting My Code Based on How Much I Care

#51
I decided a few years back to forego color all-together in my syntax highlighting because it was always more distracting than helpful.

I built this monochrome and low-contrast simple colorscheme for vim and I’ve been using it since. Haven’t missed colors at all.

https://github.com/aos/vim-ascetic

Re: Highlighting My Code Based on How Much I Care

#54

Earlier quoted context omitted.

The article touches upon this: > Unlike prose, where you usually read it linearly, with code you bounce around based on what connected elements you are exploring. The moment you are jumping around a lot while reading, being able to understand the structure quickly becomes a major help. For example, dictionaries will have the words in a bold font while italicizing things like the plural etc.

The punctuation/indentation already give you structure, all the highlighting does is break up the flow of actually reading. It essentially forces a micro-reset every second or third word rather than allowing you to seamlessly scan to find what you're looking for. It looks unreadable on the blog post because they have an unreadable font that is way too spacey (nothing against pixel fonts, just their particular choice…

It's pretty interesting that you are trying to find a reason for highlighting not working, while it's pretty obvious that many people are using highlighting and it is in fact helping them.

Just that it doesn't work for you, doesn't mean everyone is like you.

Re: Highlighting My Code Based on How Much I Care

#55
post #7

I am convinced everybody gets syntax highlighting wrong and this article backs me up. My pet peeves: - I have no idea how people are supposed to be productive with non-semantic rainbow vomit themes that are so popular in modern editors. I'm too ADHD to want to be overly stimulated by useless information. - I routinely hate encountering Zig code on Github, where the theme they use turns everything brown. Oh it's becau…

I'm color blind. Most color schemes just fuck up reading. Or they hurt my eyes. I haven't found anything that really convinces me, although having some words in bold does help, but the number should be quite limited. I can see the structure easily enough, so there's no need to emphasize "THERE'S AN IF HERE, IT IS A RESERVED KEYWORD!!".

Re: Highlighting My Code Based on How Much I Care

#56

> try to remember what color your color theme uses for class names? While I overall agree with the point of this post and the post being cited, I disagree with the premise that you need to be able to actively recall facts like this. The theme I personally use is quite toned down, but it does use different colors for variables, keywords, arguments, type names, and a few other classes of tokens. I don’t consciously thi…

> have learned them over the years

Well I guess that’s the difference? I personally change themes many times per day depending on my mood and the lighting conditions, and probably go through at least a few dozen themes in a year.

I don’t need to memorize colors either though, I look for differences in colors not absolute colors.

Re: Highlighting My Code Based on How Much I Care

#58

> try to remember what color your color theme uses for class names? While I overall agree with the point of this post and the post being cited, I disagree with the premise that you need to be able to actively recall facts like this. The theme I personally use is quite toned down, but it does use different colors for variables, keywords, arguments, type names, and a few other classes of tokens. I don’t consciously thi…

> Just like I can’t remember the code to my apartment building, yet I type it in multiple times every day. To me it's even less problematic than this. Not being able to remember important codes except via muscle memory is quite unsettling for me because every now and again my muscle memory fails. Like I will get to an ATM and think "wait - what is my PIN?". With syntax highlighting, even if my muscle memory fails me…

> Like I will get to an ATM and think "wait - what is my PIN?".

Apple also has this stupid thing where you sometimes have to type your iPhone pin on your Mac to verify your identity. I’m unable to recall it on a keyboard instead of a keypad.

Re: Highlighting My Code Based on How Much I Care

#59

> try to remember what color your color theme uses for class names? While I overall agree with the point of this post and the post being cited, I disagree with the premise that you need to be able to actively recall facts like this. The theme I personally use is quite toned down, but it does use different colors for variables, keywords, arguments, type names, and a few other classes of tokens. I don’t consciously thi…

> I disagree with the premise that you need to be able to actively recall facts like this

Same. The goal is to differentiate things. I code mostly in Clojure and I love functional code, so the one thing that really stands out is anything that does mutable things: for example there's swap! in Clojure and that one is "bold fluo blue on a near dark background". I don't use it often, so it sticks out like a sore thumb. But I don't need to remember which hexcode I used for the fluorescent blue: I just know it's obvious.

Same for "rainbow parentheses": it helps visually see where the matching closing parenthesis is without needing to put the cursor on the opening parenthesis (which I can do too if I want).

My color code is mostly toned down too.

Post reply on HN