Skip to content(if available)orjump to list(if available)

LeetCode but You Can Force People to Code in Light Mode

jellyfishbeaver

I must be in the extreme minority, I always prefer light themes.

cosmic_cheese

For me my preference toward dark themes increased through the 2000s along with my need for syntax highlighting as I started writing more complex code. With light themes, syntax colors don’t “pop” nearly as well, giving me fewer visual anchors and making my eyes get lost in the code a lot more easily.

That said, I’m not fond of super dark or pure black-based themes and prefer those with a 75% gray background (with 100% being black) or thereabouts. With pure black themes the code pops too much and it feels like it’s all vying for my eyes’ attention at once.

herpdyderp

I've also found that light themes have issues with syntax color "pop". I always make my own!

wincy

I changed my home office to my “luminarium” where I’m using about 700W of LED bulbs to get my lux to around 10,000. It’s a necessity that I use light mode, it’s impossible to see dark mode.

Also it effectively cured my SAD.

wyre

700 real watts or equivalent watts?

illusive4080

700 real watts of LED has got to be intense. Also your room would be very hot.

wincy

Real watts. I’m working on getting more. I only use it in the winter when I’d be running a space heater anyway. So I’m not wasting electricity I’m just making a useful byproduct.

weebao

My dad also did that to my house too, and I had to try to find a corner dark enough to see my editor in dark mode lol

MadnessASAP

As a real Stan for good indoor lighting, I would like to know more about your setup.

wincy

I’m still experimenting, but right now it’s 28 bulbs attached to my ceiling fan with some 7-way splitters (the ceiling fan is an old one that supports 4 100W bulbs), two big corn bulbs, one 100W and one 250W, I’m still trying to figure out the best way to mount these. Then I had my daughter paint some art and I framed it using LED light strips, I’m gonna put it on the wall.

I haven’t really figured out a good way to diffuse the 250w corn bulb, its blinding to look at and it’s absolutely massive. Maybe I could use ABS and 3D print a translucent shroud and mounting bracket for it.

I had another 100W corn bulb that didn’t use a fan and it burned out after about a year.

I’ll be honest right now I’m in a transition period of moving rooms so I’ll often just spend 30 minutes in there in the morning, although last year I spent 8 hours a day in there. It really helped me during the big snowstorm the Midwest US had recently. I just bought cheap 200W equivalent LED bulbs until I got to the full 28, because that was super easy, then I’ve started experimenting.

In winter time when the sun is shining directly into the window that’s still brighter, but that happened maybe a dozen times over the last 80 days, even with a south facing window. This winter was super dreary.

Sorry I’m rambling, but Maybe at some point I’ll worry about CRIs but this was mostly an experiment. It has definitely helped but if you like indoor lighting you probably already know that.

kleiba

We're in the same boat, my eyes actually start hurting when I look at a light-on-dark screen for more than a couple of seconds.

I'm just really glad that my web browser has a reader mode, or else there would be quite a few web sites (blogs etc.) that I could not read.

null

[deleted]

dijit

I get horrified looks from my dev team when they look at my screen, but I typically use light mode for work, and I find it easier to read by a long shot.

For dev work at home, I use darkmode, but I usually work in a less well-lit environment and for less time.

ImPleadThe5th

Exactly. Light mode for coding in the sun. Dark mode for late night hacking.

dusted

Yeah, I remember back when I was a cringy teenager and bought into all the propaganda about why darkmode was better for eyes and whatnot, so much stuff.. So I spent 15 years or so with darkmode, untile one day, i read somewhere that the evidence of darkmode being better was not just lacking, but that people read dark letters on a bright background faster and more accurately than the other way around.. Now this is the Internet, with a capital I so I won't back up that claim with any references, and it's not important whether anyone believes that or not, fact is, that day, I thought "hm" and I switched my editor back to light mode and thought "hm, this is fine too" and I kept it long enough that I discovered that I prefer it.. Now, my xterm, I do want white on black, but that's just something about how that bitmap font looks to my eyes, that makes me want it that way.

But honestly, I don't get what the big deal is with either preference, it's not a big deal really.. black or white.. it's fine!

maksimur

