r/programming • • Oct 07 '26

[ Removed by moderator ]

/r/programming/comments/1wzob2x/removed_by_moderator/

[removed] — view removed post

413 Upvotes

313 comments sorted by

View all comments

Show parent comment

36

u/remy_porter Oct 07 '26

I am trying to build an app with Spec-Driven Development

Doomed to failure, for one easy and understandable reason: there is only one document that accurately and without error tells you what the code does.

... the code.

Trying to equate code to the "new assembly" is a type error. Because code has a direct mapping to assembly; even in your higher level languages, we can deterministically (with enough controlled variables) predict what machine instructions get emitted by which input code. And it's still imperfect, and I've still spent many hours looking at assembly trying to understand why it wasn't carrying my intent.

But natural language is vague, contradictory, imprecise. There's no single right way to map natural language to code. Communicating from human to human frequently leads to misunderstandings, and humans are not theory-free inferencers. They have a model of the world and the people they're talking to.

The only way to have "spec-driven development" work is to not use natural language, but to use a carefully selected subset of natural language, with precise grammar and no ambiguity and whoops, you've just invented a programming language again.

13

u/riskbreaker419 Oct 07 '26

To this point, it reminds me of this comic, https://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

(Notice it was written in 2016)

I don't think people have realized yet that current coding languages are spec-driven development, otherwise we'd all be coding in assembly still.

EDIT: fixed URL

7

u/Ok-Reindeer-8755 Oct 07 '26

Dijkstra talked about this btw, also yeah I've seen some people aim for writing formal specifications, which at the end of the day probably require more skill to write even though they are higher level

1

u/about0 Oct 07 '26

I am really trying hard to understand how big brain engineering corpos see this flow, but I can't find any meaningful information, besides SDD, which just shifts burden to another place.

1

u/Ok-Reindeer-8755 Oct 07 '26

Ig mostly there are fine with TDD which in my opinion does fuckall. We were always satisfied with knowing a program is somewhat correct, but if you are not even reading the code, I think that becomes a lot harder.

3

u/about0 Oct 07 '26

Indeed, which makes the whole AI doom narrative a little odd, don't you think?

We are getting back to the question "How to build reliable production software with LLM?". I can't think of anything, but to make the flow as small and stupid as possible - split the task to subtasks, prompt what you want to get in return and review all the changes it makes.

We can't pass the whole mental model we have to LLM, requirements never complete, words have many meanings, and LLMs are stochastic.

3

u/remy_porter Oct 07 '26

I do think it's really odd. But I think the reality is that as a society we have no idea how to write software. So a machine that can produce more-or-less usable software with some simple prompts seems like magic. That the resulting software is garbage is its own set of problems.

What's funny is we track AI spend, and despite being the least AI positive person, I spend the most tokens easily. But that's because I tend to do things like use it as a "smart refactoring tool"- "grab this functionality that's spaghetti coded into the middle of this module (because it was all AI generated in the first place) and make it its own module". Or I do "hey, I want to see how this set of parameters changes behavior across this range, right a test sweep and report these metrics and how they change".

And then it's good at doing trivial tasks, like "add this button to this screen and wire it up to this message sink". It probably takes it longer to actually do than it would take me, but it's less cognitive overhead for tedious shit. Though ideally I'd just have higher level abstractions for talking about that stuff.