frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Patterns.dev

https://www.patterns.dev/
46•handfuloflight•2h ago

Comments

1970-01-01•1h ago
Thanks, I was looking for something just like this today!
HumanOstrich•1h ago
I was glancing around and landed on the page for the flyweight pattern.[1]

It looks like `addBook` is using the spread operator, which always creates a shallow copy of the book instance properties, thus nullifying any benefits of the flyweight pattern. It also attaches extra arbitrary properties, but still assigns the result to a `book` variable. I don't think this is a great example.

[1]: https://www.patterns.dev/vanilla/flyweight-pattern/

Edit: I forgot to give you kudos for all the effort it must have taken to create all this content, and I appreciate that you're making it available for free.

seabass•1h ago
Love this! Just wanted to note that I think there’s a mistake on the flyweight pattern page’s example. You’re using getting a boolean with Set.has but treating it like a Book (as if you had used Set.get). I also don’t really understand how this saves memory if you’re spreading the result into a new object, but maybe someone here can enlighten me!
seabass•59m ago
Ah I think I understand now. The return type of createBook is true | Book, which is likely a mistake, but happens to work because when you attempt to spread a boolean into an object it removes itself. But if you were to edit the example to have a stable return type of Book then it would no longer save memory, so perhaps that was intentional?
8cvor6j844qw_d6•55m ago
Looks great, time to add it to my bookmarks.

Anyone has other sites like these to share?

- Domain-driven design, design patterns, and antipatterns

https://deviq.com/

- Refactoring and Design Patterns

https://refactoring.guru/

- Standard Patterns in Choice-Based Games

https://heterogenoustasks.wordpress.com/2015/01/26/standard-...

rambleraptor•49m ago
I’ll make a plug for aep.dev, which is a collection of API design best practices and assorted tooling
sdovan1•45m ago
- Java Design Patterns

https://java-design-patterns.com/

android521•51m ago
The ones that actually match POSD (deep modules, small interfaces, lower complexity) and work great with plain functions are:

Module Pattern

Factory Pattern (factory functions)

Mediator / Middleware Pattern (as function pipelines)

Hooks Pattern (custom hooks, generalized)

Container / Presentational Pattern (implemented with function components + hooks)

Everything else is either neutral, UI-only, or fights POSD (Singleton, Mixin, etc.).

Patterns from that page you should treat skeptically for POSD

From Patterns.dev, for your POSD-style codebase I’d avoid or downplay:

Singleton Pattern → encourages global state and tight coupling. Patterns

Mixin Pattern → tends to increase interface surface and make dependencies opaque. Patterns

Observer Pattern → powerful, but event-based wiring can obscure data flow and increase “system complexity” (classic POSD warning). Patterns

neogodless•6m ago
What does POSD stand for?
vivzkestrel•43m ago
fantastic resource! kindly add svelte design patterns too and sveltekit if you can
nl•39m ago
Does anyone remember the Yahoo design patterns library? It was mostly for UX pattern (eg: ways to "Rate an object") and it was really good.

Almost 20 years ago.. damn.

https://creativecommons.org/2006/02/14/yahoodesignpatternlib...

https://web.archive.org/web/20060221111812/http://developer....

They had a great comparison of the different behaviors leaderboards could encourage in users.

101008•34m ago
Oh, the second link is amazing. I love the old web, and that brought a lot of nostalgia.
fiddlerwoaroof•26m ago
I wish people would stop promoting the singleton pattern: in almost every case I’ve seen, singletons are unnecessary tech debt and solve a problem that’s better solved with some form of dependency injection (and I don’t mean the XML/YAML monstrosities various frameworks force on you but rather constructor arguments or factory functions)
HumanOstrich•23m ago
The site is not "promoting" the singleton pattern. In fact, there is a "Tradeoffs"[1] section that calls it an anti-pattern in JavaScript.

In spite of that, there are plenty of reasonable use cases for singletons in many languages, including JavaScript. For example, ES Modules are effectively singletons. If you import the same module in multiple places, it only gets evaluated once.

Let's not turn the singleton pattern into forbidden knowledge.

[1]: https://www.patterns.dev/vanilla/singleton-pattern/#tradeoff...

deaux•4m ago
Why pose DI as replacing singletons when they're used together all the time? Injecting dependencies to create a singleton repository or service class, which is shared across requests.

Size of Life

https://neal.fun/size-of-life/
1532•eatonphil•11h ago•189 comments

Getting a Gemini API key is an exercise in frustration

https://ankursethi.com/blog/gemini-api-key-frustration/
319•speckx•7h ago•127 comments

Australia begins enforcing world-first teen social media ban

