80
you are viewing a single comment's thread
view the rest of the comments
[-] yogthos@lemmygrad.ml 3 points 1 day ago

I tend to use it to generate general boilerplate. Like say I have to talk to some endpoint and I get a JSON payload back. It can figure out how to call the endpoint, look at the payload, and then generate a component that will render the data in a sensible way. From there, I can pick it up and add whatever specific features I need. I generally find letting these things do design isn't terribly productive, so you are better off deciding on how to manage state, what to memoize, etc. on your own.

I also find the quality of the tools is improving very quickly. If you haven't used them in half a year or so, your experience is already dated. You get by far the biggest bang for your buck with editor integrated tools that can run MCP, where they can run code and look at output.

Finally, I personally don't see anything wrong with hooks/functional components even if there's already a new fad in Js land. The churn is absolutely insane to me, and I frankly don't understand how people keep up with this. You can start a project in Js, and by the time you finish it the Js world has already moved on to some new bullshit.

I used to work with ClojureScript when I needed frontend functionality before. There's a React wrapper called Reagent. It's basically a better version of hooks/functional components, it worked this way for over a decade. In that time, React itself went through a dozen different ways of doing things. The value gained has been rather unclear to me.

[-] Chana@hexbear.net 2 points 1 day ago

Yes I'm sure it can do a lot of boilerplate. I'm just saying I doubt it is very idiomatic. It is essentially a souped-up regurgitation machine drawing from a collection of a bunch of open source code over a long period of time and quality as well as documentation.

This can be fine for many purposes but if it is for a substantial project that other people will need to maintain I would suspect it is a technical debt generator. As the saying goes, code is read more than it is written. Writing the code is usually the easy part. Producing a maintainable design and structure is the hard part. That and naming things.

[-] yogthos@lemmygrad.ml 1 points 1 day ago

I mean all code is technical debt in the end, and given how quickly things move in Js land, it doesn't matter whether you're using LLMs or writing code by hand. By the time you finish your substantial project, it's pretty much guaranteed that it's legacy code. In fact, you'll be lucky if the libraries you used are still maintained. So, I don't really see this as a serious argument against using LLMs.

Meanwhile, as you note, what makes code maintainable isn't chasing latest fads. There's nothing that makes code written using hooks and functional components inherently less maintainable than whatever latest React trend happens to be.

And as I pointed out earlier, LLMs change the dynamic here somewhat because they significantly lower the time needed to produce certain types of codes. As such, you don't have to be attached to the code since you can simply generate a new version to fit new requirements.

Where having good design and structure really matters is at the high level of the project. I find the key part is structuring things in a way where you can reason about individual parts in isolation, which means avoiding coupling as much as possible.

[-] Chana@hexbear.net 1 points 1 day ago

I mean all code is technical debt in the end, and given how quickly things move in Js land, it doesn't matter whether you're using LLMs or writing code by hand.

I just explained why design and maintainability are the hard part and something LLMs don't do. LLMs lead to the bad habit of skipping these things, which junior devs do all the time, wasting a lot of resources. Just like a junior dev writing spaghetti can make a middle manager very happy because it's "delivered on time", they'll eventually have to pay in the form of maintenance far more than if better practices had been used.

Writing boilerplate React components that fetch JSON from APIs is the easy stuff that takes very little time. If you throw in intermediate things (like basic security) you will likely need to spend more time reviewing its slop than just doing it yourself. And it will likely be incapable of finding reasonable domain abstractions.

If it's for a throwaway project none of this really matters, of course.

By the time you finish your substantial project, it's pretty much guaranteed that it's legacy code. In fact, you'll be lucky if the libraries you used are still maintained.

If it is a production system with any prioritization of security it will need to be regularly maintained, including with library updates. If a library becomes unmaintained then one either needs to use a different one or start maintaining it themselves.

So, I don't really see this as a serious argument against using LLMs.

There are different ways to make code unmaintainable. It seems like you're saying writing code in JavaScript means you always do a rewrite when it comes time to do maintenance work (it moves fast!). This is just not true and is something easily mitigated by good design practices. And in terms of any org structure, you are much less likely to get a green light on a rewrite than on maintaining the production system that "works".

Meanwhile, as you note, what makes code maintainable isn't chasing latest fads. There's nothing that makes code written using hooks and functional components inherently less maintainable than whatever latest React trend happens to be.

I'm not sure what you mean by this. When I said hooks and functional components were 6 years old it was in the context of doubting whether LLMs are up on modern idioms. You said it wrote idiomatic code, citing 6-7 year old idioms. That's not great evidence because they are long-established over several major version releases and would be a major input to these LLMs. I mentioned a few newer ones and asked whether they were generated for your code.

React written with hooks and functional components is more maintainable than legacy implementations because it will match the official documentation and is a better semantic match to what devs want to do.

And as I pointed out earlier, LLMs change the dynamic here somewhat because they significantly lower the time needed to produce certain types of codes. As such, you don't have to be attached to the code since you can simply generate a new version to fit new requirements.

I don't get attached to code...

LLMs do the easy part and then immediately require you to do the harder parts (review and maintenance) or scrap what they generate for the hardest parts (proper design and abstractions). Being satisfied with this kind of output really just means having no maintenance plans.

Where having good design and structure really matters is at the high level of the project. I find the key part is structuring things in a way where you can reason about individual parts in isolation, which means avoiding coupling as much as possible.

It matters at all levels, right down to the nouns and adjectives used to describe variables, objects, database tables, etc. Avoiding coupling will mean knowing when to use something like dependency injection, which I guarantee LLMs will not do reliably, maybe even not at all unless it is the default pattern for an existing framework. Knowing to use dependency injection will depend on things like your knowledge of what will need to be variable going forward and whether it is easier to reason about behavior using that pattern in your specific context. If using domain model classes, are implementing an abstract method or are they passed the implementation and just know how to call it? Etc etc.

