frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

LittleSnitch for Linux

https://obdev.at/products/littlesnitch-linux/index.html
62•pluc•59m ago•27 comments

I ported Mac OS X to the Nintendo Wii

https://bryankeller.github.io/2026/04/08/porting-mac-os-x-nintendo-wii.html
1232•blkhp19•9h ago•214 comments

USB for Software Developers: An introduction to writing userspace USB drivers

https://werwolv.net/posts/usb_for_sw_devs/
178•WerWolv•6h ago•24 comments

Understanding the Kalman filter with a simple radar example

https://kalmanfilter.net
214•alex_be•8h ago•32 comments

They're made out of meat (1991)

http://www.terrybisson.com/theyre-made-out-of-meat-2/
407•surprisetalk•14h ago•113 comments

Muse Spark: Scaling towards personal superintelligence

https://ai.meta.com/blog/introducing-muse-spark-msl/?_fb_noscript=1
260•chabons•9h ago•283 comments

What does it mean to “write like you talk”?

https://arjunpanickssery.substack.com/p/what-does-it-mean-to-write-like-you
14•surprisetalk•2d ago•10 comments

Škoda DuoBell: A bicycle bell that penetrates noise-cancelling headphones

https://www.skoda-storyboard.com/en/skoda-world/skoda-duobell-a-bicycle-bell-that-outsmarts-even-...
526•ra•16h ago•535 comments

ML promises to be profoundly weird

https://aphyr.com/posts/411-the-future-of-everything-is-lies-i-guess
369•pabs3•12h ago•400 comments

Pgit: I Imported the Linux Kernel into PostgreSQL

https://oseifert.ch/blog/linux-kernel-pgit
67•ImGajeed76•3d ago•9 comments

Expanding Swift's IDE Support

https://swift.org/blog/expanding-swift-ide-support/
75•frizlab•6h ago•39 comments

Git commands I run before reading any code

https://piechowski.io/post/git-commands-before-reading-code/
1796•grepsedawk•16h ago•383 comments

MegaTrain: Full Precision Training of 100B+ Parameter LLMs on a Single GPU

https://arxiv.org/abs/2604.05091
257•chrsw•13h ago•48 comments

Who is Satoshi Nakamoto? My quest to unmask Bitcoin's creator

https://www.nytimes.com/2026/04/08/business/bitcoin-satoshi-nakamoto-identity-adam-back.html
298•jfirebaugh•20h ago•223 comments

John Deere to pay $99M in right-to-repair settlement

https://www.thedrive.com/news/john-deere-to-pay-99-million-in-monumental-right-to-repair-settlement
163•CharlesW•4h ago•44 comments

Show HN: Is Hormuz open yet?

https://www.ishormuzopenyet.com/
244•anonfunction•3h ago•110 comments

Understanding Traceroute

https://tech.stonecharioteer.com/posts/2026/traceroute/
84•stonecharioteer•2d ago•11 comments

Show HN: Orange Juice – Small UX improvements that make HN easier to read

http://oj-hn.com/
83•latchkey•7h ago•117 comments

Six (and a half) intuitions for KL divergence

https://www.perfectlynormal.co.uk/blog-kl-divergence
5•jxmorris12•1d ago•0 comments

Ask HN: Any interesting niche hobbies?

252•e-topy•3d ago•387 comments

Trump administration orders dismantling of the U.S. Forest Service

https://www.hatchmag.com/articles/trump-administration-orders-dismantling-us-forest-service/7716263
34•dxs•23m ago•3 comments

Show HN: Tired of logic in useEffect, I built a class-based React state manager

https://thales.me/posts/why-i-built-snapstate/
17•thalesfp•3h ago•31 comments

I've been waiting over a month for Anthropic to respond to my billing issue

https://nickvecchioni.github.io/thoughts/2026/04/08/anthropic-support-doesnt-exist/
267•nickvec•7h ago•139 comments

We moved Railway's frontend off Next.js. Builds went from 10+ mins to under 2

https://blog.railway.com/p/moving-railways-frontend-off-nextjs
177•bundie•19h ago•162 comments

US cities are axing Flock Safety surveillance technology

https://www.cnet.com/home/security/when-flock-comes-to-town-why-cities-are-axing-the-controversia...
627•giuliomagnifico•12h ago•364 comments

Microsoft terminates VeraCrypt account, halting Windows updates

https://www.404media.co/microsoft-abruptly-terminates-veracrypt-account-halting-windows-updates/
464•donohoe•10h ago•181 comments

What does ⍋⍋ even mean? (2023)

https://blog.wilsonb.com/posts/2023-08-04-what-does-grade-grade-even-mean.html
37•tosh•3d ago•19 comments

Teardown of unreleased LG Rollable shows why rollable phones aren't a thing

https://arstechnica.com/gadgets/2026/04/teardown-of-unreleased-lg-rollable-shows-why-rollable-pho...
79•DamnInteresting•1d ago•37 comments

Show HN: Skrun – Deploy any agent skill as an API

https://github.com/skrun-dev/skrun
43•frizull•12h ago•9 comments

