frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Throwaway Code: Don't recycle, throw it away (2017)

https://www.sung.codes/blog/2017/throwaway-code-dont-recycle-throw-away
26•sails•1y ago

Comments

RedShift1•1y ago
It'll be a cold day in hell before I start throwing away my 80+ "New" notepad++ tabs.
notTooFarGone•1y ago
i feel called out.

I had to manage my 350 notepad++ new tabs as I migrated to a new PC - it was not pretty.

mehulashah•1y ago
There’s something beautiful about not being riddled with previous artifacts and starting clean with how you imagine you want to build your system. If the system is large enough, you can’t do it that often.
gherkinnn•1y ago
It is a mistake to believe that the code written is the only valuable artefact.

What you've learned along the way is so much more important.

eternityforest•1y ago
I usually find most of the learning happens a year later when I see if my approach is maintainable and handles new requirements.

When I'm actually coding, I'm usually not learning as much, because I'm generally intentionally choosing boring tech everyone already knows.

Most of the learning is less about deeply internalizing concepts and more about things like new features in the Python stdlib.

gitroom•1y ago
Ive got a million messy files saved up, honestly, even when I know just letting go could help me think clearer. Ever wonder if holding onto old stuff slows you down or actually helps you get smarter over time?
1dom•1y ago
I don't think the author is necessarily advocating the throwing away of code here, they're advocating the value of being able to rapidly prototype and move on from seemingly incomplete things.

The whole value proposition of the digital world is that we can store and manipulate it for virtually nothing: there isn't the same cost to having digital stuff, and so there isn't the same gains from throwing it away IMO.

athrowaway3z•1y ago
Create a ~/Archive and throw it in there.

A quick grep every blue moon can be faster than wrangling a LLM into place, and as an added bonus you can look back and laugh at how big of an idiot you were.

klabb3•1y ago
In my experience, if you have a medium sized task with multiple unknowns, it is best to prototype aggressively without a thought about quality, and then start a second iteration with quality in mind. The purpose of the prototyping is learning.

It’s faster (yes) than prototype-then-fixup. Why? Because the ”live refactor” is harder than the greenfield writing phase. The new knowledge often makes the impl straightforward.

It’s also better quality than design-then-build. The optimal architecture and modularization change with knowledge increase, which is best to get via experience. You can design fully upfront but it’s riddled with analysis paralysis - it’s notoriously hard (and slow) to predict unknowns.

Sounds like good advice? Well, the hardest part isn’t to follow it – it’s to know upfront what size of task it is. If it turns out to be easier, you waste a bit of work (prototype-fixup is faster). However, if it’s bigger than you thought – you’re in the best possible position to break down the new problem into subtasks, with no wasted work.

perrygeo•1y ago
If you could package this up in a motivational poster, it belongs in every company meeting room. Speed and quality are not two opposing forces to tradeoff. We can have both.

But we need to get rid of this silly, infantile, unwavering attachment to our source code files. Throw code away. All. the. time. The first version of code is, by definition, being built in the absence of critical information. Why on earth would we get so attached to that which was built in ignorance? In this case we're not "reusing code", we're throwing away knowledge!

Why would you discard everything valuable you learned in favor of a code artifact written before you learned it? Throw away the code instead! Surely the code written AFTER gaining the knoweldge will be both faster and better quality. (and more clear, less tech debt, etc)

dsabanin•1y ago
Very well said. This is such an important point.

I believe that if you truly accept what Hemingway said, that writing is rewriting, you get less attached to the idea of reaching the best design on the first try, and feel better when starting with a suboptimal solution.

Of course this sometimes conflicts with organizational pressures, where that quick and dirty solution may be deemed as enough by some and you won't get to finish with the proper design. For me the trick is to consider first version just an internal stage of work on a feature, not even communicated outwards most of the times, until the appropriate design is reached.

cadamsdotcom•1y ago
We need better words for the different code written for different purposes.

Code written to learn and explore a problem space? Sure.

Code written in response to a prompt, which could easily be rewritten - things like a throwaway “please tell me a story about the contents of this CSV for me and also write code to graph it”. Yep throw it away.

Or keep it as an example for a later model.

That’s very different to code written to high standards intended for others’ use.

We need different words for all of those 3 varieties of code.

We Know Simple Fluids Can Flow. Turns Out, Some Can Fracture

https://www.quantamagazine.org/we-know-simple-fluids-can-flow-turns-out-some-can-fracture-20260710/
73•Anon84•4h ago•26 comments

What xAI's Grok Build CLI Actually Sends to xAI

https://gist.github.com/cereblab/dc9a40bc26120f4540e4e09b75ffb547
213•jhoho•5h ago•105 comments