[-] yogthos@lemmygrad.ml 1 points 1 day ago

I just explained why design and maintainability are the hard part and something LLMs don’t do.

Ok, but I've repeatedly stated in this very thread that design is something the developer should do. Are you even reading what I'm writing here?

Writing boilerplate React components that fetch JSON from APIs is the easy stuff that takes very little time. If you throw in intermediate things (like basic security) you will likely need to spend more time reviewing its slop than just doing it yourself. And it will likely be incapable of finding reasonable domain abstractions.

I have to ask whether you actually worked with these tools seriously for any period of time, because I have and what you're claiming is directly at odds with my experience.

If it is a production system with any prioritization of security it will need to be regularly maintained, including with library updates. If a library becomes unmaintained then one either needs to use a different one or start maintaining it themselves.

Not sure what this has to do with code written by LLMs. If I have a React component it has fuck all to do with me updating libraries in the project. Furthermore, LLMs are actually quite decent at doing mechanical tasks like updating code to match API changes in libraries.

There are different ways to make code unmaintainable. It seems like you’re saying writing code in JavaScript means you always do a rewrite when it comes time to do maintenance work (it moves fast!).

No, I'm saying the exact opposite which is that you shouldn't try to chase fads.

I’m not sure what you mean by this. When I said hooks and functional components were 6 years old it was in the context of doubting whether LLMs are up on modern idioms. You said it wrote idiomatic code, citing 6-7 year old idioms. That’s not great evidence because they are long-established over several major version releases and would be a major input to these LLMs. I mentioned a few newer ones and asked whether they were generated for your code.

You might have to clarify which particular fad you're on currently, because I haven't been keeping up. However, I do see hooks and functional components used commonly today.

I don’t get attached to code…

Everybody gets attached to code, it's inevitable. If you have a bunch of code to solve a particular problem and it takes a lot of effort to rewrite it, then you're not going to throw it away easily. When your requirements start changing, it makes sense to try to adapt existing code to them rather than write code from scratch.

It matters at all levels, right down to the nouns and adjectives used to describe variables, objects, database tables, etc.

It really doesn't if you have good interfaces between components. You don't inspect all the code in libraries you include, you focus on the API of the library instead. The same logic applies here. If you structure your project into isolated components with clear boundaries, then your focus is on how the component behaves at the API level.

Avoiding coupling will mean knowing when to use something like dependency injection, which I guarantee LLMs will not do reliably, maybe even not at all unless it is the default pattern for an existing framework.

Again, I'm not suggesting using LLMs to do design. My whole point was that you do the design, and you use LLM to fill in the blanks. In this context, you've already figured out what the component will be and what scope it has, the LLM can help create features within that scope.

Knowing to use dependency injection will depend on things like your knowledge of what will need to be variable going forward and whether it is easier to reason about behavior using that pattern in your specific context.

Also, things like dependency injection are an artifact of OO programming style which I find to be an anti pattern to begin with. With functional style, you naturally pass context as parameters, and you structure your code using pure functions that take some arguments and produce some result. You can snap these functions together like Lego pieces and you can test them individually. This meshes quite well with using LLMs to generate code and evaluate whether it's doing what you want.

If using domain model classes, are implementing an abstract method or are they passed the implementation and just know how to call it? Etc etc.

Have you written code in styles other than OO?

[-] Chana@hexbear.net 1 points 1 day ago

Ok, but I've repeatedly stated in this very thread that design is something the developer should do. Are you even reading what I'm writing here?

Yes, and I'm replying in-context:

  1. I say that code is read more than it is written and that a boilerplate generator is going to be a technical debt machine that had no thought for maintenance.

  2. You say that all code is technical debt and don't engage further with that point.

  3. I reiterate that design and maintainability are what LLMs are bad at and using them for the easy stuff isn't exactly a boon.

I'll repeat again: LLMs are technical debt machines. There are ways to have more or less debt, it is not all the same regardless, and LLMs will just repeat patterns they've seen before, and these may be bad designs, bad patterns, that are difficult to maintain for any project used or maintained by real people. You will then need to, of course, check the result, which is the thing that is less easy and takes longer, so very little has been optimized.

Or this is a throwaway project and all of this is moot.

I have to ask whether you actually worked with these tools seriously for any period of time, because I have and what you're claiming is directly at odds with my experience.

Which part of what I said is at odds with what you're saying? I've used and rejected these tools as a waste of time and something to help others avoid.

Not sure what this has to do with code written by LLMs.

It's a direct response to what I quoted where you dismiss maintainability concerns by saying all substantial projects are legacy code and you'll be lucky if libraries are maintained. Is... is that not obvious?

If I have a React component it has fuck all to do with me updating libraries in the project.

I have no idea what this means. React is a library and it also needs to be updated, not to mention the request hook library(ies) your boilerplate would presumably use. If you are maintaining this project and it has any security aspects you'll need to update these things over time.

Furthermore, LLMs are actually quite decent at doing mechanical tasks like updating code to match API changes in libraries.

If you're updating libraries to ensure security I would hope you're not just trusting the outputs from such edits. You should review them as if an incompetent junior dev submitted a PR. I'm sure it can do a 90% okay job 70% of the time.

No, I'm saying the exact opposite which is that you shouldn't try to chase fads.

But we haven't discussed fads at all?

You might have to clarify which particular fad you're on currently, because I haven't been keeping up. However, I do see hooks and functional components used commonly today.

So basic modern idioms for an extremely popular UI library are just fads now? I've already asked about memoization (using currently documented recommendations) and contexts. You are being inconsistent, here: originally it was doing great writing idiomatic code. Once I question its ability to correctly recognize the need for and implement idioms from library improvements in the last 5 years I'm just chasing fads. Seems like it's not really thay good at idiomatic code, eh?

Everybody gets attached to code, it's inevitable.