Audio Reactive LED Strips Are Diabolically Hard

https://scottlawsonbc.com/post/audio-led
196•surprisetalk•1d ago•57 comments
Open in hackernews

Show HN: Tired of logic in useEffect, I built a class-based React state manager

https://thales.me/posts/why-i-built-snapstate/
17•thalesfp•3h ago

Comments

mjfisher•2h ago
Just to sanity-check my reading of this:

- Zustand exposes itself as a hook.

- MobX does that observer-wrapper thing

- Snapstate instead has an explicit writing step (`scoped()`) at the bottom of a component

If so, I really quite like that. Kudos!

igor47•2h ago
All the examples are fetching data from a server, and in such cases I think tanstack query already does all the hard part. I feel like people under-use react query and put too much state in their FE. This might be relevant if your app has some really complicated interactions, but for most apps they should really be a function of server, not client, state. Of course this exact reasoning is why I moved off react altogether and now use htmx in most of my projects
dsego•1h ago
It's not just react query, you can make a quick useFetch and useMutation hooks (or claude can), it's not that complex. If you don't need more advanced features (eg caching), you can easily cut down on 3rd party dependencies.

    import { useState, useEffect } from "react";

    function useFetch(url) {
      const [data, setData] = useState(null);
      const [loading, setLoading] = useState(true);
      const [error, setError] = useState(null);

      useEffect(() => {
        const controller = new AbortController();

        fetch(url, { signal: controller.signal })
          .then((res) => res.json())
          .then((json) => {
            console.log("Data:", json);
            setData(json);
          })
          .catch((err) => {
            if (err.name !== "AbortError") {
              console.error("Fetch error:", err);
              setError(err);
            }
          })
          .finally(() => setLoading(false));

        return () => controller.abort();
      }, [url]);

      return { data, loading, error };
    }







    function App() {
      const { data, loading, error } = useFetch("https://jsonplaceholder.typicode.com/todos/1");

      if (loading) return <p>Loading...</p>;
      if (error) return <p>Error</p>;
      return <pre>{JSON.stringify(data, null, 2)}</pre>;
    }
hungryhobbit•1h ago
Javascript and classes go together like toothpaste and orange juice. All good JS programmers I know essentially pretend that classes don't exist in the language (or if they use them, they only do so rarely, for very niche cases).

JS does not have classical OOP built in! It has Brandon Eich's prototypal inheritance system (which has some key differences), along with a 2015 addition to the language to pretend it has OOP (but really that's just lipstick on the underlying prototypal pig).

If you use classes in JS, you're bound to be disappointed at some point when they don't behave like classical OOP. Most devs accept that and use more functional approaches (like factory functions) instead of OOP.

epgui•1h ago
For clarity, what do you call "classical OOP"?

(disclaimer: FP all the way, regardless)

hungryhobbit•1h ago
Essentially `new Foo()`, where `Foo` can be a subclass of `Bar` that inherits properties in the same way we all learned in our Java (or whatever actual OOP) language.

JavaScript gives you a class syntax that lets you make classes and extend them from each other, and for the most part they will work the same way as a class from a language like Java ... but some things won't.

You can either become an expert on prototype chains, and how JS actually implements OOP (differently from Java) ... or you can just write factory functions instead of classes.

kretaceous•1h ago
Can you give examples of how they are different? I've only done OOP in JS so I'm not aware of what I'm missing or what's supposed to be different.
epgui•8m ago
Don’t most OO languages have similar differences? My understanding is that even Java is quite different from, say, Smalltalk (which arguably is “more OG”).
lateforwork•1h ago
Encapsulation, inheritance and polymorphism all work fine with JavaScript classes. OOP works just fine.

What doesn't work in JavaScript is functional programming.

DauntingPear7•25m ago
I don’t see how? You can do all sorts of FP in js and it even has some of it in its built in APIs. .then comes from FP
nurple•19m ago
Yes, but promises are (unfortunately) _not_ monads!

https://rybicki.io/blog/2023/12/23/promises-arent-monads.htm...

lateforwork•6m ago
You are right, there are some FP features in JavaScript. But the way it is used in the predominant UI framework (namely React) is definitely breaks FP, see https://mckoder.medium.com/why-react-is-not-functional-b1ed1...
spankalee•1h ago
Counterpoint: classes are a great way to bundle state and logic - which is exactly what UI components are - and components models should use classes more, not less.

React's "functional" components are simply poor approximations of classes. Instead of easy to read and reason about class fields, you put state in useState() function classes that are effectively named by their appearance order in source and who's current state you can't introspect with dev tools!

The component function mixes one-time setup (which should be a class constructor) with repeated render calls (which should be a method), so those of course have to be separated by putting the one-time work inside of a closure inside of the repeated should-have-been-a-callback function. Event listeners and other callbacks are another huge mess. Don't forget useMemo() or useCallback() (but which?).

It's actually quite mad.

And the differences between classical and prototypal inheritance basically don't even pop up under normal class usage in JS: just use class fields, don't mess with the prototype chain, and don't dynamically add or delete properties - all things that are how classical inheritance works - and things just work like you expect.

