Live data from Hacker News

I'm going back to writing code by hand

blog.k10s.dev

621–630 of 656 posts

Re: I'm going back to writing code by hand

#621
post #324

Earlier quoted context omitted.

I don't get your comment. The GC is part of the runtime, to it user code is data. But the JIT compiler and other internal details of the runtime are its code, and there are very real cross-cutting concerns, like the JIT compilers output should take into account what memory representation the GC expects, where are barriers, when one is run etc. So I'm talking about a project such as the JVM. > have millions of lines o…

I don't work in that area, but I strongly suspect that they do their best to confine the interactions to small places if that is possible. Maybe not though.

They absolutely do their best, but this is not possible in the general case. And as I said, it's also true to a smaller degree for banking and other software as well, but is not even software-specific. A plane also can't be engineered layer-by-layer, component-by-component - there has to be an oversight of the whole, otherwise it won't fly.

Re: I'm going back to writing code by hand

#622
post #445
post #192

Yep. The only people I've heard saying that generated code is fine are those who don't read it. The problem is that the mitigations offered in the article also don't work for long. When designing a system or a component we have ideas that form invariants. Sometimes the invariant is big, like a certain grand architecture, and sometimes it’s small, like the selection of a data structure. You can tell the agent what the…

> "Yep. The only people I've heard saying that generated code is fine are those who don't read it." I review every line of code I generate with AI. I mainly use an MR-based approach: 1) Provide a tightly scoped technical spec to Codex as a task, and ask for 3x solutions. Usually at least one of them is on the right track, and it is better to ditch a solution that went in the wrong direction than to try to fix it. 2)…

> Provide a tightly scoped technical spec to Codex as a task, and ask for 3x solutions.

I'm using a personal license and Codex. What does this cost to generate 3x solutions as a starting point?

Even in simple coding I have been doing, I notice Codex will burn through my Open AI subscription rather fast.

Re: I'm going back to writing code by hand

#623
post #604

Earlier quoted context omitted.

Code reviews should be done by someone other than the author though, so the only thing that changes with ai generated code in that respect is the amount of it

That doesn’t conflict with my statement. Before: One person writes the code (and likely understands it thoroughly), another person reviews the code to spot obvious mistakes or shortcomings. Now: AI writes the code, a person reviews it to spot obvious mistakes or shortcomings. In the before case, you have a person who has a deeper understanding of the code and in the AI case, you don’t, instead you have even more code…

>When a competent programmer is writing the code, the human written code tends to be higher quality too

This is a great idea, but on average is deeply untrue. Far and away most programmers today write significantly worse code than LLMs. Also LLMs are fantastic at generating high level summaries and comments in code

Re: I'm going back to writing code by hand

#624

Earlier quoted context omitted.

Can you not review it?

I think this misses the scale of the problem. Review never fixed tech debt, nor did it fix relevant/bloated test suites. It didn't solve complexity, or eliminate footguns. Very few people (I would argue almost noone) had developed theories for what all of these even were, or how to spot them in code. Reviewers aren't perfect, far from it. And we just gave them ~20x more code to review. Incentives mean that taking 20x…

Certainly not back to hand crafted code unless you want to be left in the dust

Re: I'm going back to writing code by hand

#625

Earlier quoted context omitted.

There are also just problems where the code is the hard part…

What problems are they? I can't really think of any problems where writing the code was the hard part. There's plenty of times where I don't know what code to write because I've never used a library before. But it's just a page of documentation away. It's not hard, it's just slow and tedious.

Writing machine learning kernels. Writing low level geometry libraries. Writing compilers...

Re: I'm going back to writing code by hand

#626
post #192

Yep. The only people I've heard saying that generated code is fine are those who don't read it. The problem is that the mitigations offered in the article also don't work for long. When designing a system or a component we have ideas that form invariants. Sometimes the invariant is big, like a certain grand architecture, and sometimes it’s small, like the selection of a data structure. You can tell the agent what the…

yes it all comes back to iteration, the original "vibe coding". for me, programming has always been about making it up as i go along. like an artist starts with one stroke, i started when i was 10 years old typing '10 print "hello, world" 20 goto 10' and i've never really stopped programming that way 47 years later. For me programming is the same as refactoring, they both happen in a continuous Zone throughout the day. The idea of spending this big period at the beginning Defining the Architecture then letting AI fill in the blanks makes no sense because I only know what the architecture is, what the product is, as part of a process of typing all day for days and weeks and months, that never ends.

Re: I'm going back to writing code by hand

#627
post #264

Earlier quoted context omitted.

That doesn't quite work, and precisely for the reason I mentioned: You can definitely tell the AI to follow some strategy, but at some point the strategy will need to change, and the AI won't tell you that (even if you tell it to). Unless you read the code every time you won't know if the AI is following the strategy and producing good results or following it and producing bad results because the strategy has to chan…

I also find that every additional "constraint" you add in your context window, the dumber the agent gets, and it goes double if your constraint is unusual. To illustrate: "Do x" - for baseline, assume this generally does X fine. "Do X, don't use javascript". - even if X already didn't use javascript, this will often perform worse. It will perform even _more_ worse if X is difficult or unusual to do without javascript…

I feel like there's a limit on constraints that doesn't necessarily follow the context limits. I've assumed this is "attention heads" which I understand are an independent limitation, but I'm not smart enough to understand all the layers involved in these models so I could be wrong there.

I do observe the same thing. There are a limited number of constraints you can add and once you exceed that, you'll play whack-a-mole if you insist on all of them.

This is why I tend toward a more wu-wei attitude to constraints.

For example:

- Do I really need this constraint?

- How does the agent tend to behave in this scenario it if unconstrained? Is this behavior/result an acceptable pattern for this solution?

- Is the constraint implicitly followed often enough that I can trade spending tokens recovering from a deterministic test that enforces the constraint rather than preemptively state it in the prompt?

If I get into the situation where I need more constraints than can fit in context/attention without the need to regularly play whack-a-mole, then I break the module down into sub-modules with fewer, more specific constraints.

Re: I'm going back to writing code by hand

#628

Earlier quoted context omitted.

If you know how to write good code you can force AI to write good code with various techniques. It's 100% doable. You just need to figure out the problems AI has and find solutions to make it easier for it. Ex: extremely small contexts Modularize to modules with clear boundaries and only allow the AI to work within those boundaries. Make modules pure from IO so they are easily testable. Hide modules behind interfaces…

So, basically you need to micro-manage it. Where are your 10x gains now? And is it fun to work like that?

Some of us have thousands of hours in Factorio, so yes.

Re: I'm going back to writing code by hand

#629

Earlier quoted context omitted.

You’re going to be the least productive developer in any work setting from this point on. There are people checking in 50k lines of solid TDD verified, non bloat, instrument performance checked feature code per day. Your 200 lines isn’t going to cut it for very long.

50k lines per day, or at least 1 million lines a month, per team member. How many months can you keep that up, and keep calling it "non bloat"?

Well you stop when you have what you want. It doesn’t have to go the whole month. Over the last couple of months I’ve had to ride product and my business analysts hard because they can’t seem to come up with new features fast enough.
Post reply on HN