Nope. I don't. The exact opposite is more common with more experience: you get the itch to rewrite. Throw the whole thing in the trash and start over. But this is not a practical use of time 9 times out of 10.

If you have a bunch of code to solve a particular problem and it takes a lot of effort to rewrite it, then you're not going to throw it away easily.

Oh I definitely am because I can now see how to remove the complexity and make it more versatile.

When your requirements start changing, it makes sense to try to adapt existing code to them rather than write code from scratch.

Changing requirements is a design process challenge. It indicates prototyping or gross incompetence if it's happening frequently. Sometimes that incompetence is out of one's hands, like a client that refuses to communicate effectively, but it is less about the code and more about social skills and planning.

If requirements change it can imply modifying an existing codebase ir throwing it all away to start over. It really depends on what the new requirements are. If suddenly there is a need for a very flexible event-driven strategy, you probably need to start over.

It really doesn't if you have good interfaces between components.

It actually really does because it enables capturing and therefore correctly addressing domain problems. Junior devs call meaningful variables "x" and "y" because they can't see this yet, then take forever during a review ir maintenance cycle weeks later because they are tryinh to figure out the meaning and function if meaninglessly named and organized things. In React these would be the same people putting every component module in a module called "components" even for large projects.

"Good interfaces" doesn't address the points I'm raising at all. The best interfaces cannot fix the wrong abstraction being chosen. If your domain needs to represent accounts but you never represent actions taken directly (e.g. "deduct $34.56") you will end up with a confusing mess.

You don't inspect all the code in libraries you include, you focus on the API of the library instead. The same logic applies here. If you structure your project into isolated components with clear boundaries, then your focus is on how the component behaves at the API level.

Until it comes time to maintain your systems and you find that your domain elements are not represented and you don't understand the variables because you let a markov process write your components.

There is another inconsistency here. What you're repeatedly getting at is that you want to treat the things generated by LLMs and things you can wall off and regenerate, machine-edit, etc as needed. Implicit here is that you don't need to actually maintain that code, but actually you do if you have any seriousness about the project. Certainty in function. Security. Ever needing to refactor to add new features. And then this will fall apart because you now have to wade through whatever the LLM generated with all the warts I've described.

Or this is a throwaway project and none of this matters. No real design elements, no security, no user testing, etc. Which is fine, just not a great endorsement for LLMs.

Again, I'm not suggesting using LLMs to do design.

Using dependency injection is a basic pattern. While it is part of design, it is also part of implementation and it changes how the rest of a codebase may function. React uses it a lot in its implementation. It is in no way separate from the task of having LLMs write components and they will produce wrong results without taking this into account. And this is just one example.

Of course, people can make all of these mistakes. But if they are following an intentional design, they will make fewer of them and therefore need less review.

My whole point was that you do the design, and you use LLM to fill in the blanks.

These things are not separable a la a black box. The problems I have noted remain.

In this context, you've already figured out what the component will be and what scope it has, the LLM can help create features within that scope.

I'm sure it can with 90% efficacy for 70% of simple features. And then you need to rename half of the things. And write a bunch of tests. And do a security audit. Accessibility audit?

Anyways the point was that LLMs don't actually understand these things, just patterns, so they fall on their face for choosing something like dependency injection. There are many things like dependency injection and it won't recognize when to use them. You say this is left up to design, but it will be interwoven with implementation, even of components - the thing you're having the LLM do.

Also, things like dependency injection are an artifact of OO programming style which I find to be an anti pattern to begin with.

This is incorrect. Dependency injection is a ubiquitous pattern. It's even used in functional programming. And you'd better get stoked about OOP if you are using JS because just about everything is an object. Including the functions you're calling to generate components. And if you dive into the libraries you're using they will be chock full of semi-complex classes.

With functional style, you naturally pass context as parameters, and you structure your code using pure functions that take some arguments and produce some result.

Can you give me an example of when you have passed a function as an argument to a function? Think about what that pattern entails, how the function is used, how and when it is called, and the name of the method (if applicable) doing the calling.

You can snap these functions together like Lego pieces and you can test them individually. This meshes quite well with using LLMs to generate code and evaluate whether it's doing what you want.

Modularity and testability is basically just as easy and powerful between OOP and FP. Though I do want to emphasize that you are actually using a lot of classes and objects. Every time you call a method, for example. "await fetchedData.resolve()" etc etc.

Have you written code in styles other than OO?

lmao

[-] yogthos@lemmygrad.ml 1 points 1 day ago* (last edited 1 day ago)

I feel like we're just going in circles here. I really don't have anything new to add over what I've already said above.

Can you give me an example of when you have passed a function as an argument to a function?

Literally any higher order function lmfao.

[-] Chana@hexbear.net 1 points 1 day ago

Cool then you have done a form of dependency injection with FP.

I don't think we are talking in circles, I feel very on top of this conversation. But we don't have to continue it.

[-] yogthos@lemmygrad.ml 1 points 1 day ago

I think we're going in circles because you've simply reiterated the points I've already addressed, and I don't see the point of me restating them so that you can restate yours again. But we can keep going if you feel this is productive.

I've done the equivalent of dependency injection with FP, which consists of passing a function to another. The point I was making there is that you can keep vast majority of your code pure with FP. This means you can test functions individually and you only have to consider their signature going forward. Any context the function needs is passed in explicitly. In this way you're able to push state to the edges of the application. This is far more difficult to do with OO because each object is effectively a state machine, and your application is a graph of these interdependent state machines.

The reason I brought up FP in the context of LLMs is due to the fact that this model fits very well with creating small components that can be reasoned about in isolation and composed to build bigger things. This way the developer can focus on the high level logic and composition, while letting the LLM fill in the details.

I've asked you earlier if you've recently used these tools seriously for any period of time, if you have not then I don't see much point having an argument regarding your assumptions of how these tools work.

