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.

A short explainer on how El Niño works [video]

https://www.youtube.com/watch?v=7_JF3etiAv8
70•nharada•2h ago•7 comments

'Birdbrain' Is a Misnomer. Crows Make Decisions Faster Than We Can

https://www.nytimes.com/2026/11/15/science/birdbrain-crows-birds-research-decision.html
65•gumby•2h ago•35 comments

The MacBook Pro's OLED PWM problem

https://macanorak.com/the-macbook-pros-oled-pwm-problem-when-a-better-display-becomes-worse-to-use/
319•MacAnorak•7h ago•172 comments

Do House members' stock trades beat the market? A test of 8,900 trades

https://arkanumdata.com/research/house-trades
14•Bluestein•47m ago•1 comments

Emacs Is My Browser

https://joshblais.com/blog/emacs-as-my-browser/
127•nyc111•5h ago•65 comments

Eclipse Mosquitto – An open source MQTT broker

https://github.com/eclipse-mosquitto/mosquitto
26•gregsadetsky•1h ago•8 comments

Things That Turbo Pascal Is Smaller Than (2011)

https://prog21.dadgum.com/116.html
152•ksec•6h ago•74 comments

Claude Code and Codex reverse engineered my 1994 Jeep's ECU over a $3 Arduino [video]

https://www.youtube.com/watch?v=WPj3aQ-xxpI
202•envoked•3d ago•93 comments

Microsoft 365 outage leads to chlorine gas poisoning of 15 hotel guests

https://www1.wdr.de/nrw/rheinland/rhein-erft-kreis/technischer-defekt-chlor-phantasialand-100.html
127•DeepLogin•1h ago•52 comments

SpaceX catches the Starship to end Flight 15

https://www.spacex.com/launches/starship-flight-15
1584•ls612•23h ago•1127 comments

Understanding Positional Embeddings in Modern LLMs

https://magazine.sebastianraschka.com/p/understanding-positional-embeddings
160•vismit2000•8h ago•12 comments

Bullet Dodged

https://idiotking.org/archives/2026/10/bullet-dodged-3/
11•surprisetalk•3d ago•6 comments

All AI-generated code should be Open Source

https://jakub.jankiewicz.org/blog/ai-code-open-source/
909•jcubic•5h ago•488 comments

Clice v1.0 Released: Welcome to Modern C++

https://ykiko.me/en/articles/2105384023094834022/
29•molenzwiebel•3h ago•7 comments

Notes on Mathematics for Engineers (1959) [pdf]

https://websites.umich.edu/~ners311/CourseLibrary/MathNotes.pdf
37•the-mitr•4d ago•10 comments

Parents pay $75k for Alpha's AI school. Half of its students missed math target

https://fortune.com/2026/11/14/alpha-school-ai-students-tuition-learning-goals/
26•vrganj•53m ago•12 comments

Eval Awareness vs. Eval Paranoia

https://www.lesswrong.com/posts/mepsi7JNKYejq9wry/eval-awareness-vs-eval-paranoia
23•ezrasu•3d ago•8 comments

Court denies motion to dismiss DRAM price fixing case

https://litnews.ai/articles/garciaguirre-samsung-sk-hynix-micron-dram-conspiracy-suit-survives-di...
448•ybathaee•19h ago•205 comments

A NES emulator written in Odin

https://lucypero.com/lucynes.html
84•frostbyte7•7h ago•30 comments

Why did some Apollo missions carry a grenade launcher?

https://space.stackexchange.com/questions/37775
190•Skyfall106•11h ago•135 comments

20 Years of Pyrolog

https://pypy.org/posts/2026/11/20-years-of-pyrolog.html
55•lumpa•3d ago•4 comments

What thousands of conversations look like inside a language model

https://operator0x.com/field-notes/qwen-conversation-state-space/
92•josip208•2d ago•27 comments

Lutnick Pushed to Weaken Chip Rules That Overlap with His Family Business

https://www.nytimes.com/2026/11/15/us/politics/lutnick-pushed-to-weaken-chip-rules-that-overlap-w...
374•JumpCrisscross•8h ago•170 comments

Jensen Huang discusses comeback as Nvidia CEO with allies

https://www.ft.com/content/45383d86-33c4-4d99-86e5-5e058d3567c1
19•eyalitki•1h ago•8 comments

The Telephone Changed the World

https://lithub.com/how-the-telephone-changed-the-world/
43•NaOH•21h ago•19 comments

Chasing an audio artifact on power loss

https://subalpinecircuits.com/chasing-an-audio-artifact-on-power-loss/
46•ireflect•2d ago•7 comments

Show HN: Carton Clock – A working pendulum clock made from empty drink cartons

https://www.niklasroy.com/carton-clock/
64•r0r0•2d ago•2 comments

How to read codes from (many) IR remote controls with as little code as possible

https://bitbanksoftware.blogspot.com/2026/11/how-to-read-codes-from-many-ir-remote.html
48•speckx•4d ago•8 comments

How did Woz write the Apple 1 BASIC before building the computer?

https://retrocomputing.stackexchange.com/questions/17957
300•Skyfall106•22h ago•155 comments

Handwritten 200-year-old dismissal notice found on roof tile

https://www.bbc.co.uk/news/articles/c6jdmdzv25r9o
68•nephihaha•2d ago•43 comments