top | item 21665339

(no title)

uxp | 6 years ago

Do I have some weird rendering issue with this website, or do both of these snippets of code have terrible readability and highlighting? If I had to write code using an IDE or editor with this scheme I'd quit my career and go into small engine repair.

https://imgur.com/a/vS2EldV

discuss

order

pcr910303|6 years ago

I'm pretty sure it's b.c. you have dark mode turned on & the CSS didn't consider code snippets.

Try turning them off, it'll look much better.

jeltz|6 years ago

Thanks, it is better now but still not very good.

Mathnerd314|6 years ago

ui.systemUsesDarkTheme = 0 for FF users.

jeltz|6 years ago

Nope, it looks the same to me and I have a screen with high contrast and high brightness. Both his examples are very hard to read. And I have done color blindness tests and know I am not color blind.

Another thing: I think one thing he is missing is how important it is to see at a glance where function definitions are and where possible early returns are. The first example highlights def (function definitions), return (possible early return) and the return type (arguably not that important in most cases).

benkuhn|6 years ago

Sorry about that! I built dark mode after writing this post and it broke the main text color inside the `pre`s, which should have been #222. Should be fixed now.

czr|6 years ago

hack to switch to light mode, if you don't want to do it systemwide (paste into console):

    Array.from(document.styleSheets).forEach(ss => Array.from(ss.rules).forEach((ssr,i) => {if (ssr.cssText && ssr.cssText.includes("dark")) {ssr.parentStyleSheet.deleteRule(i)}}))

FPGAhacker|6 years ago

That’s what it looked like for me. I thought maybe it looked illegible to me due to red-green color deficiency.

FPGAhacker|6 years ago

It’s a dark mode thing. Looks normalish with dark mode off.

jeltz|6 years ago

Nope, I am not color blind and it is very hard to read for me too.

saagarjha|6 years ago

The text is black for me on my iPhone.

FPGAhacker|6 years ago

It might be a dark mode thing.

Edit: Yep, dark mode mangled the code snippets.