14 ms·
AI is forcing us to write good code
- pizlonator 9mo agoWhy would I write code that makes it easier for a clanker to compete with me
- firemelt 9mo agoyeah beekeeping, I think about it alot, I mean the agentic should be isolated on their own environment, its dangerous to give then ur whole pc who nows they silently putting some rootkit or backdoor to ur pc, like appending allowed ssh keys
- sebastianconcpt 9mo agoIn Cursor you have Sandbox mode to deal with that issue?
- tombert 9mo agoSomething I just started doing yesterday, and I'm hoping it catches on, is that I've been writing the spec for what I want in TLA+/PlusCal at a pretty high level, and then I tell Codex implement exactly to the spec. I tell it to not deviate from the spec at all, and be as uncreative as possible. Since it sticks pretty close to the spec and since TLA+ is about modifying state, the code it generates is pretty ugly, but ugly-and-correct code beats beautiful code that's not verified. It's not perfect; something that naively adheres to a spec is rarely optimized, and I've had to go in and replace stuff with Tokio or Mio or optimize a loop because the resulting code is too slow to be useful, and sometimes the code is just too ugly for me to put up with so I need to rewrite it, but the amount of time to do that is generally considerably lower than if I were doing the translation myself entirely. The reason I started doing this: the stuff I've been experimenting with lately has been lock-free data structures, and I guess what I am doing is novel enough that Codex does not really appear to generate what I want; it will still use locks and lock files and when I complain it will do the traditional "You're absolutely right", and then proceed to do everything with locks anyway. In a sense, this is close to the ideal case that I actually wanted: I can focus on the high-level mathey logic while I let my metaphorical AI intern deal with the minutia of actually writing the code. Not that I don't derive any enjoyment out of writing Rust or something, but the code is mostly an implementation detail to me. This way, I'm kind of doing what I'm supposed to be doing, which is "formally specify first, write code second".
- BrittonR 9mo agoThis is how I’m also developing most of my code these days as well. My opinions are pretty similar to the pig book author https://martin.kleppmann.com/2025/12/08/ai-formal-verification.html https://martin.kleppmann.com/2025/12/08/ai-formal-verificati....
- tombert 9mo agoFor the first time I might be able to make a case for TLA+ to be used in a workplace. I've been trying for the last nine years, with managers that will constantly say "they'll look into it".
- baq 9mo agoYou might find success with having the LLM contribute to the spec itself. It suddenly started to work with the most recent frontier models, to the point that economics of writing then shifted due to turn getting 10-100x cheaper to get right.
- jnpnj 9mo agoInteresting, just the other day I tried asking if iterating in haskell or prolog wouldn't help both converging speed and token use. I wish there was a group to study how to do proper engineering with LLMs without losing the modeling / verification aspect.
- bwhiting2356 9mo agoI agree with this. 100% test coverage for front end is harder, I don't know if I'm going to reach for that yet. So far I've been making my linting rules stricter.
- afro88 9mo agoWithout having tried it (caveat), I worry that 100% coverage to an LLM will lock in bad assumptions and incorrect functionality. It makes it harder for it to identify something that is wrong. That said, we're not talking about vibe coding here, but properly reviewed code, right? So the human still goes "no, this is wrong, delete these tests and implement for these criteria"?
- sgk284 9mo agoYep, 100% correct. We're still reviewing and advising on test cases. We also write a PRD beforehand (with the LLM interviewing us!) so the scope and expectations tend to be fairly well-defined.
- realusername 9mo agoThat's already what I'm experiencing even without forcing anything, the LLM creates a lot of "is 1 = 1?" tests
- the_king 9mo agoI think good names and a good file structure are the most important thing to get right here.
- nathan_f77 9mo agoThis is exactly how I've been working with AI this year and I highly recommend it. This kind of workflow was not feasible when I was working alone and typing every line of code. Now it's suprisingly easy to achieve. In my latest project, I've enforced extremely strict linting rules and completely banned any ignore comments. No file over 500 lines, and I'm even using all the default settings to prevent complex functions (which I would have normally turned off a long time ago.) Now I can leave an agent running, come back an hour or two later, and it's written almost perfect, typed, extremely well tested code.
- teaearlgraycold 9mo agoI went from "ugh I don't want to write e2e tests" to "well I'll at least have the LLM write some". 50% coverage is way better than 0%! I'm very strict about the runtime code, but let the LLM take the reins on writing tests (of course still reviewing the code). It's funny how on one side you have people using AI to write worse code than ever, and on the other side people use AI as an extension of their engineering discipline.
- KurSix 9mo agoSounds like a dream, but there is a risk of a local maximum here. Strict linters and small files are great at helping the agent write syntactically correct code, but they don't guarantee architectural correctness. An agent can generate 100 perfect 500-line files that together form an unmaintainable dependency hell. A linter catches bad code, not bad system design. Leaving an agent unsupervised for 2 hours is bold because refactoring architectural mistakes is harder than fixing typos
- zmmmmm 9mo agoVery little there about the code itself being good. A lot about putting good guardrails around it and making it fast and safe to develop. Which is good for sure. But I feel it's misconstruing it to say the actual code is "good". The whole reason the guard rails provide value is the code is, by default, "not good" and how good the result is presumably sitting in a spectrum between "the worst possible that satisfies the guardrails" and "actually good".
- tempodox 9mo agoThis is hallucination. Or maybe a sales pitch. If production bugs and the requirement to retain a workable code base don’t get us to write “good” code, then nothing will. And at the current state of the art, “AI” will tend to make it worse.
- zwnow 9mo agoShhhh the original poster is the CEO of an AI based company. I am sure there is no bias here. /s
- deleted 9mo ago[deleted]
- stingraycharles 9mo agoYeah, test coverage isn't a replacement for good code. Worse yet, it may give you false confidence, especially if it's the AI that's writing the tests (which in practice very often is the case).
- reedlaw 9mo agoThe first sentence is problematic: > For decades, we’ve all known what “good code” looks like. When relatively trivial concerns such as the ideal length of methods haven't achieved consensus, I doubt there can be any broadly accepted standard for software quality. There are plenty of metrics such as test coverage, but anyone with experience could tell you how easy it is to game those and that enforcing arbitrary standards can even cause harm.
- tempodox 9mo agoI agree. Moreover, I submit that “good code” isn’t even a universal constant, but context-sensitive along several dimensions.
- deaux 9mo ago> When relatively trivial concerns such as the ideal length of methods haven't achieved consensus Is the consensus not that there isn't one? Surely that's the only consensus to reach? I don't see how there could possibly be an "ideal length", whatever you pick it'd be much too dogmatic.
- user____name 9mo agoI've been wondering if AI startups are running bots to downvote negative AI sentiment on HN. The hype is sort of ridiculous at times.
- lmeyerov 9mo agoMost of this rings true for us for the same reasons. We have been moving large old projects in this direction, and new ones start there. It's easier to do these via tool checks than trust skills files. I wouldn't say the resulting code is good, which folks are stumbling on, but it is rewarding better code - predictable, boring, tested, pure, and fast to iterate on, which are all indeed part of our SDLC principles. Some of the advice is a bit more extreme, like I haven't found value in 100% code coverage, but 90% is fine. Others miss nuance like we have to work hard to prevent the AI from subverting the type checks, like by default it works around type errors by using getattr/cast/typeignore/Any everywhere. One item I'm hoping is AI coders get better at is using static analysis tools and verification tools. My experiments here have been lukewarm/bad, like adding an Alloy model checker for some parts of GFQL (GPU graph query language) took a lot of prodding and found no bugs, but straight up asking codex to do test amplification on our unit test suite based on our code and past bugs works great. Likewise, it's easy to make it port conformance tests from standards and help with making our docs executable to help prevent drift. A new area we are starting to look at is automatic bug patches based on production logs. This is practical for the areas we setup for vibe coding, which in turn are the areas we care about more and work most heavily on. We never trusted automated dependency update bots, but this kind of thing gets much more trustworthy & reviewable. Another thing we are eyeing is new 'teleport' modes so we can shift PRs to remote async development, which previously we didn't think worth supporting.
- phplovesong 9mo agoLOL No. AI code i see is 90% really bad. The poster then snakes around the first commenter that asks "how much of the code was generated by AI?" Replies vary from silence to "ill checked all the code" or "ai code is better than human code" or even "ai was not used at all", even it is obvious it was 100% AI.
- maeln 9mo agoYou did not read the article did you
- phplovesong 9mo agoNo. The title gave me enough context to not even give it a click. That or its a clickbait, making it even more less clickable.
- KurSix 9mo agoThere's a catch with 100% coverage. If the agent writes both the code and the tests, we risk falling into a tautology trap. The agent can write flawed logic and a test that verifies that flawed logic (which will pass). 100% coverage only makes sense if tests are written before the code or rigorously verified by a human. Otherwise, we're just creating an illusion of reliability by covering hallucinations with tests. An "executable example" is only useful if it's semantically correct, not just syntactically
- notimetorelax 9mo agoYou’re right. What I like doing in those cases is to review very closely the tests and the assertions. Frequently it’s even faster than looking at the SUT itself.
- ruszki 9mo agoI heard this “review very closely” thing many times, and rarely means review very closely. Maybe 5% of developers really do this ever, and I probably overestimate it. When people send here AI generated code, it’s quite obvious that they don’t review code properly. There are videos when people recorded how we should use LLMs, and they clearly don’t do this.
- christophilus 9mo agoYeah. This is me. I try, but I always miss something. The sheer volume and occasional stupidity makes it difficult. Spot checking only gets you so far. Often, the code is excellent except in one or two truly awful spots where it does something crazy.
- eru 9mo agoWell, we let humans write both business logic code and tests often enough, too. Btw, you can get a lot further in your tests, if you move away from examples, and towards properties.
- 9mo ago
- victorbjorklund 9mo agoThis is something I have seen. The code I write on projects I work on alone is a lot better today vs in the past because AI works better on a repo with good code quality. This can be writing smaller modules or even breaking out an API integration into its own library (something I seldom would do in the past).
- cess11 9mo agoI kind of feel that if you weren't doing this and start doing it to please a bunch of chatbots, then you're sending a pretty weird signal to your coworkers or employees. Like you care more about the bots than the people you work with. Other than that, sure, good advice. If at all possible you should have watch -n 2 run_tests or test run on a file watcher on a screen while coding. In my experience LLM:s like to add assertions and tests for impossible states, which is quite irritating, so I'd rather not do the agentic vibe thing anyway.
- glemmaPaul 9mo agoKool-aid salesmen is selling Kool-aid again
- CraigJPerry 9mo ago> Entire categories of illegal states and transitions can be eliminated. I have an over-developed, unhealthy interest in the utility of types for LLM generated code. When an llm is predicting the next token to generate, my current level of understanding tells me that it makes sense that the llm's attention mechanism will be using the surrounding type signatures (in the case of an explicitly typed language) or the compiler error messages (in the cases where a language leans on implicit typing) to better predict that next token. However, that does not seem to be the behaviour i observe. What i see is more akin to tokens in the type signature position in a piece of code often being generated without any seeming relationship to the instructions being written. It's common to generate code that the compiler rejects. That problem is easily hidden and worked around - just wrap your llm invocation in a loop, feed in the compiler errors each time and you now have an "agent" that can stochastic gradient descent its way to a solution. Given this, you could say well what does it matter, even if an LLM doesn't meaningfully "understand" the relationship between types and instructions, there's already a feedback loop and therefore a solution available - so why do we even need to care about the fact an llm may or may not treat types as a tool to accurately model the valid solution space. Well i can't help think this is really the crux of software development. Either you're writing code to solve a defined problem (valuable) or you're doing something else that may mimic that to some degree but is not accurate (bugs). All that said, pragmatically speaking, software with bugs is often still valuable. TL;DR i'm currently thinking humans should always define the type signatures and test cases, these are too important to let an LLM "mid" its way through.
- everfrustrated 9mo agoCompletely agree with your on the types. Will be interesting to see what new post-AI programming languages look like and I suspect they will all be strongly typed.
- throw-12-16 9mo agoJust wait until the LLM Agent starts rewriting tests to adhere to your 100% code coverage mandate.
- PunchyHamster 9mo agoI'm not covering every if err != nil { return fmt.Errorf(...) } no matter what kind of glue vibe coders snorted that day
- nxobject 9mo agoDon't forget logging, logging, and lots of logging - whether printf or structured.
- deaux 9mo agoYour footnotes seem to be in the wrong order - maybe you switched paragraphs around and they got out of sync?
- ojr 9mo agoI spent so much time getting the mocks right with AI tests and the tests could not be one shotted or done by an inexperienced intern. Certainly don't have the budget to through Claude Opus on it, I'll give it some time though maybe things change.
- Twey 9mo agoI'd be interested to hear how they reconcile ‘100% code coverage’ with ‘QA needs to run fast’ on a large codebase. I'd also really love to see a study around how much of the effort it takes, on average, to write (by carefully shepherding an agent or otherwise) bullet-proof tests and other guardrails for the LLM-generated code divided by the effort of writing the code by hand.
- cryptica 9mo agoI agree with the sentiment but I find this definition of 'good code' is a bit superficial for my liking. Especially the part about TypeScript. My experience is that LLMs such as Claude Code work really well with vanilla JavaScript. Once you switch to TypeScript, you're tapping into a different language training set which is much smaller than the JS training set and which adheres to different conventions and principles. The part about good test coverage makes sense though I don't know if 100% coverage is the specific goal to aim for. You can have 100% coverage in terms of lines of code but don't test the relevant parameters which cause issues. My definition of good code is more about architecture; modularity, separation of concerns, minimal interfaces, choosing good abstractions and layering them appropriately, clearly separating trust boundaries with appropriate validation... Once the LLM sees certain things, it lets you tap into a "world class software engineer" training set. A lot of the points mentioned in the article differentiate junior developer from mid-level developer... If you want the LLM to output 10x software engineer quality, the patterns are different and more nuanced... Goes beyond just having good test coverage.
- chrsw 9mo agoI think organization technical leadership wants to deploy AI to ship faster, not so engineering teams can do what they should have been doing all along. "Sure, we can deploy these tools, but first we need to properly document our design" isn't going to fly. The point of buying these tools is so teams ship without really understanding what they're doing, because there's a time cost to that.
- sebastianconcpt 9mo agoI feel more like is forcing to write better engineering not just the code. The disruption comes from the economics of cognitive labor, the synthetic assistants are making feasible things that before were unbearably cognitively costly so manually we invested all that energy into the code parts. I've made this to leverage that: https://github.com/sebastianconcept/ai-squads https://github.com/sebastianconcept/ai-squads
- krupan 9mo agoSo many of us see an LLM spit out a bunch of code in a at a very high rate and we're amazed. It is really impressive, but what we're forgetting is that the amount of code and the speed at which code is written has never been the bottleneck in developing good quality software. AI will revolutionize software development if and when it does a far better job of producing correct code than humans.
- captainkrtek 9mo agoMy biggest problem with usage of an LLM in coding is that it removes engineers from understanding the true implementation of a system. Over the years, I learned that a lot of one's value as an engineer can come from knowing how things actually work. I've been in many meetings with very senior engineers postulating how something works arguing back and forth, when quietly one engineer taps away on their laptop, then spins it around to say "no, this is the code here, this is how it actually works".
- adi_kurian 9mo agoWhat if 'good code' is just 'code optimized for humans who can't hold much in working memory'? The model doesn't need breadcrumbs if it can see everything at once. If context windows 100x, think some of this may be less relevant. Big IF, have no idea tbh, hard to predict.
- melozo 9mo agoI’m not sure how controversial this is - but 100% code coverage is almost always a waste of time, paid both immediately and long term, for certain languages. Go, for example, requires explicit error handling, but the way errors are handled are usually plain and homogenous. Adding unit testing everywhere creates a phenomenal amount of test code that can become 3x the size of the source, and certain changes (like interface changes) can require updates to all tests, especially if mocking is used. Obviously with AI maybe those issues I have go away. But I really don’t like letting the AI modify tests without meticulously manually reviewing those changes, because in my experience the AI cares more about getting the tests passing than it does about ensuring semantic correctness. For as long as tests are manually maintained I will continue keeping them as few as necessary while maintaining what I view as an acceptable amount of coverage.
- hoppp 9mo agoI prefer to write critical code and ask the llm for snippets like if I was googling docs, then I got maximum guard rails, it can't alter the project by itself, all code is reviewed by me and I can refactor as I go . If Iam building guard rails to let the LLM directly code then I am building guard rails and not the project I want, I don't want to babysit an LLM, I just want to get on with my work. I also don't agree with the title, a very prominent new dev community called vibe coders emerged and they are all about low quality code created fast. So LLMs mostly write bad code.
- devhouse 9mo ago[dead]
- bgwalter 9mo agohttps://logic.inc/ https://logic.inc/ "Ship AI features and tools in minutes, not weeks. Give Logic a spec, get a production API—typed, tested, versioned, and ready to deploy."
- travisgriggs 9mo agohttps://en.wikipedia.org/wiki/Drinking_the_Kool-Aid https://en.wikipedia.org/wiki/Drinking_the_Kool-Aid
- bgwalter 9mo agoSomeone is downvoting everything again. It seems to be a cronjob, always around the same time.
- deleted 9mo ago[deleted]
- badgersnake 9mo agoI’m increasingly finding that the type of engineer that blogs is not they type of engineer anyone should listen to.
- cube00 9mo agoEven some of the comments here can't help name dropping their own startups for no actual reason.
- observationist 9mo agoBadgersnake's corollary to Gell-Mann amnesia?
- sgk284 9mo agoCan you say more? I see a lot of teams struggling with getting AI to work for them. A lot of folks expect it to be a little more magical and "free" than it actually is. So this post is just me sharing what works well for us on a very seasoned eng team.
- imron 9mo agoAs someone who struggles to realise productivity gains with AI (see recent comment history) I appreciate the article. 100% coverage for AI generated code is a very different value proposition than 100% coverage for human generated code (for the reasons outlined in the article).
- justatdotin 9mo agoit is MUCH easier for solo devs to get agents to work for them than it is for teams to get agents to work for them.
- andrekandre 9mo agothat's interesting, whats the reason for that?
- 9mo ago
- mrits 9mo agoAuthor should ask AI to write a small app with 100% code coverage that breaks in every path except what is covered in the tests.
- sgk284 9mo agoI never claim that 100% coverage has anything to do with code breaking. The only claim made is that anything less than 100% does guarantee that some piece of code is not automatically exercised, which we don't allow. It's a footnote on the post, but I expand on this with: 100% coverage is actually the minimum bar we set. We encourage writing tests for as many scenarios as is possible, even if it means the same lines getting exercised multiple times. It gets us closer to 100% path coverage as well, though we don’t enforce (or measure) that
- reactordev 9mo agoI feel this comment is lost on those who have never achieved it and gave up along the journey.
- xcskier56 9mo agoSimpleCov in ruby has 2 metrics, line coverage and branch coverage. If you really want to be strict, get to 100% branch coverage. This really helps you flesh out all the various scenarios
- a3w 9mo agoBrakes in cars here in Germany are integrated with less than 50 % coverage in the final model testing that goes to production. Seems like even if people could potentially die, industry standards are not really 100% realistic. (Also, redundancy in production is more of a solution than having some failures and recalls, which are solved with money.)
- nicoburns 9mo ago> I never claim that 100% coverage has anything to do with code breaking. But what I care about is code breaking (or rather, it not breaking). I'd rather put effort into ensuring my test suite does provide a useful benefit in that regard, rather than measure an arbitrary target which is not a good measure of that.
- jennyholzer3 9mo agoI don't know about all this AI stuff. How are LLMs going to stay on top of new design concepts, new languages, really anything new? Can LLMs be trained to operate "fluently" with regards to a genuinely new concept? I think LLMs are good for writing certain types of "bad code", i.e. if you're learning a new language or trying to quickly create a prototype. However to me it seems like a security risk to try to write "good code" with an LLM.
- dboreham 9mo agoI've used LLMs to find bugs in and write code for a language almost nobody uses, that has terrible documentation. My assumption is that it did so in the same manner a human would: "ok this looks kind of like Algol or C" and "after reading a bunch of this code I think I get what's going on".
- sgk284 9mo agoI suspect it will still fall on humans (with machine assistance?) to move the field forward and innovate, but in terms of training an LLM on genuinely new concepts, they tend to be pretty nimble on that front (in my experience). Especially with the massive context windows modern LLMs have. The core idea that the GPT-3 paper introduced was (summarizing): A sufficiently large language model can perform new tasks it has never seen using only a few examples provided at inference time, without any gradient updates or fine-tuning.
- manmal 9mo agoThey are retrained every 12-24 months and constantly getting new/updated reinforcement learning layers. New concepts are not the problem. The problem is outdated information in the training data, like only crappy old Postgres syntax in most of the Stackoverflow body.
- Aerolfos 9mo ago> They are retrained every 12-24 months and constantly getting new/updated reinforcement learning layers This is true now, but it can't stay true, given the enormous costs of training. Inference is expensive enough as is, the training runs are 100% venture capital "startup" funding and pretty much everyone expects them to go away sooner or later Can't plan a business around something that volatile
- mkozlows 9mo agoI like this. "Best practices" are always contingent on the particular constellation of technology out there; with tools that make it super-easy to write code, I can absolutely see 100% coverage paying off in a way that doesn't for human-written code -- it maximizes what LLMs are good at (cranking out code) while giving them easy targets to aim for with little judgement. (A thing I think is under-explored is how much LLMs change where the value of tests are. Back in the artisan hand-crafted code days, unit tests were mostly useful as scaffolding: Almost all the value I got from them was during the writing of the code. If I'd deleted the unit tests before merging, I'd've gotten 90% of the value out of them. Whereas now, the AI doesn't necessarily need unit tests as scaffolding as much as I do, _but_ having them put in there makes future agentic interactions safer, because they act as reified context.)
- johnnyfived 9mo agoI've said this before here, but "best practices" in code indeed is very typical even with different implementations and architectures. You can ask a LLM to write you the best possible code for a scenario and likely your implementation wouldn't differ much. Writing, art, creative output, that's nothing at all like code, which puts the software industry in a more particular spot than anything else in automation.
- Waterluvian 9mo agoIt might depend on the lifecycle of your code. The tests I have for systems that keep evolving while being production critical over a decade are invaluable. I cannot imagine touching a thing without the tests. Many of which reference a ticket they prove remains fixed: a sometimes painfully learned lesson.
- zmgsabst 9mo agoAlso the lifecycle of your system, eg, I’ve maintained projects that we no longer actively coded, but we used the tests to ensure that OS security updates, etc didn’t break things.
- jaredcwhite 9mo agoI'm sad programmers lacking a lot of experience will read this and think it's a solid run-down of good ideas.
- nathan_f77 9mo agoI have almost 30 years of experience as a programmer and all of this rings true to me. It precisely matches how I've been working with AI this year and it's extremely effective.
- manmal 9mo agoWhat’s bad about them? We make things baby-safe and easy to grasp and discover for LLMs. Understandability and modularity will improve.
- baobun 9mo agoCould you be more specific in your feedback please.
- jaredcwhite 9mo ago100% test coverage, for most projects of modest size, is extremely bad advice.
- bdangubic 9mo agolaziness? unprofessionalism? both? or something else?
- rvz 9mo agoall of the above.
- spc476 9mo agoYou forgot difficult. How do you test a system call failure? How do you test a system call failure when the first N calls need to pass? Be careful how you answer, some answers technically fall into the "undefined behavior" category (if you are using C or C++).
- altmanaltman 9mo agoWouldn't a better title be "How we're forcing AI to write good code (because it's normally not that good in general, which is crazy, given how many resources it's sucking, that we need to add an extra layer on top of it and use it to get anything decent)"
- deleted 9mo ago[deleted]
- visarga 9mo ago> which is crazy, given how many resources it's sucking Gentleman, the dog writes poetry and music, but it is boring, mediocre quality. Overhyped dog.
- two_handfuls 9mo agoThat is a great description of current AI, actually. Love it. Some people are amazed the dog can write poetry. Some people complain that the poetry isn't good enough.
- pessimizer 9mo agoOf what use is a dog that writes bad poetry? It's gone from being a dog to being an annoying dog. It's like having the power to turn water into gross, undrinkable wine.
- add-sub-mul-div 9mo agoThen it wouldn't be effective advertising/vanity blogging from some self-promoting startup.
- Aerolfos 9mo agoDon't forget "we're obligated to try and sell it so here's an ai generated article to fill up our quota because nobody here wanted to actually sit down and write it"
- 9mo ago
- brynary 9mo agoStrong agreement with everything in this post. At Qlty, we are going so far as to rewrite hundreds of thousands of lines of code to ensure full test coverage, end-to-end type checking (including database-generated types). I’ll add a few more: 1. Zero thrown errors. These effectively disable the type checker and act as goto statements. We use neverthrow for Rust-like Result types in TypeScript. 2. Fast auto-formatting and linting. An AI code review is not a substitute for a deterministic result in sub-100ms to guarantee consistency. The auto-formatter is set up as a post-tool use Claude hook. 3. Side-effect free imports and construction. You should be able to load all the code files and construct an instance of every class in your app without a network connection spawning. This is harder than it sounds and without it you run into all sorts of trouble with the rest. 3. Zero mocks and shared global state. By mocks, I mean mocking frameworks which override functions on existing types or global. These effectively are injecting lies into the type checker. Should put to tsgo which has dramatically lowered our type checking latency. As the tok/sec of models keeps going up, all the time is going to get bottlenecked on tool calls (read: type checking and tests). With this approach we now have near 100% coverage with a test suite that runs in under 1,000ms.
- ManuelKiessling 9mo agoI‘m on the same page as you, I‘m investing into DX and test coverage and quality tooling like crazy. But the weird thing is: those things have always been important to me. And it has always been a good idea to invest in those, for my team and me. Why am doing this 200% now?
- 0x696C6961 9mo agoFor me it's because coworkers are pumping out horrible slop faster than ever before.
- monatron 9mo agoIf you're like me you're doing it to establish a greater level of trust in generated code. It feels easier to draw out the hard guard-rails and have something fill out the middle -- giving both you, and the models, a reference point or contract as to what's "correct"
- pgroves 9mo agoThis is sort of why I think software development might be the only real application of LLMs outside of entertainment. We can build ourselves tight little feedback loops that other domains can't. I somewhat frequently agree on a plan with an LLM and a few minutes or hours later find out it doesn't work and then the LLM is like "that's why we shouldn't have done it like that!". Imagine building a house from scratch and finding out that it was using some american websites to spec out your electric system and not noticing the problem until you're installing your candadian dishwasher.
- mrtksn 9mo ago> Imagine building a house from scratch Thats why those Engineering fields have strict rules, often require formal education and someone can even end up in prison if screws up badly enough. Software is so much easier and safer, till very recently anonymous engineering was the norm and people are very annoyed with Apple pushing for signing off the resulting product. Highly paid software engineers across the board must have been an anomaly that is ending now. Maybe in the future only those who code actually novel solutions or high risk software will be paid very well - just like engineers in the other fields.
- zarzavat 9mo ago> people are very annoyed with Apple pushing for signing off the resulting product. Apple is very much welcome to push for signing off of software that appears on their own store. That is nothing new. What people are annoyed about is Apple insisting that you can only use their store, a restriction that has nothing to do with safety or quality and everything to do with the stupendous amounts of money they make from it.
- mrtksn 9mo agoIt's literally the case of Apple requiring signing the binary to run on the platforms they provide, Apple doesn't have say on other platforms. It is a very similar situation with local governments. Also, people complain all the time about rules and regulations for making stuff. Especially in EU, you can't just create products however you like and let people decide if it is safe to use, you are required to make your products to meet certain criteria and avoid use certain chemicals and methods, you are required to certify certain things and you can't be anonymous. If you are making and selling cupcakes for example and if something goes wrong you will be held responsible. Not only when things go wrong, often local governments will do inspections before letting you start making the cupcakes and every now and then they can check you out. Software appears to be headed to that direction. Of course du to the nature of software probably wouldn't be exactly like that but IMHO it is very likely that at least having someone responsible for the things a software does will become the norm. Maybe in the future if your software leaks sensitive information for example, you may end up being investigated and fined if not following best practices that can be determined by some institute etc.
- jillesvangurp 9mo agoThis goes in the right direction. It could go further though. Types are indeed nice. So, why use a language why using those is optional? There are many reasons but many of those have to do with people and their needs/wants rather than tool requirements. AI agents benefit from good tool feedback, so maybe switch to languages and frameworks that provide plenty of that and quickly. Switching used to be expensive. Because you had to do a lot of the work manually. That's no longer true. We can make LLMs do all of the tedious stuff. Including using more rigidly typed languages, making sure things are covered with tests, using code analysis tools to spot anti patterns and addressing all the warnings, etc. That was always a good idea but we now have even less excuses to skip all that.
- deleted 9mo ago[deleted]
- AuthAuth 9mo ago>Statement about how AI is actually really good and we should rely on it more. Doesnt cover any downsides. >CEO of an AI company Many such cases
- heliumtera 9mo agothe fantastic machine will be 10^23x more productive than all of us combined, they will give it all away for 20 dollars a month and this people will be left without anything to sell. then, they will leave. so technically AI will force the world to heal, actually he is correct.
- block_dagger 9mo agoI stopped reading at “static typing.” That is not what “good code” always looks like.
- kurtis_reed 9mo ago[flagged]
- danieka 9mo agoI thought that the article would be about if we want AI to be effective, we should write good code. What I notice is that Claude stumbles more on code that is illogical, unclear or has bad variable names. For example if a variable is name "iteration_count" but actually contains a sum that will "fool" AI. So keeping the code tidy gives the AI clearer hints on what's going on which gives better results. But I guess that's equally true for humans.
- asielen 9mo agoRelated it seems AI has been effective at forcing my team to care about documentation including good comments. Before when it was just humans reading these things, it felt like there was less motivation to keep things up to date. Now the idea that AI may be using that documentation as part of a knowledge base or in evaluating processes, seems to motivate people to actually spend time updating the internal docs (with some AI help of course). It is kind of backwards because it would have been great to do it before. But it was never prioritized. Now good internal documentation is seen as essential because it feeds the models.
- sleepy_keita 9mo agoHumans can work with these cases better though because they have access to better memory. Next time you see "iteration_count", you'll know that it actually has a sum, while a new AI session will have to re-discover it from scratch. I think this will only get better as time goes on, though.
- drak0n1c 9mo agoUnfortunately, so far coding models seem to perform worse and break in other ways as context grows, so it's still best practice to start a new conversation even when iterating. Luckily, high-end reasoning models are now catching when var names don't match what they actually do (as long as the declaration is provided in context).
- rsyring 9mo agoOr you immediately rename it to avoid the need to remember? :)
- sandblast2 9mo agoThe expertise in software engineering typical in these promptfondling companies shine through this blog post. Surely they know 100% code coverage is not a magical bullet because the code flow and the behavior can differ depending on the input. Just because you found a few examples which happen to hit every line of code you didn't hit every possible combination. You are living in a fool's paradise which is not a surprise because only fools believe in LLMs. You are looking for a formal proof of the codebase which of course no one does because the costs would be astronomical (and LLMs are useless for it which is not at all unique because they are useless for everything software related but they are particularly unusable for this).
- visarga 9mo agoSo, what is the solution? Senior engineer looks over PR and signs LGTM? That is just "vibe testing". The worst kind of testing. I think the author is right, setting up tests to form a reactive environment for coding agents will lead us to a new golden age. If you later find some issue with your test case coverage, you expand it. But it is good to do it from the start as throroughtly as possible.
- sandblast2 9mo ago> So, what is the solution? 1. Clearly explain the massive harm LLMs cause society and the environment to everyone. (Mass media should do this instead of parroting every nonsense the promptfondlers feed them.) 2. Ban them all. Don't tell me it's impossible just because it's widespread. Asbesthos was everywhere.
- SR2Z 9mo agoIt's a bold claim that LLMs are useless for formal verification when people have been hooking them up to proof assistants for a while. I think that it's probably not a terrible idea; the LLM might make some mistakes in the spec but 99% of the time there are a lot of irrelevant details that it will do a serviceable job with.
- cube00 9mo agoI can't reconcile how the CEO of an AI startup is; on one hand pushing "100% Percent [sic] Code Coverage" while also selling the idea of "Less than 60 seconds to production" on their product (which is linked in the first screen-full of the blog post so it's not like these are personal thoughts). If 100% code coverage is a good thing, you can't tell me anyone (including parallel AI bots) is going to do this correctly and completely for a given use case in 60 seconds. I don't mind it mind it being fast, but to sell it as 60 second fast while trying to give the appearance you support high quality and correct code isn't possible.
- sublinear 9mo agoWhat? We're already so far down the list of things to try with AI that we're saying hallucinated tests are better than no tests at all? Seems actively harmful, and the AI hype died out faster than I thought it would. > Agents will happily be the Roomba that rolls over dog poop and drags it all over your house There it is, folks!
- andrewchambers 9mo agoWhere did it say the tests need to be hallucinated ? If you can make good tests the AI shouldn't be able to cheat them. It will either churn forever or pass them.