[-] Chana@hexbear.net 1 points 23 hours ago

I think we're going in circles because you've simply reiterated the points I've already addressed, and I don't see the point of me restating them so that you can restate yours again.

Have my points been addressed? I don't think so, on average. This is why I explained and clarified: to allow you to respond in a different way, as some of the responses miss the mark by a mile. I assumed some of that was just a communication issue.

But we can keep going if you feel this is productive.

So far I don't think it's been particularly productive, but I always give the benefit of the doubt.

I've done the equivalent of dependency injection with FP, which consists of passing a function to another.

Technically dependency injection just means providing control of internal behaviors to the caller, so a generous interpretation could even include non-callable parameters or other things that aren't directly functions. I just used this example because I think it is the most intuitive.

The point I was making there is that you can keep vast majority of your code pure with FP. This means you can test functions individually and you only have to consider their signature going forward. Any context the function needs is passed in explicitly. In this way you're able to push state to the edges of the application. This is far more difficult to do with OO because each object is effectively a state machine, and your application is a graph of these interdependent state machines.

To be clear, every single one of the React components you let an LLM write for you is actually a class for which an instance is later generated, complete with opportunities for side effects. The JXS/TSX is translated into this by your build system. Reducing or removing side effects does indeed have many advantages and this is easier to do with FP (though purity in a browser context is often thwarted), but I'm not sure why you are making this point. Is this in response to something I said?

The reason I brought up FP in the context of LLMs is due to the fact that this model fits very well with creating small components that can be reasoned about in isolation and composed to build bigger things. This way the developer can focus on the high level logic and composition, while letting the LLM fill in the details.

These things are not actually related. You can have tons of side effects even when you make separate components, it all depends on how they are implemented. Modularity and side effects are orthogonal things.

For example, you mention that the React components fetch and display JSON. This behavior is actually a stateful side effect. To tie back to semantic naming, the React hook libraries that people usually use for this task all use the useEffect hook under the hood - "Effect" as in side effect. This is why if you test those components you need to deeply mock those side effects, e.g. using a testing-friendly library for web API tasks.

Leaving components up to LLMs does not obviate the need to work around the issues I've previously mentioned, including maintenance work.

I've asked you earlier if you've recently used these tools seriously for any period of time, if you have not then I don't see much point having an argument regarding your assumptions of how these tools work.

I don't need to assume how they work, I understand how LLMs function from the ground up and, as I said before, have used and rejected them as a waste of time re: coding. They automate the easy stuff, doing a worse job than repeatable codegen tools, and I still need to do the harder things while checking their work.

It is like starting a fresh project with complete newbie junior devs. Until they are trained and understand the domain, they will be a drain on the project. It takes months to years for them to be more productive than not. This is fine, it's how training works in general, but shackling myself to this on purpose without any downstream training benefit is a waste of my time.

[-] yogthos@lemmygrad.ml 1 points 22 hours ago

Have my points been addressed? I don’t think so, on average. This is why I explained and clarified: to allow you to respond in a different way, as some of the responses miss the mark by a mile. I assumed some of that was just a communication issue.

Alright, which specific points do you want me to address here that you feel I haven't?

To be clear, every single one of the React components you let an LLM write for you is actually a class for which an instance is later generated, complete with opportunities for side effects.

It doesn't matter one bit in the context of what I'm saying. My point, once again, is that if I can pass the context to the component when I call it, then I can reason about it in isolation. If I make a React widget and I test that it's doing what I need it to, then I can use it anywhere I want from that point on by passing it the data it will render.

The reason I'm making this point, as I've repeatedly explained already, is that I can have the LLM make a component, test that it does what I need, and use it. If I need something new, I can make a new component. The part that matters to me is that it does the correct thing with the data provided.

These things are not actually related. You can have tons of side effects even when you make separate components, it all depends on how they are implemented. Modularity and side effects are orthogonal things.

Modularity and side effects are absolutely not orthogonal. If you have side effects, as in functions that take references to shared state as input and manipulate them, then you can't have modularity because you can't reason about individual pieces of code in isolation. You have to consider all the code that has references to the state you're modifying. If we're talking about side effects such as rendering data to screen or doing IO, these aren't problematic in the same way. Even in Js land you can mitigate the problem easily by using one of many immutable data structure libraries.

Leaving components up to LLMs does not obviate the need to work around the issues I’ve previously mentioned, including maintenance work.

I never said that leaving components to LLM obviates the need to do maintenance work. However, my experience is that it's very cheap now to just make a new component when you need one.

I don’t need to assume how they work, I understand how LLMs function from the ground up and, as I said before, have used and rejected them as a waste of time re: coding. They automate the easy stuff, doing a worse job than repeatable codegen tools, and I still need to do the harder things while checking their work.

So, in other words, you haven't actually used these tools for any period of time, nor have you used them recently. You are substituting your obvious biases for actual experience here.

It is like starting a fresh project with complete newbie junior devs.

It's absolutely nothing like that, but it's pretty clear that you've already made up your mind and I'm not going to try to convince you otherwise here. All I can tell you is that my experience having used these tools extensively for the past half a year or so is completely at odds with the way you think they work.

[-] Chana@hexbear.net 1 points 22 hours ago

Alright, which specific points do you want me to address here that you feel I haven't?

I think almost everything in my comment a few steps back before you suggested hitting pause would count. I'm not saying you need to reply to it, just pointing to an example. If I had to make them specific I would end up restating most of that comment, which seems unnecessary.

It doesn't matter one bit in the context of what I'm saying. My point, once again, is that if I can pass the context to the component when I call it, then I can reason about it in isolation. If I make a React widget and I test that it's doing what I need it to, then I can use it anywhere I want from that point on by passing it the data it will render.

It matters in that you're saying things that don't make sense re: pure functions. Those components are not pure at all and in fact are not functions in reality. To be clear, you're describing your logic in these terms. I'm not being pedantic, I am just trying to deal with responses that don't make sense.

