Settings

Theme

LeetCode but You Can Force People to Code in Light Mode

beatcode.dev

120 points by weebao 10 months ago · 116 comments

Reader

jellyfishbeaver 10 months ago

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

  • cosmic_cheese 10 months ago

    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 10 months ago

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

  • wincy 10 months ago

    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 10 months ago

      700 real watts or equivalent watts?

      • illusive4080 10 months ago

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

        • Scene_Cast2 10 months ago

          I routinely run 350 real watts, and go up to 1400 when I really need light. Helps with heating, but doesn't get all that hot.

          • chmod775 10 months ago

            1400 Watt of LEDs is the kind of lighting you'll find atop a tall pole in a sports stadium. That's ~200,000 lumen, or about 10x as much as you'd need to light a large room really brightly. If you put that next to a skylight, it would make the sun look dim. It's certainly not impossible, but that's a lot for a single point light source.

            What are your rooms like? Do you live in a castle?

        • bee_rider 10 months ago

          700 watt space heaters seem pretty common. I’d expect the heat produced by 700 watts of LEDs to be just a tiny bit less than the space heaters (as some of the energy will sneak out the window, photons being sneaky fellows).

      • wincy 10 months ago

        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.

    • weebaoOP 10 months ago

      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 10 months ago

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

      • wincy 10 months ago

        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.

        • genewitch 10 months ago

          Its not rambling if its useful. I have some crazy led cob lights that look like street lights when they're on. I might try them indoors. I have spares for my outdoor ones.

          I might comment wattage and lux if I can, couple days.

        • MadnessASAP 10 months ago

          The idea of 28 bulbs hanging off a ceiling fan sounds hilarious. Good on you though for finding what works and getting it done.

  • kleiba 10 months ago

    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.

  • dijit 10 months ago

    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.

  • dusted 10 months ago

    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 10 months ago

      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 10 months ago

        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 10 months ago

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

    • david422 10 months ago

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

    • lemper 10 months ago

      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 10 months ago

    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 10 months ago

      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 10 months ago

        Indeed this is the way.

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

      • bdangubic 10 months ago

        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.

        • hakunin 10 months ago

          Not the author, but I’ve been coding since the 90s and also ended up switching between light and dark depending on the time of day. The trick is to also adjust screen brightness. With light background you can lower overall brightness. With dark background if you’re in a well lit room, you have to increase brightness to the point where bright words on the screen actually shine too strongly in relation to the dark background. So it actually feels gentler when the background is light but screen brightness is dimmer overall.

        • PKop 10 months ago

          Over 10 years. I used to be dark mode all the time, but in recent years I feel light mode in daytime is much clearer and doesn't clash with the ambient light which forces my eyes to strain more in daylight.

    • ramon156 10 months ago

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

      • genewitch 10 months ago

        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 10 months ago

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

  • foepys 10 months ago

    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.

  • guestbest 10 months ago

    I’m actually moving to an extreme because of the busy colors on the screen attracting distractions, high contrast white on windows with Color Filters on grayscale. It’s like reading a newspaper. Now I just need to increase the window frame borders for the touch screen and it looks like eink

  • immibis 10 months ago

    In my opinion, dark themes are for when your monitor's brightness is set too high.

    • jdyer9 10 months ago

      I always struggled with loving dark mode, but I usually keep my brightness as low as tolerable without straining, and your comment made me wonder if it's related I do like dark mode if I'm working in a super dark room though

      • immibis 10 months ago

        That's exactly why. A lot of monitors don't go dim enough for darker environments, so we make them even dimmer by showing a mostly black picture.

  • weebaoOP 10 months ago

    I love how this went viral because of this thread lol. I do know some friends who prefer light mode too, so maybe an opposite effect of forcing your light-mode-fan opponent to code in dark mode? Dunno lol

  • winocm 10 months ago

    You’re not alone. I do the same, but often I keep the text editor in dark mode but the rest of the system on light mode to help provide contrast.

  • tabony 10 months ago

    Dark mode is difficult to read for me.

weebaoOP 10 months ago

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 10 months ago

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

    • weebaoOP 10 months ago

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

  • conradkay 10 months ago

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

    https://github.com/judge0/judge0

    • weebaoOP 10 months ago

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

  • metadat 10 months ago

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

    Cool project!

    • weebaoOP 10 months ago

      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 10 months ago

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

user9999999999 10 months ago

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

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

  • dudus 10 months ago

    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 10 months ago

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

    • Aurornis 10 months ago

      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.

  • weebaoOP 10 months ago

    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 10 months ago

    lmao, halting problem solved with one weird trick!

dudus 10 months ago

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 10 months ago

    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 10 months ago

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

      • dudus 10 months ago

        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 10 months ago

        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 10 months ago

        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.

  • weebaoOP 10 months ago

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

walthamstow 10 months ago

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 10 months ago

    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 10 months ago

      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.

  • weebaoOP 10 months ago

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

TrackerFF 10 months ago

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.

  • weebaoOP 10 months ago

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

pavlov 10 months ago

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

jtreminio 10 months ago

> 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 10 months ago

    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 10 months ago

      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 10 months ago

        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.

  • weebaoOP 10 months ago

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

ukFxqnLa2sBSBf6 10 months ago

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.

  • weebaoOP 10 months ago

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

weebaoOP 10 months ago

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 10 months ago

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

nialv7 10 months ago

just tried to play a round, the answer checker failed because it compares the results with `result == eval(expected)`, where `expected` is `"true"`, which is not a thing in Python.

eGQjxkKF6fif 10 months ago

This seems like a fun thing, could it be used for a hackathon type style of event with say group participants up to ~100? I'd love to see some hackathons.

  • weebaoOP 10 months ago

    That'll be awesome. I'm also planning a relay style team mode where each person can code for 5 minutes or so and the next will jump in :D

addandsubtract 10 months ago

The "freezio" ability seems more like a power up, than a roadblock. Imagine people actually read what they wrote.

DidYaWipe 10 months ago

I don't see where it says that.

Regardless, is that forcing an inverse color scheme on someone supposed to prove something valuable?

  • weebaoOP 10 months ago

    It's just an ability to annoy people. I also had another one where you can rick roll them in the background :)

    • DidYaWipe 10 months ago

      Ha, OK. I've been annoyed enough through what I will call the Color-Scheme Stupidity years, between the time that Microsoft removed the color-scheme editor from Windows and everyone finally realized that reading black text on the surface of a light bulb all day is stupid.

      They had it right in the '80s (except the Mac): white text on a dark-blue background FTW. And through the '90s and probably into the 2000s, Word even had a specific checkbox option for this scheme: "Blue background, white text."

johnm 10 months ago

A bunch of wimps for not going back to actual VT220 green phosphor terminals. Lol.

phoe-krk 10 months ago

Going for "deletio" too many times causes the JS to go into a loop.

Still, fun.

koinedad 10 months ago

The magic elements are a fun idea!

babyent 10 months ago

Solarized Light 4 Life lol

Dark mode always strained my eyes like crazy. White bg is too much. Solarized Light works best for me.

  • skirmish 10 months ago

    Just changing the white background into pale yellowish and leaving black text as it is for better contrast works much better to me.

  • VirusNewbie 10 months ago

    Same here, spent many years in dark mode but solarized light is perfect and have been happily using it for the last five years. Thank goodness my current companies custom IDE supports it.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection