Elektrine lite

← Feed

@nikitonsky@mastodon.online

Post #1543853

2025-10-15 18:49 UTC

About syntax highlighting https://tonsky.me/blog/syntax-highlighting/

Replies (36)

  • @nikitonsky@mastodon.online 2025-10-15 20:21

    Hell yeah, we have beaten Apple _and_ AI!

    Open ##3084918

  • @amoeba@toot.cafe 2025-10-15 19:05

    @nikitonsky@mastodon.online Alabaster is a gift, thank you for caring about this stuff

    Open ##3084920

  • @fmarini@mastodon.social 2025-10-15 19:26

    @nikitonsky@mastodon.online not sure I agree with regards to bold and italics (though I kinda understand your reasoning), but great read nonetheless 👍🏻

    Open ##3084921

  • @DanOpcode@mastodon.social 2025-10-15 19:27

    @nikitonsky@mastodon.online Great article! Will try out that theme in Rider. Seems like there's a version for Visual Studio too https://marketplace.visualstudio.com/items?itemName=NicolaiVerbaarschot.alabaster-variant-theme

    Open ##3084922

  • @barubary@infosec.exchange 2025-10-15 19:53

    @nikitonsky@mastodon.online Next, let’s tone down punctuation And now you've lost me. "Toning down" means lowering contrast means making it harder to read. Why would I want any part of the code to be hard to read?

    Open ##3084923

  • @remaster@mastodon.social 2025-10-15 20:10

    @nikitonsky@mastodon.online I really enjoyed using the Alabaster theme! This concept is something that you don’t realize until someone puts the finger on it. ☝️ I had some bugs with the JetBrains version, but haven’t gotten around to debug it, so I run some regular ”christmas lights” theme at the moment. 😅

    Open ##3084928

  • @zefu@hachyderm.io 2025-10-15 20:13

    @nikitonsky@mastodon.online u so damn right!

    Open ##3084929

  • @PaniczGodek@functional.cafe 2025-10-15 20:34

    @nikitonsky@mastodon.online reminded me of https://buttondown.com/hillelwayne/archive/syntax-highlighting-is-a-waste-of-an-information/

    Open ##3084937

  • @Kiloku@burnthis.town 2025-10-15 20:35

    @nikitonsky@mastodon.online The black on very bright yellow is pretty hard to read...

    Open ##3084938

  • @aerique@genart.social 2025-10-15 22:18

    @nikitonsky@mastodon.online I've also been using my own restrained theme for ages now: https://codeberg.org/aerique/emacs-theme-aerique#emacs-theme-aerique Another important aspect of what restrained themes do is partitioning the code into easily scannable pieces.

    Open ##3084941

  • @lanodan@queer.hacktivis.me 2025-10-15 22:53

    @nikitonsky@mastodon.online Also reminds me that I sometimes wish assignment and comparison operators would at least not be highlighted in the same way, could make the change to my editor but usually too lazy for that as I tend to use a bunch of different languages.

    Open ##3084943

  • @brouhaha@mastodon.social 2025-10-16 04:32

    @nikitonsky@mastodon.online Back in the ancient days of monochrome displays, programming in Ada (or Pascal), I kinda liked keywords in bold, which IIRC was how they were shown in the Ada Language Reference Manual. But even though I was used to that, I don't really think it was very helpful.

    Open ##3084944

  • @boxed@mastodon.social 2025-10-16 04:54

    @nikitonsky@mastodon.online To me it's always been key to *stick to it*. That is: I started in Turbo C++ 3.0 on DOS, and I have never switched color scheme and only switched font once (and to something very similar). Investing in training your brain on a theme for decades is key to making it work imo.

    Open ##3084945

  • @Adamlett@mastodon.xyz 2025-10-16 05:54

    @nikitonsky@mastodon.online I’ve had many of the same thoughts, and created this Textmate theme: https://github.com/KaptajnKold/Minimal

    Open ##3084946

  • @lofty@fieldprogrammable.gay 2025-10-16 07:07

    @nikitonsky@mastodon.online Per statistics, 70% of developers prefer dark themes. Being in the other 30%, that question always puzzled me. Why?I'm not convinced this is related to colour contrast; for me the reason is a much more basic "my eyes can't handle staring into a searchlight eight hours a day"...

    Open ##3084947

  • @phoerious@mastodon.social 2025-10-16 08:11

    @nikitonsky@mastodon.online I disagree with the premise: Highlighting is not for making things stand out. It's for distinguishing different lexemes. I don't need function names or "retunr" misspellings to stand out. That's what other highlighting layers are for, such as fold markers and linter error squiggly lines. I need to see whether something is a type name, a variable name, a function name, or a keyword, especially in syntactically complex languages such as Rust or C++.

    Open ##3084948

  • @mdione@en.osm.town 2025-10-16 08:13

    @nikitonsky@mastodon.online "Comments should be highlighted, not hidden away". THIS.

    Open ##3084949

  • @smagin@mastodon.online 2025-10-16 08:29

    @nikitonsky@mastodon.online hey, good post, agree on most of the things. So one case of using bold and italic instead of background colors would be to use background color for search highlighting, e.g.

    Open ##3084950

  • @alberand@mas.to 2025-10-16 08:30

    @nikitonsky@mastodon.online Did the animals have to go? And cursors too :(

    Open ##3084951

  • @KewlCat@mastodon.social 2025-10-16 08:47

    @nikitonsky@mastodon.online

    Open ##3084954

  • @lasse@social.tchncs.de 2025-10-16 09:02

    @nikitonsky@mastodon.online good one 👍! For my AVR ASM stuff I prefer only two colours highlighted: labels and comments. On a white background.

    Open ##3084955

  • @borkdude@mastodon.social 2025-10-16 09:43

    @nikitonsky@mastodon.online Has anyone made alabaster for emacs?

    Open ##3084956

  • @nikitonsky@mastodon.online yep yep. Some years ago I watched a talk by Douglas Crockford where, among other things, he discussed syntax highlighting, and conjured https://marketplace.visualstudio.com/items?itemName=darthspectrum.darkdoug for personal use. It took some time to get used to but reading code became so comfortable. I find the actual book analogy helpful here: we do not need different colors for verbs and nouns and so on to be able to read the text

    Open ##3084959

  • @gregatron5@vmst.io 2025-10-16 11:41

    @nikitonsky@mastodon.online @siracusa@mastodon.social Nice. I did similar changes with Solarized back in the day. One thing I do differently (and would like to offer as a suggestion) is to make numbers red so magic numbers stand out in a mildly alarming color.

    Open ##3084963

  • @nikitonsky@mastodon.online

    Open ##3084964

  • @netopwibby@social.coop 2025-10-16 17:10

    @nikitonsky@mastodon.online Ever since I discovered Alabaster, I can't go back.

    Open ##3084965

  • @nikitonsky@mastodon.online Highlighting keywords might be a habit picked up from Algol 60, which used a bold typeface to distinguish keywords (yes, compiler technology was that primitive - https://en.wikipedia.org/wiki/Stropping_(syntax) ). As LISP shows, there's no need to distinguish keywords.

    Open ##3084967

  • @jannem@fosstodon.org 2025-10-17 03:01

    @nikitonsky@mastodon.online Bold works really well in light themes, to make any lighter colors stand out better.

    Open ##3084968

  • @aleck@mastodon.social 2025-10-17 07:20

    @nikitonsky@mastodon.online you really got me to properly look at the default theme in Xcode. **Great** post.

    Open ##3084970

  • @tris@chaos.social 2025-10-17 12:40

    @nikitonsky@mastodon.online @catppuccin@fosstodon.org would like to have a word with you lol I'm using https://felipec.github.io/vim-felipec/ since quite sometime and I like it. Reason why I switched from fancy themes to this was because of the poor contrast in popular themes

    Open ##3084971

  • @tris@chaos.social 2025-10-17 12:47

    @nikitonsky@mastodon.online Also have you seen https://buttondown.com/hillelwayne/archive/syntax-highlighting-is-a-waste-of-an-information/?

    Open ##3084972

  • @starr@ruby.social 2025-10-17 14:17

    @nikitonsky@mastodon.online I don’t use dark mode because it looks better. I use it because I am a vampire and the light mode sears my eyes.

    Open ##3084975

  • @jonclayden@mastodon.online 2025-10-17 23:32

    @nikitonsky@mastodon.online Really interesting post. I've created an Alabaster port for the Nova editor, since there didn't seem to be one yet https://github.com/jonclayden/Alabaster_Nova

    Open ##3084977

  • @nikitonsky@mastodon.online Very interesting article, I am in the process of adapting the dark theme for PhPStorm to my needs. I note all the same the irony of the article which advocates parsimony in the use of syntax highlighting, on a web page with such a bright background 🌞😎

    Open ##3084979

  • @dirtside@phpc.social 2025-10-19 20:03

    @nikitonsky@mastodon.online some dubious unstated assumptions here. "if everything is highlighted, nothing is highlighted" presumes that syntax highlighting is akin to text highlighting; that is, the purpose is to draw attention to some parts (but not others). that's not what syntax highlighting is for; it's for color-coding different elements to make them distinct from *one another*. there is no "base text" in code. bad color choices are a legit issue, but "only color code some things" is the wrong solution

    Open ##3084981

  • @tmr232@mastodon.social 2025-10-19 20:11

    @nikitonsky@mastodon.online This was a fantastic read, thank you. And I'm definitely going to try this out. Also, have you ever seen Source Insight? Their highlighting and typography are _wild_!

    Open ##3084983