Regarding your clarification, I am still somewhat confused. For the most part, in React, you are not calling components. This is done for you by the App class deep behind the scenes. When using (as opposed to defining) your components you are structuring them as if they were markup with dynamic arguments, all of which gets translated into something of a different nature when it runs in a browser.

I believe you are trying to describe presentational components? Those are the "pure-ish" equivalent for React components. Same input, same output. Any React component using useEffect (and some other hooks) will not have the properties you describe - such as one fetching JSON from a web API. Hence what I said about mocking for testing.

The reason I'm making this point, as I've repeatedly explained already, is that I can have the LLM make a component, test that it does what I need, and use it. If I need something new, I can make a new component. The part that matters to me is that it does the correct thing with the data provided.

And it will have every downside I have described. This does not contradict my criticisms. My criticisms have already included characterizing your stated approach in these terms - and then noted their problems.

Modularity and side effects are absolutely not orthogonal.

Yes they are. You can have non-modular with no side effects, modular with no side effects, non-modular with side effects, and modular with side effects. You can introduce side effects at any level of an applicatiom. A codebase that is not modular is likelier to colocate more state and have harder to reason about side effects (if present), but their presence is orthogonal.

If you have side effects, as in functions that take references to shared state as input and manipulate them, then you can't have modularity because you can't reason about individual pieces of code in isolation.

Side effects are anything outside the immediate scope of something being called that can change its state. This applies to any kind of thing that can be run/called and any way of having state change due to external factors. The state doesn't need to be shared with anything inside your application. Like the JSON being provided to your components.

Modularity is a different thing. It is about breaking down your code into reusable pieces, often isolating their state. I can see your reasoning, which is that good modularity means minimizing sharing a state e.g. a global variable or shared reference, but this is not the only way to have side effects and you can have a very modular application that nevertheless has many and a non-modular application with none.

You have to consider all the code that has references to the state you're modifying. If we're talking about side effects such as rendering data to screen or doing IO, these aren't problematic in the same way. Even in Js land you can mitigate the problem easily by using one of many immutable data structure libraries.

They are problematic in the same way they're just usually outside your control or are necessary for needed behaviors (e.g. getting screen size). As they contain important state information, you should think of them as the full application context. And this is why you have to do a lot of mocking for front end JS code testing.

Immutable data structures are a way to limit side effects but they don't impact modularity directly, they just make it easier to avoid it because your application won't work as expected if you try to use them as shared mutable state.

I never said that leaving components to LLM obviates the need to do maintenance work.

And I didn't say you did. What did I say about maintainability of code generated by LLMs?

However, my experience is that it's very cheap now to just make a new component when you need one.

I also critiqued that.

So, in other words, you haven't actually used these tools for any period of time

This is literally the opposite of what I've said about this twice now.

nor have you used them recently.

I haven't said anything about that, actually. You may want to take a step back from guessing and conflating this with knowledge.

You are substituting your obvious biases for actual experience here.

My biases are based on actual experience as well as knowledge of the limitations of LLMs and the domain of software architecture. Please do your best to engage with what I'm saying instead of fishing for reasons to be personally dismissive, comrade.

It's absolutely nothing like that, but it's pretty clear that you've already made up your mind and I'm not going to try to convince you otherwise here.

Oh? So do you not review the generated code? Look for bugs? Add or change documentation? Question the levels of abstraction? Write tests to ensure specific behaviors not covered? Go through multiple rounds of this until a more correct and maintainable version exists? If not then this should not be a production system nor a project any other person ever needs to work on.

Please do your best to specifically address what I'm saying instead of reasons to be personally dismissive.

All I can tell you is that my experience having used these tools extensively for the past half a year or so is completely at odds with the way you think they work.

How so? So far I don't believe you've named a single error in my thinking regarding how these LLMs work.

[-] yogthos@lemmygrad.ml 1 points 20 hours ago

I think almost everything in my comment a few steps back before you suggested hitting pause would count. I’m not saying you need to reply to it, just pointing to an example. If I had to make them specific I would end up restating most of that comment, which seems unnecessary.

I really don't see what new points your comment adds that we haven't already discussed. I've repeatedly pointed out that what I find LLMs to be effective at is doing surface level things, or building out isolated components that can be reasoned about and tested in isolation. I really don't see how the points you raise apply here.

It matters in that you’re saying things that don’t make sense re: pure functions. Those components are not pure at all and in fact are not functions in reality. To be clear, you’re describing your logic in these terms. I’m not being pedantic, I am just trying to deal with responses that don’t make sense.

I think I was pretty clear what I meant. I was talking about coupling via shared mutable state. This is the aspect that I find makes code difficult to reason about.

Regarding your clarification, I am still somewhat confused. For the most part, in React, you are not calling components. This is done for you by the App class deep behind the scenes. When using (as opposed to defining) your components you are structuring them as if they were markup with dynamic arguments, all of which gets translated into something of a different nature when it runs in a browser.

You're talking about implementation details here. I'm talking about the semantics of how you use and reason about these components. Once again, what you really care about is scope. What data is passed to a component and what the ownership of this data is.

I believe you are trying to describe presentational components? Those are the “pure-ish” equivalent for React components. Same input, same output. Any React component using useEffect (and some other hooks) will not have the properties you describe - such as one fetching JSON from a web API. Hence what I said about mocking for testing.

Hooks are obviously not pure, but they don't inherently prevent reasoning about your components or testing them in isolation.

And it will have every downside I have described. This does not contradict my criticisms. My criticisms have already included characterizing your stated approach in these terms - and then noted their problems.

Frankly, I'm not even sure what your criticisms are specifically. You've made some assertions about dependency injection, memoiztion, and so on, and claimed that this is somehow problematic when you have LLMs generate code. I've personally not run into these issues, so this argument isn't really making a lot of sense to me.

