Remix.run Logo
dexwiz 4 hours ago

Does anyone else hate reading AI summaries of code? Code can be pithy, but at least its terse compared to prose. When you add how verbose LLMs can be, I often end up reading a paragraph to explain a few lines. Or the opposite happens where the summary skips important edge cases or criteria. "You're right, X also does Y. I missed that in my initial analysis," is much too common of a phrase.

I like the idea of using LLMs to transform code into something more readable, and vice versa. I am not sure if meandering paragraphs and linear lists are the best targets.

derefr 3 hours ago | parent | next [-]

I wonder if a productive avenue might be "doing aspect-oriented programming in reverse": asking the LLM not to "summarize" the code per se, but rather to "clarify" it by transforming it into what a programming blog post would call a "toy example" of what the code is doing, by stripping out all the (non-semantic) error-handling, logging, metrics incrementing, etc — all the things that you might treat as their own "aspects" under AOP.

cmoski 4 hours ago | parent | prev | next [-]

AI summaries are great for learning which parts of the codebase are load bearing.

r_lee 2 hours ago | parent | next [-]

One thing worth flagging: summaries can provide context that is important, but you should always remember to thoroughly comb through the information in case there are caveats in the text that may act as a heads up, which is important.

SJMG 4 hours ago | parent | prev [-]

Yes, and that's a finding worth making explicit.

freehorse 42 minutes ago | parent | next [-]

That's a genuinely sharp observation.

drums8787 9 minutes ago | parent [-]

Enter the long tail of caveats

3 hours ago | parent | prev | next [-]
[deleted]
vrganj 3 hours ago | parent | prev | next [-]

[dead]

mrandish 3 hours ago | parent | prev [-]

[flagged]

FridgeSeal 3 hours ago | parent [-]

[flagged]

ranyume 3 hours ago | parent [-]

[flagged]

jbdamask 3 hours ago | parent [-]

[flagged]

pwython 2 hours ago | parent [-]

[flagged]

jnpnj 3 hours ago | parent | prev | next [-]

The "language model" aspect shows IMO, at least for someone who grew up with the material of 90s and 2000s where we describe things more in mechanical, engineering terms. When gpt4 landed it was somehow amazing to see the output, but yeah nowadays I keep skimming through the explanation. It's like an intermediate dev who has nothing else to do but create long sentences to describe what could be simpler.

jvuygbbkuurx 4 hours ago | parent | prev | next [-]

I don't like the default explanations. But I prompt for small code snippets with explanations of a problem and the solution. This is in the context of extending features, fixing bugs, reviewing new code etc. I still skim the code, but it's nice to have a somewhat thoughtful overview of the key points like database schema, API spec, algorithm or abstraction. It makes it easier to skim a large diff without feeling lost. It also quite often catches some weird choices that might slip through it not carefully reasoning about the code. For me it is hard to understand code I didn't write myself so I have landed on this workflow.

zahlman 4 hours ago | parent | prev | next [-]

I've found that I don't mind getting a lot of text back from an LLM, when I was the one who prompted it. I can easily enough let my eyes flit around in the text and figure out what I need to, and I expect that putting all that text in the context window will help with the rest of the conversation.

It's when that text gets copied and pasted into a blog, or a PR, etc. that it really galls.

o_m 3 hours ago | parent | prev | next [-]

There is a reason Caveman (https://github.com/JuliusBrussee/caveman) is as popular as it is

sourdecor an hour ago | parent | prev | next [-]

I wish LLM summary of code was put aside the actual code, like the Jasmine documentation[0].

[0]: https://jasmine.github.io/tutorials/your_first_suite

lucascdotnet 4 hours ago | parent | prev | next [-]

I'm a bit confused by your use of 'pithy, but at least its terse'. Don't pithy and terse mostly mean similar things? Here it seems like you're contrasting them. Not trying to be pedantic, apologies if it comes off that way.

jake_and_fatman 3 hours ago | parent | next [-]

"Bob can be blunt but at least he's honest." Words can have positive or negative connotations for the same notion.

card_zero 34 minutes ago | parent [-]

That's insightful! In a negative way.

superturkey650 3 hours ago | parent | prev | next [-]

I think he’s saying that’s it’s dense and _too_ full of meaning. So, while terse, it can also hide extra meaning in its density.

card_zero 32 minutes ago | parent [-]

Gnomic, then (on my mind because I saw it used yesterday, thanks flir).

3 hours ago | parent | prev [-]
[deleted]
jbdamask 3 hours ago | parent | prev | next [-]

I use AI explainers a lot in my own projects and have skills that give outputs I like. I'll even pipe the output into NotebookLM to make a video sometimes. This is actually a decent way to grok complex subsystems (YMMV).

What I don't care for is the pretty-yet-verbose HTML outputs that I see from some teams. They can be way too long and it's often the case that the engineer who made it didn't read the whole thing.

markstos 4 hours ago | parent | prev | next [-]

Right, the value is not so clear of having multiple people wade through lengthy LLM responses. Part of the value that a human in the loop adds is figuring out what's correct and important in the response and passing on a more polished result.

throwaway613746 3 hours ago | parent [-]

[dead]

cadamsdotcom 3 hours ago | parent | prev | next [-]

Your AI summary is raw output, like uncooked mince meat.

Ask for a rewriting pass! Get it to edit for word count, remove redundancies, remove run-on sentences, and change sentence structure to use active voice.

You wouldn't ship your first draft - why let AI do it?

armchairhacker 4 hours ago | parent | prev | next [-]

We need a new specification language for summaries. I think just a (pseudo?-)programming language’s API (modules, interfaces, method signatures), but more concise and descriptive than Java, maybe Haskell or OCaml minus quirks (…the academics were this close to an ideal syntax, maybe they should’ve gave up those languages’ LR parsers…)

Garlef 2 hours ago | parent | prev | next [-]

Ask for a walkthrough of the highlights (with '...' omissions so that the most important parts are quickly visible) instead of a verbal summary.

findjashua 2 hours ago | parent | prev | next [-]

You're absolutely right!

bmurphy1976 4 hours ago | parent | prev | next [-]

I hate fighting with the AI to get a good summary. Reading the good summary is great. Getting to it is the challenge.

First attempt: mountains of meta conversation and not answering the original question.

Second attempt: shorter and more concise, cuts out some of the nonsense, but terribly written.

Third attempt: goes off the rails, misunderstands what you are asking and tries pushing the work onto you.

Fourth attempt: finally something that's concise, reasonably well written, to the point and passable.

deignan 3 hours ago | parent [-]

[dead]

ModernMech 2 hours ago | parent | prev | next [-]

Yes this is why I ask the agent to summarize the code as a comic of a lizard explaining it to a cat.

jake_and_fatman 4 hours ago | parent | prev [-]

[dead]