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.

Anthropic’s Nasdaq debut

https://www.reuters.com/business/finance/anthropics-historic-debut-put-ais-promise-peril-wall-st-...
806•wslh•6h ago•1538 comments

Pancreatic cancer halted by virus injection in three patients

https://www.newscientist.com/article/2528235-pancreatic-cancer-halted-by-virus-injection-in-three...
447•cybermango•6h ago•64 comments

Synology Security Advisory

https://www.synology.com/en-uk/security/advisory/Synology_SA_26_21
64•choult•1h ago•27 comments

Claude solves two open problems in the physics of black holes

https://www.anthropic.com/research/claude-black-hole-physics
338•cybermango•6h ago•154 comments

How to CAD Almost Anything

https://ocw.mit.edu/courses/res-16-002-how-to-cad-almost-anything-january-iap-2024/
53•o4c•2d ago•9 comments

RegExr: Temporarily Offline

https://regexr.com/
21•somebudyelse•1h ago•14 comments

Garage Door Spam

https://blog.harrison.page/garage-door-spam/
719•harrisonpage•3d ago•303 comments

The 98% Slot Machine: How Paid Advertising Became an Extraction Tax

https://globalcommercegraph.com/writing/the-ninety-eight-percent-slot-machine
162•dev1one1•5h ago•84 comments

Should governments slow frontier AI? Jacob Coxon and Robin Hanson debate [video]

https://www.youtube.com/watch?v=lwfewYL7X0o
59•sandslash•4h ago•103 comments

Show HN: Cornhole News – A Hacker News inspired site for news across the Midwest

https://cornholenews.news
175•cornholemedia•8h ago•86 comments

Someone reported java4shell bug in September 2026

https://github.com/openjdk/jdk/pull/32781
339•notmine1337•11h ago•90 comments

UK government forced to admit it issued Apple a secret encryption order

https://macanorak.com/uk-government-forced-to-admit-it-issued-apple-a-secret-encryption-order/
454•Terretta•7h ago•196 comments

Rebuilding my local voice assistant pipeline

https://blog.platypush.tech/article/Rewriting-my-voice-assistant-pipeline
35•todsacerdoti•2h ago•2 comments

Launch HN: Onlook (YC W25) – An open-source developer tool for designers

https://github.com/onlook-dev/onlook/
78•D_R_Farrell•7h ago•66 comments

Making 8-page foldable zines from a single A4 sheet in the browser

https://krthr.co/paper-folds-and-whats-new-in-fanzines-app/
225•krthr•10h ago•50 comments

Reverse-Engineering Kevin J. Lang's Lost OCaml Code in Apache DataSketches

https://www.tisonkun.io/posts/ai-repair-program/
22•tison•3d ago•0 comments

Computer Graphics from Scratch (2021)

https://www.gabrielgambetta.com/computer-graphics-from-scratch/index.html
34•ibobev•2d ago•9 comments

Ruby2ßhell: Pre-authentication RCE on stock Rails

https://verialabs.com/ruby2shell/
372•jdns•18h ago•158 comments

Pete warden on local AI, open models, voice interfaces, the future of hardware

https://thedataexchange.media/pete-warden-moonshine/
201•datascientist•8h ago•183 comments

Nintendo takes Picofly firmware down from GitHub [video]

https://www.youtube.com/watch?v=-TLCGUpoD6c
244•cowlevel•1d ago•93 comments

How the European Commission rolled out Matrix to more than 40k staff

https://element.io/blog/how-the-european-commission-rolled-out-matrix-to-more-than-40-000-staff/
643•liotier•12h ago•308 comments

An Oregon library ditched Dewey Decimal and got people excited about books again

https://www.fastcompany.com/91597520/oregon-library-ditched-dewey-decimal-wayfinding-system
178•bookofjoe•2d ago•132 comments

Do not buy RAM, compress

https://curiousbits.nl/blog/do-not-buy-ram-compress/
232•Ecno92•14h ago•194 comments

What's New in PHP 8.6

https://www.php.net/releases/8.6/en.php
264•netol•14h ago•126 comments

Unblockable communication with gravity

https://www.science.org/doi/10.1126/sciadv.aee0802
135•rbanffy•11h ago•48 comments

Adding Fortran Support to LLDB (GSoC 2026)

https://blog.llvm.org/posts/2026-09-07-gsoc-add-fortran-support-to-lldb/
29•JDevlieghere•3d ago•8 comments

Court: 4th Amendment Disallows Use Of AI-Generated 'Probable Cause'

https://www.techdirt.com/2026/11/19/court-tells-cops-that-the-4th-amendment-doesnt-cover-ai-gener...
21•defrost•43m ago•5 comments

Distributed, high-performance blob storage on SQLite

https://zerodha.tech/blog/high-performance-distributed-blob-storage/
248•ghostfoxgod•15h ago•68 comments

How to Make the Ink Used to Write Hamlet and the Declaration of Independence

https://lithub.com/how-to-make-the-ink-used-to-write-hamlet-the-declaration-of-independence-and-b...
66•ohjeez•8h ago•28 comments

Everything you need to survive and rebuild society

https://lastbook.org/
346•tejohnso•8h ago•183 comments