A codebase that is not modular is likelier to colocate more state and have harder to reason about side effects (if present), but their presence is orthogonal.

The type of side effects we're talking about matters. The problematic kind are the ones that result in coupling via implicit shared mutable state as a result of passing and modifying references to shared data.

I can see your reasoning, which is that good modularity means minimizing sharing a state e.g. a global variable or shared reference, but this is not the only way to have side effects and you can have a very modular application that nevertheless has many and a non-modular application with none.

What I'm saying is that avoiding shared mutable state is a prerequisite for modularity. You certainly can create coupling in other ways, but if you have shared state then you're inherently coupled from the start.

This is literally the opposite of what I’ve said about this twice now.

What you said was

have used and rejected them as a waste of time re: coding. They automate the easy stuff, doing a worse job than repeatable codegen tools, and I still need to do the harder things while checking their work.

You didn't say which tools you used, you didn't say when you used them, or how much time you've actually invested in learning and becoming productive with them. Did you use qwen-code, Continue, Roo-Code, etc, which models were you using with them, how did you decide which parts of the project to apply them to, how did you limit scope, what structure did you provide them with that you've written up front?

Oh? So do you not review the generated code? Look for bugs?

Of course I do, and I don't find the process is anything like working with a junior dev, which I have done extensively I might add. It's a process closer to using a very clever auto complete in my experience.

Incidentally, writing tests is an excellent use case for LLMs because tests tend to consist of isolated functions that test a specific thing. It's easy to see if the test is doing what's intended, and LLM can crap out a lot of boilerplate for the tests quickly to test a lot of edge cases that's tedious to do by hand.

How so? So far I don’t believe you’ve named a single error in my thinking regarding how these LLMs work.

What I'm telling you is that I use LLMs on daily basis to implement functions, UI components, API endpoints, http client calls, and so on. I'm not experiencing the problems which you insist I should be experiencing in terms of code maintainability, testing, or documentation.

It took me a few months to develop intuition for where LLMs are likely to produce code that's useful, and where they're likely to fail. It also took me a bit of time to figure out how to limit scope, and provide enough scaffolding to ensure that I get good results. Having invested the time to learn to use the tool effectively, I very much see the benefits as I'm able to work with Js effectively and ship stuff despite being very new to the ecosystem.

I also find LLMs are great for digging through existing codebases, and finding parts that you want to change when you add features. This has always been a huge pain when starting on large projects, and these things drastically reduce ramp up time for me.

You're telling me that your experience is wildly different from mine and you don't find these tools save any time, hence why my impression is that you might not have spend the time to actually learn to use them effectively. If you come in with a mindset that the tool is not useful, then you fiddle around with it and get bad results, that simply confirms your existing bias, and you move on.

[-] Chana@hexbear.net 1 points 18 hours ago

I really don't see what new points your comment adds that we haven't already discussed.

I think you should read it again and rethink this response.

I've repeatedly pointed out that what I find LLMs to be effective at is doing surface level things, or building out isolated components that can be reasoned about and tested in isolation. I really don't see how the points you raise apply here.

You've said quite a few things, much of which make no technical sense. Mostly in response to my critiques of statements like this, such as reminding you that you still need to do the harder parts of maintenance, design, reviewing those modules, etc. I have repeatedly noted security as a topic where care must be taken, it must be hands-on, and you should not rely on black box thinking for anything important. I noted that common design patterns regarding state will inevitably means these components will not be things you can treat like black boxes, you will need to maintain them. I noted that others needing to read your code will need to have semantically named content to more easily understand it and that the writing portion of simple components is much less important (and time-sucking) than making a coherent and intentional design. I critiqued the idea of these LLMs producing idiomatic code, a claim you introduced, and you got confused about the topic, treating my challenge about newer idioms as a suggestion to follow fads as if it were silly for these LLMs to... produce idiomatic code. I explicitly noted inconsistencies like this.

You largely ignored these responses or seemingly misunderstood them, responding in ways that made no technical sense. I attempted to clarify, giving you many opportunities to recognize where we agree or reframe your responses.

Then you went meta and suggested this discussion was pointless. Now we are here, with you insisting you've responded to all of my germane points (you absolutely have not) and then repeating your original position for no reason.

If you'd like we can revisit all of them. Every point misunderstood, every technical error, every point ignored.

I think I was pretty clear what I meant. I was talking about coupling via shared mutable state. This is the aspect that I find makes code difficult to reason about.

No, you were not clear in what you meant, you were actually incorrect in your statements re: purity regarding functional programming. It is difficult to be less clear than stating something clearly technically false on a technical matter. Your claim simply does not apply to your described codebase. I have offered a few interpretations of what you might be meaning to say. Are any of my interpretations correct?

You're talking about implementation details here.

If the nature of calls and design in a React application are just implementation details then why are you talking about them so much? OOP vs FP? Purity of functions? Definitions vs. instantiations? As a reminder this all stems from me simply pointing out that LLMs will produce fairly boilerplate outputs that won't account for important design questions - like dependency injection. And you can't just ignore and separate this if you actually use those design decisions.

I'm talking about the semantics of how you use and reason about these components.

You're saying semantically incorrect things. I am attempting to present correction in a way that can be received, as you seem to not know what these terms mean or how React works, otherwise you wouldn't make such frequent mistakes. These mistakes should not be a big deal but the response of trying to justify or ignore them is not easy to work with.

Once again, what you really care about is scope. What data is passed to a component and what the ownership of this data is.

JS has no concept of data ownership or when variables go in and out of scope (except for the GC). I have no idea what you're talking about. These are not correct or meaningful statements, though I'm sure they mean something to you.

Hooks are obviously not pure, but they don't inherently prevent reasoning about your components or testing them in isolation.

