The point is that the LLM can produce 90% of the code here, and then you might need to tweak a couple of lines. Even with your changes, there’s still very obviously a non trivial amount of boilerplate, and you just can’t bring yourself to acknowledge this fact.
That whole code is boilerplate that I originally generated using an LLM from the following query write a django endpoint for handling a json payload with user information and storing it in the db. After you making it concise, it’s still over 40 lines of code.
This means that any of this supposed “boilerplate” (you are not even using the right term, more on that in a second) is just AI slop that doesn’t even do a half decent job of what you have been arguing, around getting rid of “boilerplate” that is inconvenient. It is the LLM itself that is creating all this supposed boilerplate!.
Thirdly:
I don’t understand what you think “boilerplate” is. Because 40 lines of code where you define a model, the fields that are serialized through the REST API, and the REST API implementation is not boilerplate. Boilerplate is defined as “sections of code that are repeated in multiple places with little to no variation.” (Wikipedia). Where is the “repeated in multiple places” in this example? If we even took this example further and extended it to other models - where would the duplication be? The fact that you inherit from ModelViewSet? That you inherit from ModelSerializer? There is no boilerplate here! If anything the boilerplate is inside ModelSerializer and ModelViewSet, but that’s object oriented design! You’re inheriting from those classes so you don’t have to do it yourself!.
It’s boilerplate because it’s just lines of code that are spelling out a repetitive pattern that you end up having to mindlessly write over and over. The fact that you continue to refuse to acknowledge this blows my mind to be honest.
It’s boilerplate because it’s just lines of code that are spelling out a repetitive pattern that you end up having to mindlessly write over and over.
And again, I ask you, where is that mindlessly writing over and over code? I have even gone through the trouble of trying to see the problem from your perspective, by looking at ModelViewSet and ModelSerializer where if you squint really hard you could maybe make a case that it is repetitive, but in code that is object oriented, you can’t just say that “oh inheriting from some big class that does 98% of the actual implementation is boilerplate” - because literally all you are doing is inheriting from ModelViewSet and setting three whole fields that are specific to your model. Is three lines boilerplate, when they determine how the entire class behaves and if it works or doesn’t work? I would argue not.
Ah, here we are again. Now you passive aggressively say that I’m just stupid. So, now, who is doing the “low effort trolling” that you claim anyone who disagrees with you does?
The point is that the LLM can produce 90% of the code here, and then you might need to tweak a couple of lines. Even with your changes, there’s still very obviously a non trivial amount of boilerplate, and you just can’t bring yourself to acknowledge this fact.
Where?
Where is the boilerplate?
That whole code is boilerplate that I originally generated using an LLM from the following query
write a django endpoint for handling a json payload with user information and storing it in the db
. After you making it concise, it’s still over 40 lines of code.Three thoughts.
Firstly:
write a django endpoint for handling a json payload with user information and storing it in the db
And yet this LLM failed to consider just using the built in
contrib.auth.User
which already stores this information. What about extending the Auth user model?Secondly:
This means that any of this supposed “boilerplate” (you are not even using the right term, more on that in a second) is just AI slop that doesn’t even do a half decent job of what you have been arguing, around getting rid of “boilerplate” that is inconvenient. It is the LLM itself that is creating all this supposed boilerplate!.
Thirdly:
I don’t understand what you think “boilerplate” is. Because 40 lines of code where you define a model, the fields that are serialized through the REST API, and the REST API implementation is not boilerplate. Boilerplate is defined as “sections of code that are repeated in multiple places with little to no variation.” (Wikipedia). Where is the “repeated in multiple places” in this example? If we even took this example further and extended it to other
model
s - where would the duplication be? The fact that you inherit fromModelViewSet
? That you inherit fromModelSerializer
? There is no boilerplate here! If anything the boilerplate is insideModelSerializer
andModelViewSet
, but that’s object oriented design! You’re inheriting from those classes so you don’t have to do it yourself!.It’s boilerplate because it’s just lines of code that are spelling out a repetitive pattern that you end up having to mindlessly write over and over. The fact that you continue to refuse to acknowledge this blows my mind to be honest.
And again, I ask you, where is that mindlessly writing over and over code? I have even gone through the trouble of trying to see the problem from your perspective, by looking at
ModelViewSet
andModelSerializer
where if you squint really hard you could maybe make a case that it is repetitive, but in code that is object oriented, you can’t just say that “oh inheriting from some big class that does 98% of the actual implementation is boilerplate” - because literally all you are doing is inheriting fromModelViewSet
and setting three whole fields that are specific to your model. Is three lines boilerplate, when they determine how the entire class behaves and if it works or doesn’t work? I would argue not.I’m sorry, I should not assume that this sort of code does not require a significant cognitive effort to write from some people.
Ah, here we are again. Now you passive aggressively say that I’m just stupid. So, now, who is doing the “low effort trolling” that you claim anyone who disagrees with you does?
Incredible.
So which is it, is this code that’s meaningful and interesting to write that requires cognitive effort from a human, or is it boilerplate?