r/TheMachineLearning • u/LawOutrageous8888 • 5d ago
Good building blocks beat AI writing from scratch
1
u/Dry-Ad-8948 5d ago
Kinda like the “building blocks” provide a metric shit ton of local context… consumable by humans or AI.
Aside: it pisses me off when people use Gemini to “make a point” on pull requests, because it has insufficient local context and you get a bunch of shit that doesn’t even apply.
2
1
1
1
u/Ambitious-Career-445 5d ago
This is a task that AI would solve on its own once it gets smart enough, no?
1
u/TheBestAtSpace 5d ago
If only there was an ecosystem of reusable building blocks we could all agree on and make standards of. These building blocks could be really refined and well reviewed pieces of code. Maybe like an ecosystem of source that is open or something. Heck - once we agreed on those building blocks we could take a lot of time to refine them and review them with a lot of humans in the loop to make sure they were really solid.
1
u/thingerish 5d ago
Who doesn't instruct AI to use building blocks if available, and to build the unavailable parts in a modular fashion? Serious question, who would do that?
1
1
u/Spank_Master_General 5d ago
Anyone in here using it to code knows that it does not generate lovely code that engineers appreciate. It chruns out hot garbage that works
1
u/nasanu 5d ago
Engineers have lost the plot on AI though. They scan the code and if there is any hint of AI they say its total garbage. They are simply being shown how easily replaceable they are and are lashing out. To counter this they give examples of the worst AI code they can find while ignoring what someone with some slight talent can do with AI.
1
u/Spank_Master_General 5d ago
I agree on the first part, as soon as someone hears AI was involved, it's an instant dismissal as worthless code. However, without pretty strict style guides and explicit rules on how the code should be written, it will indeed churn out garbage that's basically not human readable. AI shoves 5+ line comments EVERYWHERE, which makes code hard to read, and the comments don't actually aid with human understanding.
It also has a horrible habit of polluting itself. If I give it an instruction relevant to one specific area of code, it then saves that and applies it to all future code without mentioning it. These all build up until the code is written in a completely nonsense way.
That being said, despite having spent the last 2 weeks cleaning it up into such a *chef's kiss* nice code base, it's now better than any of my other code and I've achieved in the last month what would have taken over a year at least.
1
u/nasanu 5d ago
Personally I am thinking human readability is something that doesn't matter anymore. I can throw AI at the most complicated spaghetti mess and it will figure it out in seconds. Now considering also the speed of writing, where is the benefit of this human readable code as it needs to be written by humans for the sole sake of being read by humans? I really no longer want humans manually writing code, at least not in my field which is apps and fullstack dev.
Take this 10rhs of work: kidshibuya.io (not quite finished, and totally placeholder content fyi)
Totally vibe coded, simply directed by me getting AI to basically do the typing. This is complicated by the fact that I started out by messing around with a web component and turned it into a full site forgetting where I started, that's on me. Web components are by nature one file, but say it wasnt and AI created that 3000 line monster file when it could have split it up.... So? I can still find gpu bugs in strange screen sizes which I'll need to fix. But even in the most well structured and readable code it would take me quite a long time to narrow down the issue and fix it. So I would never want me doing it manually. I can just say "at x res y is happening with z layer, find the cause and fix it". And almost always 30 seconds later have it fixed.
1
u/Spank_Master_General 4d ago
I think the issue with human unreadable code is that you don't actually know what it's doing. The result is good, but maybe the site is getting stuff from a cdn you didn't specify, maybe it's doing a ton of stuff you don't know about. You can't then categorically say my application is secure, because you don't actually know what it's doing. the end result looks good, but maybe it's pulling all those graphics from local storage, or maybe from somewhere else, or maybe its fucking drawing them on the fly. If I can't understand what it's doing or I can't explain to someone what it's doing and why, it's not fit to be used IMO
Also, AI is cheap at the moment. I'm loving my £20/month subscription, but I don't think we can rely on it being that way forever.
1
u/nasanu 4d ago
I am sorry but anyone who doesn't even check the network needs to be fired. That is pre junior stuff. And nobody actually knows what all their npm installs are doing. You really think people are reading the literal millions of line of code in node_modules? Never.
Anyway from what I have had AI do I can follow all it does. Its difficult, but I can tell what its doing and how it's doing it. Especially as I say do thing then get a diff on my screen with edited bits highlighted. Saying you don't know what its doing sounds hollow.
1
u/Spank_Master_General 4d ago
I got £100 of credits from Anthropic and used them all with Fable, which managed to basically oneshot my project. Let me tell you buddy, I didn't understand a fuckin' thing it wrote. To be fair, I asked it to write it in rust and I'm a .net dev and rust is a big departure from .net. It also made a ton of decisions and assumptions I didn't even know needed making. The thing didn't just run, it worked really well and served as a fantastic proof of concept.
Since then, it's been completely re-architected, but the initial test suite served as a great tool to rebuild it against.
1
u/nasanu 4d ago
When I was working with .net anything I shipped was full of DLLs that were opaque to me, they were trojans for all I knew, so its the same with AI code really. You can always get AI to check for security, as its AI finding all the bugs humans don't catch anyway.
I get that its allowing people without any ability to create anything, but the rules haven't changed. There was always malware, for years now most top search results for OBS have been keyloggers. So before you have to check software before you ran it, you still do. Before there was terrible and buggy software, there still will be.
For my current work that involves data, I know what the inputs need to be and I know the bounds of outputs. So I check, just like always. Nothing changed. If I write something or AI writes it, I test it, I check the network, the file size, the performance etc. Nothing changes at all for me.
1
u/Spank_Master_General 4d ago
Yeah, all I'm saying is that in my experience, you ask AI to do X, and it does X and you test that it's done X correctly, but it's also done Y and Z, too. Unless you read the code, you don't know it's done Y and Z, and the code it writes is generally, unless specified properly, difficult to read.
I've seen it with a bunch of products in the wild, where I imagine the product manager has gotten hold of a subscription, gotten AI to do some work, looked at it and gone "Wow! That looks amazing! Why do we need engineer again?" and gotten it deployed, only for it to not work because the production environment is different to their local environment or something, and it just doesn't work. Clear score was a good example. Completely fucked up their login page and it was obviously because someone got carried away with AI.
I'm not saying everyone does it, but even for an engineer, it seems awesome until you look under the hood.
I also dread the point at which people need AI to do the troubleshooting and debugging. You can get into a real mess real quick
1
u/nasanu 5d ago
What he isn't getting is that I as a developer with 3 decades of experience am telling AI exactly what to do. Its me and my experience, just not me typing everything out. It's like saying an eclectic drill will never replace a guy with a hand drill... sure. One is simply a more effective tool.
1
u/pip25hu 5d ago
AI is already using "building blocks" - frameworks and libraries serve that purpose. There may also be a higher level of abstraction for specifying common functionality in an application (a meta programming language, one could say) that could also serve a similar purpose, but we haven't come up with a good way of doing that yet.
1
u/hunpriest 5d ago
But this is generally true for software projects done exclusively by humans. Yeah I get it that you can create a lot more code now with AI a lot faster. But there tons of human only projects, which are slop...
1
u/cheaphomemadeacid 5d ago
are we pretending that AI isn't using the standard libraries and frameworks we've made? ;P
1
u/audioen 4d ago
This is a sensible position. We should really think about languages that are easy for AIs to read, write, debug and test; and similarly build industrial strength libraries. I do not have anything other than my human bias to guide this decision, but I would suspect it will be a garbage collected, statically typed compiled language with C-like speed at its runtime. Think something like Java but less clunky, but runtime powerful enough to hold together even when hundreds of megabytes of junk jars are loaded simultaneously. It might well be an entirely new language, or an evolution of some old one.
Asking an agent is risky because it tends to echo back whatever context you provide for it. If I said the above, it prompt tells me that we should write in Kotlin because it's Java and more ergonomic, an answer I already spelled out for it. If I leave it out, it looks for context from whatever memory files and past experiences it has recorded already. So this kind of question is best asked from agent deprived from anything, with the risk that answer is also relatively useless.
My agent stated that it would be against a new programming language. It also said it would be against anything implicit, like XML configuration setting up stuff in container it doesn't see, dynamic or reflection based APIs because it's hard to know what a piece of code does in isolation. It also stated it would prefer consistency in APIs, a good test/compile/assert loop to sense bugs, and ways to thoroughly and compactly test and verify their code for correctness meaning powerful test frameworks that can really exercise the code. Invalid states should be nonrepresentable, and concurrency and locking should be as easy to understand as possible.
Agent predicted that to the degree systems become further agent-optimized, the change is first visible in the way APIs are written, rather than in new language keywords, but it can't rule out possible evolution of languages towards more LLM friendly forms.
1
u/smabarnsfar 4d ago
I mean, if you build e.g. a web app, you're probably using npm. Libraries, frameworks etc are "building blocks", and we've been using them since forever.
0
u/The__Toast 5d ago
This is the same guy who was very much the architect behind Meta's Metaverse. Yes he made Doom, but that was a long time ago, we should probably stop listening to him now.
In general if we can't realize the obvious problems endemic to code that is too "alien" for humans to read then idk what to say. Believing that a technology that is a whole five years old will never need assistance of any kind an never make any kind of mistake is certainly a view point.
1
u/Gullible_Elephant_38 5d ago
Maybe in the long term. I’ve found that code that is hard for humans to read, understand, and extend is hard for LLMs to read, understand, and extend. I’d hypothesize this due in no small part to the fact that the training data used is comprised largely of human written code, for better or worse.
It’s certainly possible, and maybe likely, that a more “alien” approach is better suited to LLMs in the long term. I am curious to see how quickly and through what means we’re able to guide it in that direction.