They prevent your components from being pure... You are objectively wrong in how you described this strategy. Was my attempt to fix it and redescribe what you might be talking about correct? I have no idea, you presented only something in the form of counterargument that didn't directly address what I said.

Frankly, I'm not even sure what your criticisms are specifically.

This is absurd.

You've made some assertions about dependency injection, memoiztion, and so on, and claimed that this is somehow problematic when you have LLMs generate code.

Yes, what did I say about those things? What was my meaning? I was fairly explicit when I introduced those terms. That you have forgotten or did not try to understand in the first place is not a counterpoint.

I've personally not run into these issues, so this argument isn't really making a lot of sense to me.

If you will recall, I brought up dependency injection as something that LLMs will not produce by default as it is a design question (aside from existing patterns from boilerplate). This was just an example of the kind of design question that often touches fairly deeply on the application and how it has been modularized and generalized. There are many abstractikns like this that would not jibe with black box codegen.

If you will recall, I brought up Memoization with regards to you saying the LLMs produce idiomatic code. Choosing when to memoize and which variables to memoize is a reasoning problem and not one that LLMs do a very good job of, as they primarily reproduce patterns. I'm sure they do introduce memoization sometimes, but you'll still need to think about this yourself.

Notice that these are two fairly separate critiques. I presented them separately and with distinct rationales.

You not running into them, to me, just suggests that you don't use these kinda of things at all because your projects are very simple and not much design goes into them. They may not need more design than they have, so I am not criticizing that. But "I haven't run into these problems" isn't meaningful without acknowledging what those problems are, how they might cause issues, and asking whether they would have presented themselves in any of your projects. And both are just examples of the type of challenge they represent for codegen.

The type of side effects we're talking about matters. The problematic kind are the ones that result in coupling via implicit shared mutable state as a result of passing and modifying references to shared data.

As I explained, they are all problematic, just some are often outaide our control. If your API calls are to data with internal consistency or references, foe example, you may run into conflicting state information about the same server-side state because separate components are responsible for fetching that state independently - not in sync. Library developers for fetching web data often use complicated caching strategies for this reason. In the case of web data you might not even have control of when that state mutates!

What I'm saying is that avoiding shared mutable state is a prerequisite for modularity. You certainly can create coupling in other ways, but if you have shared state then you're inherently coupled from the start.

And you'd be wrong about that. Every React app that drills down into components with callbacks or uses contexts will use and potentially modify shared state when instantiated but can be developed as a modular component. They are essentially using dependency injection, a lucky coincidence.

The programmatic nature of these components as having side effects is the same as for components fetching state from the web. The difference is in what you have control over.

You didn't say which tools you used, you didn't say when you used them, or how much time you've actually invested in learning and becoming productive with them. Did you use qwen-code, Continue, Roo-Code, etc, which models were you using with them, how did you decide which parts of the project to apply them to, how did you limit scope, what structure did you provide them with that you've written up front?

You didn't ask for any of that and for infosec reasons I wouldn't describe my dev setup anyways. You seem to be inventing reasons to be dismissive ad hoc, as if I should have read your mind before you deigned to listen to my clearly uneducated opinions, right?

Of course I do, and I don't find the process is anything like working with a junior dev, which I have done extensively I might add. It's a process closer to using a very clever auto complete in my experience.

Either you're doing a full review of the code or you aren't. If you are, it is like reading anyone else's code, and with the propensity for being just a bit to very wrong for one's stated needs and matching documentation/stackoverflow a little too closely, quite similar to a junior dev. If you aren't, this isn't a serious production system and you're black boxing it.

Incidentally, writing tests is an excellent use case for LLMs because tests tend to consist of isolated functions that test a specific thing. It's easy to see if the test is doing what's intended, and LLM can crap out a lot of boilerplate for the tests quickly to test a lot of edge cases that's tedious to do by hand.

Tests are maybe the worst application of LLMs. Tests are where you, the designer, get to specify how your application is supposed to behave. If your tests are that tedious, I suspect your tooling is wrong or your architecture is wrong.

What I'm telling you is that I use LLMs on daily basis to implement functions, UI components, API endpoints, http client calls, and so on. (...)

Not a single one of these 4 paragraphs points out an error in my thinking re: LLMs.

[-] yogthos@lemmygrad.ml 1 points 9 hours ago

I think you should read it again and rethink this response.

I read them again, and my response remains the same. None of what you say matches my actual experience using these tools.

I have repeatedly noted security as a topic where care must be taken, it must be hands-on, and you should not rely on black box thinking for anything important.

And nowhere did I argue otherwise. However, if your input text boxes are a security concern then you might want to step back and think hard about the design of your app.

noted that common design patterns regarding state will inevitably means these components will not be things you can treat like black boxes, you will need to maintain them.

I don't know what design patterns you use, but I'd rethink them, because you absolutely can create self contained components. Any component library is a testament to that.

I noted that others needing to read your code will need to have semantically named content to more easily understand it and that the writing portion of simple components is much less important (and time-sucking) than making a coherent and intentional design.

This is based on an assumption you've made that code generated with LLMs will be difficult to understand. This is not my experience at all.

I critiqued the idea of these LLMs producing idiomatic code, a claim you introduced, and you got confused about the topic, treating my challenge about newer idioms as a suggestion to follow fads as if it were silly for these LLMs to… produce idiomatic code. I explicitly noted inconsistencies like this.

I'm not confused about anything here. I simply rejected your claim and you got upset about it.

You largely ignored these responses or seemingly misunderstood them, responding in ways that made no technical sense. I attempted to clarify, giving you many opportunities to recognize where we agree or reframe your responses.

No, I understood them fine and I addressed them repeatedly in this thread. What it comes down to is that none of your claims match with my actual usage of these tools.

Then you went meta and suggested this discussion was pointless. Now we are here, with you insisting you’ve responded to all of my germane points (you absolutely have not) and then repeating your original position for no reason.