Mesh LLM: distributed AI computing on iroh

https://www.iroh.computer/blog/mesh-llm
177•tionis•7h ago•41 comments

Show HN: Ant – A JavaScript runtime and ecosystem

https://antjs.org
226•theMackabu•10h ago•100 comments

RISCBoy is an open-source portable games console, designed from scratch

https://github.com/Wren6991/RISCBoy
100•mariuz•8h ago•17 comments

I Did Not Kill Stanley Lieber: How to Draw (With 9front)

https://triapul.cz/automa/i_did_not_kill_stanley_lieber
43•c-c-c-c-c•2d ago•9 comments

Text Art Tools

https://hlnet.notion.site/text-art-tools
9•surprisetalk•3d ago•0 comments

Nvidia, CoreWeave, and Nebius: Inside the Circular Financing of the GPU Boom

https://io-fund.com/ai-stocks/nvidia-coreweave-nebius-circular-financing-gpu-boom
217•adletbalzhanov•12h ago•71 comments

An agent in 100 lines of Lisp

https://thebeach.dev/posts/lisp-agent/
100•jamiebeach•4d ago•5 comments

Why Write Code in 2026

https://softwaredoug.com/blog/2026/07/09/write-code.html
23•zdw•2h ago•5 comments

A pure scheme web programming tool

https://goeteia.dev
75•guenchi•5h ago•20 comments

EF Core 11 makes your split queries faster

https://steven-giesel.com/blogPost/d4401fd0-805a-4703-9d9e-5fe3b57c25ea
14•rellem•1w ago•1 comments

The Energetic Costs of Cellular Computation (2012)

https://arxiv.org/abs/1203.5426
17•lioeters•4h ago•1 comments

Billions of Sketches Reveal Hidden Cultural Variation in Human Concepts

https://arxiv.org/abs/2607.07267
79•Anon84•2d ago•10 comments

A Erlang style pure Scheme Webserver and further

https://igropyr.com
53•guenchi•5h ago•4 comments

UPI: Anatomy of a Payment Transaction

https://timeseriesofindia.com/economy/reads/upi-architecture/
144•prtk25•13h ago•55 comments

We scaled PgBouncer to 4x throughput

https://clickhouse.com/blog/pgbouncer-clickhouse-managed-postgres
197•saisrirampur•14h ago•39 comments

Jellyfish Undersea Roundabout

https://visitfaroeislands.com/en/plan-your-stay/getting-around/world-first-under-sea-roundabout
20•hydrogen7800•3d ago•2 comments

Long Covid May Physically Damage the Nerves That Control the Stomach

https://www.ijidonline.com/article/S1201-9712(26)00608-9/fulltext
94•thenerdhead•5h ago•42 comments

Fixed three bugs that made Qwen3.5-122B a daily driver on Mac Studio

https://mrzk.io/posts/qmlx-maximising-ai-psychosis-minmaxing-mac-studio/
28•marzukia•7h ago•12 comments

The early History of the Singular Value Decomposition (1993) [pdf]

https://www.math.ucdavis.edu/~saito/courses/229A/stewart-svd.pdf
108•wolfi1•14h ago•62 comments

A dock that wakes up reliably

https://fabiensanglard.net/tb4/index.html
61•ingve•5h ago•38 comments

Prefer strict tables in SQLite

https://evanhahn.com/prefer-strict-tables-in-sqlite/
253•ingve•12h ago•125 comments

Biff.graph: structure your Clojure codebase as a queryable graph

https://github.com/jacobobryant/biff/tree/v2.x/libs/graph
125•jacobobryant•4d ago•10 comments

Optimization Solver as a Service

https://www.quicopt.com/developer/getting-started/
30•paddi91•3d ago•18 comments

Doctors die. It's not like the rest of us, but it should be (2016)

https://archive.cancerworld.net/featured/how-doctors-die/
123•downbad_•7h ago•68 comments

Show HN: Learn by rebuilding Redis, Git, a database from scratch

https://shipthatcode.com
149•acley•16h ago•41 comments

Martha Lillard, last US polio patient using iron lung, dies at 78 in Oklahoma

https://abcnews.com/US/wireStory/martha-lillard-us-polio-patient-iron-lung-dies-134668491
66•daniel_iversen•5h ago•18 comments

Show HN: Sqlsure – deterministic semantic checks for AI-generated SQL

https://github.com/sqlsure/sqlsure
29•tejusarora•10h ago•5 comments

Show HN: Orbit – AR satellite tracker, watch 15k+ objects

https://nagylukas.github.io/orbit.html
71•lukas9•13h ago•19 comments