6 ms·
My current strategy is to not read any of the code written by my agents
https://xcancel.com/unclebobmartin/status/2080257779395154409?s=20
- deleted 4mo ago[deleted]
- 0xedwen 4mo agothe expensive bugs are usually gaps in the spec itself
- murzynalbinos 4mo ago[flagged]
- mirmor23 4mo agomaybe the definition of 'clean code' in the agentic era should be changed to 'the code that complies to the specs, the design constraints and the exhaustive scenario test suite'; this is definitely a better outcome since all the human effort now shifts to spec, design, test scenarios tailored to the domain - as it should be. having seen my share of human slop through decades (mine included), finally it's a relief to not have to deal with devs that don't have high standards, and the endless arguments/politics that ensue. with llm it's just a text file away from compliance.
- daaaaaaan 4mo agoThis is the guy that thinks optionals are too complicated? https://blog.cleancoder.com/uncle-bob/2017/01/11/TheDarkPath.html https://blog.cleancoder.com/uncle-bob/2017/01/11/TheDarkPath...
- reliabilityguy 4mo agoInteresting read. To his defense: the argument is not that Optionals are too complicated, but that it’s a wrong path for language design — instead programmers have to test their code properly. I like optionals, but I see his point too.
- deleted 4mo ago[deleted]
- ndriscoll 4mo agoWhich is a stupid argument that completely misses the point. If you let the compiler prove that nulls (or other invalid states) can't happen (because null isn't a value of that type), then you don't need to test these impossible cases. So it's easier to ensure your tests are solid because there's not a ton of noise checking what happens inside of invalid program paths. This does not require a new language feature every time there is a bug, as he asserts. It requires language features to let you be descriptive in your type definitions so that invalid program states don't exist by definition. You literally cannot write one down. It's the same idea as saying you can't assign a Monkey to an int64. Scala's ZIO also shows that in fact you can type-infer whether a given path will produce errors or nulls, so you don't need to have perfect knowledge up front or go back and change tons of code if that changes. Errors can automatically propagate, and you need to handle them once, somewhere. Checked exceptions were a fantastic idea; you just need to let the compiler infer them everywhere.
- Ferret7446 4mo agoYour compiler can't prove null doesn't exist if you have unsafe, and you end up being better off having tested in the first place. And how do you know your compiler is even functioning correctly? Testing is the bottom line.
- ndriscoll 4mo agoThat's just a nonsense answer though. Like if you have an Account class and a Book class, do you test what happens if you do an invalid, forced typecast to pass a Book to a function that expects an Account? Of course not. You'd have to check that every function "correctly" handles every possible invalid input. Otherwise where do you draw the line? Or you just rely on the type checker to say you're not allowed to pass a Book to a variable of type Account, and you never use casting (incidentally, I don't remember where, but I remember Clean Code having some example of "good" code that relies on casts, which shows the mindset). Then you literally can't even write a test case for this, because it's impossible to write the illogic at all. If the compiler produces wrong code, all bets are off. Your tests can also miscompile. Your unsafe code could modify another thread's stack memory between instructions and act as an evil gremlin so that literally no line is trustworthy, so even your null check is pointless. Or you could... not do that, and treat your programs as logical reasoning. Charles Babbage even addressed this: > On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.
- jvanderbot 4mo agoThe author of clean code (who makes his living consulting on how to write software) has pivoted to AI in a spectacular tweet about how to set up automated software development just in time to make his living consulting about how to set up automated software development.
- rob74 4mo ago"How does Uncle Bob code today? Find out in Clean Vibe, the long-awaited sequel to the legendary Clean Code - coming soon from Prentice Hall!"
- a34729t 4mo agoWell, he knows where is toast is buttered
- paxys 4mo ago> I’m significantly older than you. I started coding in the late 60s. Any opinion that starts with such a blatant appeal to authority can safely be ignored.
- lovich 4mo agoIt was a pertinent response to the end of the tweet he was replying to. > Started programming in 1983. Old? I took that sentence as asking if he was old because he couldn’t trust AI and uncle bob brought up that he was much older and trusted the AI output because he trusted his constraints and test harnesses
- munk-a 4mo agoAppeals to authority aren't necessarily bad. I would hold an opinion on the internals of postgres from someone who worked heavily on postgres internals for forty years quite highly. Robert Martin started coding in the late 60s and then became an author and a software design consultant - his statement defines the start date of his relevant experience but doesn't speak to the end date of that experience or the density of his experience. He has a wealth of experience but not in a field that's relevant to his comment. I think an appeal to authority is a good basis for extending a bit of extra trust to statements - but you should always verify things yourself.
- Cider9986 4mo agoDon't fall for the the fallacy fallacy.
- receptopalak 4mo ago[flagged]
- anvuong 4mo agoThis is the dude who ushered in the age of nonsensical boilerplate-ridden OOP code where you need to go down a bajillion of abstraction layers to see the actually implementation. Makes sense that he doesn't care about the bajillion lines of code AI produces as long as it looks good (on the surface).
- deleted 4mo ago[deleted]
- ryandvm 4mo agoYeah, if I were him, I too would be thrilled with not having to review another AbstractSingletonProxyFactoryBean.
- remywang 4mo agoDoes he read his tests and constraints? You’d need lots of tests to have that kind of confidence (SQLite has 500+ lines of tests per line of code), at which point it’s not a lot of additional work to just read the code.
- jubilanti 4mo agoBut does he read all those tests to know if they're right? Or does he just ask the LLM if the test it created were good?
- nitwit005 4mo agoMy current code base has more tests than runtime code. This sounds far more thorough than that. If you limit the possible productivity improvement to a small portion of total effort, it's inherently also going to be a small improvement. Which, is fine, but not what most people are hoping for with these tools.
- jordemort 4mo agoWhen my nephew went into computer science, I had to warn him about the bracelet cult people
- hn_user82179 4mo agofor anyone else who was confused: https://clean-code-developer.de/die-initiative/armbaender/ https://clean-code-developer.de/die-initiative/armbaender/
- grim_io 4mo agoWhat the.. How shallow does one need be to feel compelled to identify with this?
- andai 4mo agoI keep posting this but it keeps being relevant. I had an agent implement a feature completely backwards. It wrote a whole bunch of tests proving the correctness of the implementation. All the tests passed. The really interesting thing to me is that formal verification wouldn't have helped there either -- it would have just written a mathematical proof of the correctness of the backwards feature.
- simonw 4mo agoWhat do you mean by "completely backwards"?
- deleted 4mo ago[deleted]
- decimalenough 4mo agoIn test-driven development, you're supposed to write out the tests first to specify the desired behavior, then write the code to confirm to that.
- stavros 4mo agoI think he means it was very wrong.
- andai 4mo agoI'm working on a multiplayer game, and realized I could scale a server further by letting clients handle collisions, and then just verifying those (instead of the server checking all collisions for all games taking place on the server). The point was that if your bullet hits someone, you would report it to the server, and then the server would check if you got the hit or not. (So you couldn't just send fake hit reports.) So the game would still be fair and CPU usage would be greatly reduced. The way the agent implemented it was the other way around. It had players send reports when they had been hit. So they could simply not send them and make themselves invincible. Also the game still checked collisions anyway making the whole feature pointless (on top of broken). (Actually it made the game slower than it was originally!) Hope that clears things up. -- An AI agent actually pointed out the absurdity of the new code to me. So I'm assuming it wasn't that one which wrote it. Probably one of the smaller ones I was testing. But unfortunately I didn't get them to sign their names so I'll never know!
- wodenokoto 4mo agoSo the next edition of clean code will be called “clean test code”?
- rpunkfu 4mo agoIronically from my experience seeing AI code a lot, it probably follows his clean code verbosity beautifully
- bluefirebrand 4mo agoWell, Uncle Bob has always been a hack so this isn't too surprising
- gitgud 4mo agoSo no human in the loop then? Sounds like a recipe for tech debt…
- functionmouse 4mo agoI currently need 4gb of RAM MINIMUM to send an email. AI didn't get us here.
- gitonup 4mo agoNo, but it does learn from where we are. If where we are is debt, debt is where we'll remain.
- bluefirebrand 4mo agoSure, but AI is trained on the code that got us here isn't it? Do you think that we're going to use less RAM with AI produced code?
- luckylion 4mo ago"Do not use react. Do not use tailwind. We will not deploy on vercel." and suddenly things work again, it's magic!
- bluefirebrand 4mo agoReact is like 150kb :/
- dan_gee 4mo agoFrom my perspective, the primary end-user selling point of LLM assistants is not having to read or write anymore. I think a lot of the "AI Addicts" are masking illiteracy, which is why they cling so passionately to the technology.
- Kon5ole 4mo ago>My current strategy is to not read any of the code written by my agents. That’s the only way I can take advantage of their productivity. When you start getting good results from agents you soon realize you are the bottleneck. Automating the verification of the code is the way to go, otherwise it's just not worth it. It takes longer to read and understand code than to write code, so why bother with agents if you are going to manually review it all anyway? One thing I miss after ditching Copilot (it got too expensive) was how I could trivially ask for features to be written by one model and verified by another. Have Opus write it and GPT or Gemini verify it. I figured they were entirely separate models and therefore unlikely to hallucinate in the same way, so it gave me a quick sense of confidence. Currently I use claude code (different models but all variants of the same) so I have them do planning, review of the plan, implementation, review of the implementation, and unit tests. It's fine, but copilot felt easier.
- jaggederest 4mo agoAt the moment I do it manually, but I've experimented with having claude code explicitly call out to codex headlessly for adversarial review, and it works great, I just prefer being able to interact with codex during the review. If you want even greater fun, launch claude and codex in the same working tree and make them fight it out in real time.
- 2001zhaozhao 4mo agoRight now there is about a 95% chance that when I manually review an agent's code I find nothing that needs changing. I find it plausible that an extra agentic review pass and more testing can bring this number up to the point that one never needs to review code again. AI writes pretty good code nowadays. (You still need to be diligent and decide the architecture during the planning, and read the gotchas and "things to note" that the agent will spit out at the end of implementation if it had to diverge from the plan.)
- deleted 4mo ago[deleted]
- mbonnet 4mo agoRobert Martin, the author of Clean Code, is a caustic dick defending a book full of spurious commandments. I don't put any stock in his takes.
- lilerjee 4mo agoFocusing on the surrounding other than the code itself is not good strategy or behavior. Giving up reviewing code is not strategy, but because: Review AI code line by line is like watch movies frame by frame, and is impossible, very difficult, terribly boring, or abandoned sooner or later.
- rich_sasha 4mo agoI read the post slightly differently. LLM code past a few pages is really unreadable. A workflow of LLM writes code, human reads/checks/corrects is IME very unproductive and frustrating, and you're usually better off writing by hand (YMMV). If you want to reap some productivity improvements, it can't rely on you reading, grokkong and accepting the LLM code line by line. You just kind of need to suck it in. So the best you can do is to indeed, constrain it heavily, maybe write the interface, then have the LLM write tests, then have it write the code. I'm not saying I like the approach, but I agree manually verifying LLM code is very frustrating and unproductive.
- grim_io 4mo agoAs a general advice, if you do the opposite of clean code, you'll probably be happier and have a better product.
- renezander030 4mo ago[flagged]
- mengram-ai 4mo ago[flagged]
- gwbas1c 4mo agoWe're asking the wrong questions. What we should be asking is: "What kind of software do you have agents writing without human supervision?"
- sampa123 4mo agoI need to know how to do this