I suggested this discussion was pointless because we just keep going in circles here, but evidently you find this to be a meaningful use of your time.

If you’d like we can revisit all of them. Every point misunderstood, every technical error, every point ignored.

I understood your points perfectly, I simply disagree with them based on my experience. That's all I can tell you.

No, you were not clear in what you meant, you were actually incorrect in your statements re: purity regarding functional programming.

If it's not clear to you that I was talking about shared mutable state after I repeatedly said then I really don't know what else to say.

If the nature of calls and design in a React application are just implementation details then why are you talking about them so much?

What I said repeatedly is that you can limit scope of your components within the application, which makes it possible to reason about them in isolation. Then you can focus on the API level of each component when considering the flow of logic within the application. This is really a fundamental aspect of how you structure large applications in a maintainable way.

The whole discussion is about the fact that if you structure your app properly, you can use LLM code in a way where the scope is limited which makes it easy to reason about them.

You’re saying semantically incorrect things.

Seems to me that we're just talking past each other here and you're not even putting a minimum effort into trying to understand what I'm actually saying.

JS has no concept of data ownership or when variables go in and out of scope (except for the GC). I have no idea what you’re talking about. These are not correct or meaningful statements, though I’m sure they mean something to you.

Js doesn't have to have a concept of data ownership. You as a developer absolutely should have one though. I've already pointed out how using an immutable data structure library is a great way to limit scope. The fact that you're struggling to understand such basic things is frankly concerning.

They prevent your components from being pure… You are objectively wrong in how you described this strategy.

See, this is what I mean we're going in circles. What did I say the main problem with side effects was, and what types of side effects did I say were problematic?

Yes, what did I say about those things? What was my meaning? I was fairly explicit when I introduced those terms. That you have forgotten or did not try to understand in the first place is not a counterpoint.

You made statements that have absolutely no relation to any code I've ever generated using LLMs.

If you will recall, I brought up dependency injection as something that LLMs will not produce by default as it is a design question (aside from existing patterns from boilerplate).

And I've repeatedly said that I don't need LLMs to do any design for me. This is precisely the problem with this whole discussion. You make a straw man and then demand that we argue about it.

If you will recall, I brought up Memoization with regards to you saying the LLMs produce idiomatic code.

Again, I do not need LLM to choose when to memoize anything. I'm perfectly capable of making that decision myself. This is not a problem I need it to solve for me.

You not running into them, to me, just suggests that you don’t use these kinda of things at all because your projects are very simple and not much design goes into them.

I'm not running into them because I'm making these decisions myself. In fact, I even explained how I sketch out the scaffolding for the LLM to fill in. I make all the design and architecture decisions in the code base.

But “I haven’t run into these problems” isn’t meaningful without acknowledging what those problems are

I haven't run into these problems because of the way I use the tool, not because my projects are so simple that these design decisions don't need to be made. I've explained this repeatedly to you.

As I explained, they are all problematic, just some are often outaide our control.

If you have problems like different components showing different state, then that's very much a sign of poor up front design.

And you’d be wrong about that.

If you have a component that modifies shared state outside it's scope that's coupling by the very definition. You evidently have a personal definition of what the word modular means.

The programmatic nature of these components as having side effects is the same as for components fetching state from the web. The difference is in what you have control over.

What you care about as a developer first and foremost is the state of the data in your app. If you manage state in a sane way, then most of your problems go away.

You seem to be inventing reasons to be dismissive ad hoc

Ah yes, you can't tell me whether you've actually used the tools you're heatedly arguing about for "infosec reasons". It's obvious that you have not used these tools with a serious intent of learning and understanding them.

Either you’re doing a full review of the code or you aren’t.

If you rely solely on visual review of code to determine that your production system works then you're not working on a serious system. Meanwhile, as I've explained, I use LLMs to fill in function signatures, and I read them one function at a time as I make and test them.

If your approach to using LLMs is to let them generate a bunch of code and then try to read and understand it all at once then I can see why you have a bad time.

Tests are maybe the worst application of LLMs. Tests are where you, the designer, get to specify how your application is supposed to behave.

I'm not sure how these things are contradictory in your mind. I know what I want in my tests, doesn't mean I can't have the LLM do the manual effort of writing things and then tweak the tests as I need to. I find any code I don't have to write to be tedious. Some of us get into programming because we like to automate things.

Not a single one of these 4 paragraphs points out an error in my thinking re: LLMs.

As I said earlier, this is a tool that works for me, if you can't figure out how to use if effectively that's your problem. Do what works for you, I'm not here to tell you how to live.

[-] Chana@hexbear.net 1 points 4 hours ago

I read them again, and my response remains the same. None of what you say matches my actual experience using these tools.

That's not what we were talking about in what we quoted. It was your ridiculous suggestion that an entire point by point comment I wrote and that you ignored had nothing we hadn't already discussed. If you "read them again" I would expect you to at least know what this part of the conversion was about, i.e. I just don't believe you.

I give up. Please self-crit on this interaction and whether you have been honest with your comrade.

[-] yogthos@lemmygrad.ml 1 points 2 hours ago

Your entire argument is a straw man because you set up a fictitious workflow that is nonsensical and then argue against it. Perhaps that's how you were trying to use these tools yourself, and I can see why you'd have a bad time doing that. When I tried to repeatedly explain to you how I actually use these tools you simply ignored that. It's quite clear you were never interested in actually understanding how I use these tools or what value I get from them. Furthermore, you were incredibly rude and disrespectful throughout the whole discussion.

Maybe take your own advice there and do a bit of self-crit and try to be better going forward.

this post was submitted on 22 Aug 2025
80 points (100.0% liked)

technology

23926 readers
155 users here now

On the road to fully automated luxury gay space communism.

Spreading Linux propaganda since 2020

Rules:

founded 5 years ago
MODERATORS