Weebs•28m ago
They're modeling reactivity, not classes. It's a well established pattern in functional programming

The one time setup mixed with repeated render calls is odd, but it's a design decision they made. It reduces boiler plate, though I don't necessarily agree with it because it is a leaky abstraction

aylmao•55m ago
I think the biggest issue with classes is subclassing, it looks like a good feature to have, but ends up being a problem.

If one avoids subclassing, I think classes can be quite useful as a tool to organize code and to "name" structures. In terms of performance, they offer some good optimizations (hidden class, optimized instantiation), not to mention using the memory profiler when all your objects are just instances of "Object" can be a huge pain.

apatheticonion•53m ago
I have noticed that inheritance is largely ignored by experienced developers but it's a hard argument to make that "all good JS programmers do this".

Classes are invaluable and are an extremely efficient and ergonomic way to manage state in GUI applications.

That said, avoiding classes was published in some blog post at some point and the JS hype machine went crazy with FP. As a consequence, I have yet to observe a maintainable React codebase. Good looking and performant React applications are even fewer and farther between.

Personally, writing idiomatic React has me focus too much on render cycles that I think less about how the application looks & feels. Appropriate abstractions become more difficult to conceptualize and any non-trivial application ends up a 5mb bundle with no multi-threading or optimizations. This is also what I have observed "the best JS devs" do in the wild.

benatkin•6m ago
Inheritance is used here:

https://github.com/thalesfp/snapstate/blob/ba8a8d7ce25d6a4ef...

I'm not sure if it would support inheriting from a custom store very well. It might get tricky with the templating. But the author of this seems to have done a good job of not ignoring inheritance.

molszanski•39m ago
Potato potato. Js classes are just closure sugar. So what?

Syntax makes sense and improves readability in business logic. Readability is good

hackingonempty•19m ago
> Javascript and classes go together like toothpaste and orange juice.

Even HN has been taken over by shills from Big Mint.

benatkin•10m ago
I went through the code, and it is roughly equivalent to doing it without classes. The nesting level in the example isn't deep - everything seems to be beneath a SnapStore or a SnapFormStore, without inheriting from user defined classes. I think the use of classes is fine, and the way that it's introduced in the blog post is good, it says "plain TypeScript classes". It is used as a means for ergonomically writing and understanding the code more than it is for setting up invariants or complex polymorphism.
jemmyw•1h ago
We have a similar style of react state manager that we use at Aha! https://github.com/aha-app/mvc

I think the intent is very similar even though there are some structural differences: move the state and state logic out of the view to classes.

dsego•1h ago
Sorry for being pedantic, but the first example could be rewritten to extract the pattern into a higher level hook, eg useNotifications. One way to simplify components before reaching for store libraries. The reusable hook now contains all the state and effects and logic, and the component is more tidy.

    function Dashboard() {
      const { user } = useAuth();
      const {loading, error, notifications, undreadCount, markAsRead} = useNotifications(user);

      if (loading) return <Skeleton />;
      if (error) return <p>Failed to load: {error}</p>;

      return (
        <div>
          <h1>Dashboard ({unreadCount} unread)</h1>
          <StatsCards stats={stats} />
          <NotificationList items={notifications} onRead={markAsRead} />
        </div>
      );
    }
whizzter•1h ago
Far cleaner, how is testability though?
SketchySeaBeast•1h ago
Very easy - mock the useNotifications and you can easily see all the behaviour by changing three properties.
andrewstuart•1h ago
I use no state manager at all.

Local component state is great.

I use events for all other cross application communication.

Prop drilling is limited to one level - for making components that make children.

oDot•1h ago
The problems OP tries to address are unfortunately a deep design flaw in mainstream frameworks like React and Vue. This is due to 2 properties they have:

1. They marry view hierarchy to state hierarchy

2. They make it very ergonomic to put state in components

I've been through this endless times. There are significant ways to reduce this friction, but in the end there's a tight ceiling.

This is why this kind of work feels like chasing a moving target. You always end up ruining something inherent to the framework in a pursuit to avoid the tons of footguns it's susceptible to.

It's also why I moved to Gleam and Lustre (elm architecture) and bid those PITAs farewell

svieira•8m ago
Is this because Elm forces you to separate the model computations from the view computations, which then lets you compose the model shape in one place and the view shape in the other, or some other property of the framework that I'm not aware of?
apatheticonion•56m ago
Same: https://github.com/alshdavid-public/mvvm/blob/main/examples/...
confidantlake•48m ago
Seems like a solution in search of a problem.
fiddeert•41m ago
Still waiting for "I was tired of AI titles using the format 'I was tired of x, so I built y', so I built ..."
lateforwork•16m ago
You can use React in an MVC framework, with React used to implement the 'V' in MVC. You can use class components, and the code becomes extremely simple. Business logic is moved to 'M' layer (models) and the 'C' layer (controllers) coordinates everything. No hooks or other messy stuff needed.

In fact, React was originally designed to be used this way (as the V in MVC)!

See https://github.com/Rajeev-K/mvc-router