I use light mode during the day and dark mode from dusk till dawn. I do this because I find it more comfortable, not because I'm told by someone or a study that it's better.

dusted

that's fair, the study didn't convince me it was better, it just prompted me to switch back to white, because, actually, I don't know, and then I found that _if_ it made any difference, it was probably positive, but, even though I sit at the screen from dusk till dawn, I find no difference in how pleasant light or dark mode it, it just makes so little difference to me that I don't care :)

jisnsm

I suffer from astigmatism and dark themes fatigue me a lot.

david422

Same here, I think that's why I prefer light themes when developing. Although I like my terminals dark for some reason.

lemper

same, mate. i'm not sure why people question or consider my preference (that actually affects my situation) as an unusual situation. haven't they ever seen a blind with a stick? to be exaggerating.

tsumnia

WIIIIIIIITCH!

Just kidding ;D

I'm actually studying my students' color theme preferences for lecture slides and I'm seeing that while a majority do prefer dark mode, there is noticeable chunk that still prefer light mode. I think some of it may involve time of viewing, but that is another research question I haven't explored quite yet.

PKop

In the daytime I prefer light mode, and at night I prefer dark mode. I think it's somewhat odd to have a preference inconsistent with the time of day.

johnm

Indeed this is the way.

I also have variants of light and dark for different lighting conditions at night and day (particularly glare).

bdangubic

how long have you been coding? I felt the same in my younger days but discovered over the years that dark mode much more gentle on my eyes.

ramon156

I actually went back from dark to light! Feels pretty good

genewitch

I find it doesn't matter to me. Dark mode means I'm on a server 9/10 vis a vis code; otherwise I'm in notepad++ which is light mode.

I wish the colors on notepad++ were a little darker, and someday I need to figure out why the stock gentoo color scheme looks the best to me, and try and recreate it elsewhere.

mmoskal

I think universally light when using a projector! But maybe nowadays it's remote or big LCDs...

foepys

Same here. I work in an office with lots of daylight and dark mode makes it actually very hard to see.

Also, light theme allows for more distinguishable colors.

weebao

Basically recreated LeetCode on a $5/month VPS lol. It started as a class project but over 800 people joined so I kept refining it for 2 months. It supports running Python, Java, and C++ code (building a code runner is tough). Give it a try and let me know what you think!

The code is also open-source too at https://github.com/beatcode-official

FabHK

In case it's your own project, I believe the convention is to prefix the title with "Show HN:".

weebao

Sorry I'm new here seems like I can only edit the title within 2 hours of posting. Thanks lots for telling me!

conradkay

Neetcode uses/used judge0 for code execution but it might be overkill

https://github.com/judge0/judge0

weebao

Yea I knew about that but I wanted to learn how to build one my own :D

metadat

What were the challenges you encountered / tackled with creating a code runner?

Cool project!

weebao

Thanks! Creating a template for inserting the code would be one. Java has this type erasure thing where the types only appear after compilation so tweaking it around was hard. Spinning up the containers for each submission is slow but it ensures every submission is isolated.

net01

have a look at this "https://github.com/INGInious/containers" - open-source platform for secure and automated code assessment

user9999999999

"Runtime analysis? How is that possible?" I thought...

https://github.com/beatcode-official/server/blob/42169027dda...

dudus

More and more I find code like this. When you dig into an interesting aspect it's just an llm call. I haven't decided yet if it's good or bad. But it does seem to work a most of the time.

The problem is that we're used to code that works all the time or none of the time. With LLMs you can't know if it's right for sure and it's really hard to check.

bean-weevil

Lmao. They need to call that out so the users know not to believe it

Aurornis

Clarifying that it’s the output of an LLM is responsible.

Though LLMs are really good at anything related to plain LeetCode problems. There has been so much written about the standard LeetCode problems across so many websites that it’s all heavily represented in training sets.

null

[deleted]

weebao

Yeah sorry :) At first I tried to do a stress test, then plot a curve and try to find the closest runtime curve to that curve but it didn't work most of the time ;-;

ericye16

lmao, halting problem solved with one weird trick!

dudus

I just wanted to mention another cool alternative

https://neetcode.io/

