logoalt Hacker News

raincoleyesterday at 11:58 AM5 repliesview on HN

Because code reuse is hard. Like, really hard. If it weren't we wouldn't be laughing at left-pad. If it weren't hard we wouldn't have so many front-end JavaScript frameworks. If it weren't Unreal wouldn't still have their own GC and std-like implementation today. Java wouldn't have been reinventing build system every five years.

The whole history of programming tool is exploring how to properly reuse code: are functions or objects the fundamental unit of reuse? is diamond inheritance okay? should a language have an official package management? build system? should C++ std have network support? how about gui support? should editors implement their own parsers or rely on language server? And none of these questions has a clear answer after thousands if not millions of smart people attempted. (well perhaps except the function vs object one)

Electron is the ultimate effort of code reuse: we reuse the tens of thousands of human-years invested to make a markup-based render engine that covers 99% of use case. And everyone complains about it, the author of OP article included.

LLM-coding is not code reuse. It's more like throwing hands up and admitting humans are yet not smart enough to properly reuse code except for some well-defined low level cases like compiling C into different ISA. And I'm all for that.


Replies

thunkytoday at 1:24 AM

> Because code reuse is hard. > humans are yet not smart enough to properly reuse code

All of these difficulties you outline are because program designs cater to the human developer experience over the machine.

If this weren't the case Python wouldn't exist because it's clearly not made with mechanical sympathy in mind. Dynamic languages as a whole would probably not exist.

It's because humans will never agree with eachother or with machines and that's what has led us to the proliferation of complexity and lack of reuse we see everywhere.

Garlefyesterday at 2:08 PM

I think you could also argue that LLMs in coding are actually just a novel approach at code reuse: At the microscopic level, they excel at replicating known patterns in a new context.

(Many small dependencies can be avoided by letting the LLM just re-implememt the desired behavior; ~ with tradeoffs, of course)

The issue is orchestrating this local reuse into a coherent global codebase.

show 1 reply
layer8yesterday at 2:24 PM

The problems with leftpad are a problem with the NPM ecosystem, not with code reuse as such. There are other dependency ecosystems that don't have these problems.

FpUseryesterday at 2:05 PM

>"well perhaps except the function vs object one"

If this is what I think it is, I consider it very lopsided view, failure to recognize what model fits for what case and looking at everything from a hammer point of view

show 1 reply
bandramiyesterday at 2:33 PM

I have terrible news: LLMs don't actually make it easier, though it feels like they do at first