Comment by berkes

1 month ago

Many of the abstractions and nextjs tools do things that my OS does better, cleaner and more predictable too.

I suppose the overly complicated ENV/.env loading hierarchy is (partly) needed because Windows doesn't (didn't?) have ENV vars. Same for inotify, port detection, thread management: *nix does it well, consistent ish. But when you want an interface or feature that works on both *nix and windows, in the same way, you'll end up with next.js alike piles of reinvented wheels and abstractions (that in the end are always leaking anyway)

>Windows doesn't (didn't?) have ENV vars

Nope, windows has had perfectly standard environment variables since the DOS days

  • What's "missing" is the ability to launch things the "Bash" way: `KEY=value ./myApp`. Where the variable is scoped to the single execution.

    Windows' command prompt requires two separate invocations:

        set KEY=value
        ./myApp
    

    PowerShell also:

        $env:KEY='value'
        ./myApp
    

    Or more "verbosely/explicitly":

        [System.Environment]::SetEnvironmentVariable('KEY', 'value')
        ./myApp
    

    Regardless, all those methods aren't "scoped".

> because Windows doesn't (didn't?) have ENV vars.

As long as I can remember in my career, Windows had environment variables. So that's at least 25 years. It's both available to view/edit in the GUI and at the prompt.

Damn, I didn't know someone could be so clueless about Windows or operating system history in general. What the hell do they teach in computer science these days

Windows has had envvars since before Linux existed. It also has FindFirstChangeNotification (or ReadDirectoryChangesW if you hate yourself) since before inotify existed, etc.

Windows has pretty much everything you can dream of (although sometimes in the form of complete abominations), it's just that the people employed by Vercel don't give a shit about using native APIs well, and will map everything towards a UNIX-ish way of doing things.

  • My point was not that windows doesn't have Inotify (or the other stuff) but that it does it different to Unix.

    Or, if you insist, that Unix is inconsistent with how windows does it.

    Which is what those wrappers and abstractions do: they expose a single api to e.g. detect file changes that works with inotify, readdirectorychanges, etc.

  • This seems to ignore the possibility of Windows having done them in a UNIX-ish way to begin with, which would be infinitely better than what Microsoft came up with.

    • Windows had most of these APIs _before_ UNIX ever dreamed them up. You can jerk yourself off about the superiority of io_uring all day long, but it had been in Win32 for 15 years prior, and has kept compatibility throughout. I can't promise that io_uring will still be in the kernel by 2040.

      So, yeah, speaking in hindsight is really easy.

      PS: no, the UNIX way is also shit, just in a different way.