The author has a YouTube channel where he actually solves a lot of the problems step by step. Really cool as a learning resource

koakuma-chan

He was actually going through a depression and drug addiction, and then he started making YouTube videos where he solved leetcode problems and eventually he got a job at Google and then he quit that job.

leoqa

Getting a job at Google is a superficial achievement that won’t fix any self esteem issues.

dudus

That may be true for a lot of people. But no matter how much you hate a specific company this just isn't true for most people.

For me personally it would be an immense boost to morale. Getting any offer would boost morale but a top tier tech company is the Pinnacle.

bluesnews

That seems a bit silly to call an achievement that pays you money superficial. Also no matter where you are in life, it is feels good to reach goals you aspire to.

courseofaction

Getting a job at a major company gave me the self esteem to realize I could do it myself. It's a boost even if you quit.

weebao

I'm actually planning to put all neetcode videos in my practice mode. Awesome stuff ;D

null

[deleted]

walthamstow

I use light mode when it's light, and dark mode when it's dark. Anything else results in either cooked retinas or excessive squinting.

It baffles me that anyone could be so wedded to their theme that they would use dark at midday in a well-lit office or vice versa.

sureIy

This became obvious to me when switching between my dark editor and the bright website I was developing. It was pointless to have to adjust the screen brightness at every switch.

Once theme switching became part of the OS, I rejoiced.

It still pisses me off when I reach a website that doesn't follow my scheme setting but offers a manual toggle.

walthamstow

Dark Reader extension is my weapon of choice for this, for sites that don't offer a dark mode. I've set it up to follow the system theme, all my apps are set the same, so when I flick the system theme (or it does so on sunset), everything changes. It's the little things in life.

weebao

Imma add an ability that flashes rgb in your editor then. Thanks for the suggestion :D

smohare

[dead]

TrackerFF

I "grew up" coding in bog-standard light mode decades ago, and I guess it just stayed with me? Still do it that way.

EDIT: If you're gonna be devious, just force people to code with blue font over black background.

weebao

I may be evil but I have my standards sir... (Why not just random rgb flashes?)

pavlov

In my universe, the only permitted background colors for programming editors are NeXT white, SGI pastel yellow, and Turbo Pascal blue.

weebao

In my universe, the only permitted background is pitch terminal black

null

[deleted]

jtreminio

> but You Can Force People to Code in Light Mode

As I've aged my preferences have moved away from dark themes to light themes.

I used to have everything in dark mode: terminal, IDE, sublime text, use Dark Reader Chrome extension.

But I can't see shit anymore. I need light!

jorvi

It might mitigate some of your issues by using themes that are anthracite / charcoal / deep gray instead of pure OLED black. Due to the way screen technology and bad eyes work you often get slight halo-ing or double vision with white text on pure blacks.

Also definitely stay away from Solarized. The contrasts on Solarized get muddled really quickly if you run your screen at low backlight intensity and especially if you use a night light blue filter / orange overlay.

Hope it helps!

mattgreenrocks

Dark editor themes has always been one of the most laughable of orthodoxies in tech. Contrast is key for reducing eye strain, especially for extended sessions. And Solarized doesn’t have nearly enough.

(I suspect a decent chunk of Solarized’s popularity came from the fact it was popular, rather than the “science”-based facade it marketed itself as.)

moron4hire

Oh man, I always thought it was some kind of joke theme or something like holiday themes that people only put on for a lark. I didn't realize people actually used it as a daily driver theme. How is that even possible? Even in my 20s I thought it was terrible.

smohare

[dead]

weebao

Hmm there're a lot of light mode fans here. I'll probably need to pivot to some color inverse scheme instead

ukFxqnLa2sBSBf6

It’s a fun idea but the ability gimmick makes me not interested. I imagine it will also quickly be overrun by AI copy/pasters.

weebao

Yea true not sure how to prevent that so ig this is just a project for now

weebao

Kinda insane how this post I made for my project got viral. Got a tons of feedbacks and I just want to thank everyone here for checking it out. Really means a lot for a student trying to build cool stuff :)

amne

I'm just here to praise the "Login as guest". Thank you !!

weebao

You're very welcome :)