https://www.reuters.com/legal/litigation/australia-social-media-ban-takes-effect-world-first-2025...
614•chirau•1d ago•996 comments

Patterns.dev

https://www.patterns.dev/
47•handfuloflight•2h ago•15 comments

Auto-grading decade-old Hacker News discussions with hindsight

https://karpathy.bearblog.dev/auto-grade-hn/
342•__rito__•10h ago•163 comments

VCMI: An open-source engine for Heroes III

https://vcmi.eu/
23•eamag•4d ago•4 comments

Super Mario 64 for the PS1

https://github.com/malucard/sm64-psx
184•LaserDiscMan•9h ago•64 comments

Fossils reveal anacondas have been giants for over 12 million years

https://www.cam.ac.uk/stories/twelve-million-years-of-giant-anacondas
10•ashishgupta2209•1w ago•2 comments

How Google Maps allocates survival across London's restaurants

https://laurenleek.substack.com/p/how-google-maps-quietly-allocates
156•justincormack•1d ago•81 comments

Qwen3-Omni-Flash-2025-12-01:a next-generation native multimodal large model

https://qwen.ai/blog?id=qwen3-omni-flash-20251201
215•pretext•11h ago•86 comments

Rubio stages font coup: Times New Roman ousts Calibri

https://www.reuters.com/world/us/rubio-stages-font-coup-times-new-roman-ousts-calibri-2025-12-09/
190•italophil•1d ago•299 comments

Show HN: Automated license plate reader coverage in the USA

https://alpranalysis.com
130•sodality2•10h ago•84 comments

Common Lisp, ASDF, and Quicklisp: packaging explained

https://cdegroot.com/programming/commonlisp/2025/11/26/cl-ql-asdf.html
52•todsacerdoti•16h ago•13 comments

Gundam is just the same as Jane Austen but happens to include giant mech suits

https://eli.li/gundam-is-just-the-same-as-jane-austen-but-happens-to-include-giant-mech-suits
167•surprisetalk•1w ago•118 comments

When would you ever want bubblesort? (2023)

https://buttondown.com/hillelwayne/archive/when-would-you-ever-want-bubblesort/
69•atan2•6h ago•46 comments

Terrain Diffusion: A Diffusion-Based Successor to Perlin Noise

https://arxiv.org/abs/2512.08309
105•kelseyfrog•9h ago•31 comments

Scientists create ultra fast memory using light

https://www.isi.edu/news/81186/scientists-create-ultra-fast-memory-using-light/
73•giuliomagnifico•6d ago•16 comments

Valve: HDMI Forum Continues to Block HDMI 2.1 for Linux

https://www.heise.de/en/news/Valve-HDMI-Forum-Continues-to-Block-HDMI-2-1-for-Linux-11107440.html
564•OsrsNeedsf2P•10h ago•319 comments

The future of Terraform CDK

https://github.com/hashicorp/terraform-cdk
91•mfornasa•8h ago•98 comments

Launch HN: InspectMind (YC W24) – AI agent for reviewing construction drawings

43•aakashprasad91•11h ago•44 comments

Is it a bubble?

https://www.oaktreecapital.com/insights/memo/is-it-a-bubble
170•saigrandhi•10h ago•252 comments

OpenRouter Broadcast

https://openrouter.ai/docs/guides/features/broadcast/overview
22•Topfi•4d ago•7 comments

RoboCrop: Teaching robots how to pick tomatoes

https://phys.org/news/2025-12-robocrop-robots-tomatoes.html
74•smurda•12h ago•35 comments

Golang's big miss on memory arenas

https://avittig.medium.com/golangs-big-miss-on-memory-arenas-f1375524cc90
105•andr3wV•1w ago•85 comments

Show HN: A 2-row, 16-key keyboard designed for smartphones

https://k-keyboard.com/Why-QWERTY-mini
55•QWERTYmini•10h ago•48 comments

9 Mothers (YC X26) Is Hiring

https://app.dover.com/jobs/9mothers
1•ukd1•11h ago

Typewriter Plotters (2022)

https://biosrhythm.com/?p=2143
105•LaSombra•5d ago•7 comments

Show HN: VoxCSS – A DOM based voxel engine

https://github.com/LayoutitStudio/voxcss
35•rofko•1w ago•5 comments

Factor 0.101 now available

https://re.factorcode.org/2025/12/factor-0-101-now-available.html
109•birdculture•16h ago•12 comments

DeepSeek uses banned Nvidia chips for AI model, report says

https://finance.yahoo.com/news/china-deepseek-uses-banned-nvidia-131207746.html
290•goodway•11h ago•274 comments