Hacker News new | ask | show | jobs
by sarvagyavaish 683 days ago
“Claude’s Artifacts and ChatGPT’s Data Analyst have become my go-to solution for quick prototypes and single-use code, instead of Jupyter notebooks.”

This is so true! I was debugging a timing issue and printed a bunch of raw data in the terminal. It was super helpful to have Claude generate throwaway code to plot the data with python. Zero data cleanup and formatting needed from my end for the prompt to be successful.

I also find myself less attached to code AI writes for these mini “apps” or “utils” because I’ll never check them into the codebase. If I wrote it myself, I’d probably spend time cleaning it up and write some comments hoping I’d use it again in the future.

1 comments

Would take a few seconds to clean up or add comments anyway with Claude if it didn’t do it already automatically
Do you have an example of such comments? Maybe I'm wrong but I get the feeling that AI-generated comments would be mostly along the lines of beginner-level comments:

  // Don't do this if there's more than 1
  if (foo.length <= 1) {
    foo.bar;
  }
Comments which are helpful usually explain why something is done. That's usually to accommodate specific business rules which the AI isn't likely to know about at this stage.

  // This is due to a change Accounting requested because ...
  if (foo.length <= 1) {
    foo.bar;
  }
Have you tried it? It is very good at explaining and commenting code — better than my comments.
Admittedly, I've not tried it which is why I'm curious. I would expect that it's good at explaining well-studied algorithms but anything that's following more-or-less bespoke business rules seems like a different beast.

Again, I could be wrong; e.g., a banking application might have certain regulations it needs to follow making non-computer-technical reasons for certain things to be done. That would be a good candidate for a "helpful" comment which would be reasonably AI-generated. (Although, perhaps not a good candidate for an LLM-generated application.) The example of "our specific business wants this for reasons" is one that I think LLMs would struggle with unless that's included in the context window. Of course, that's also possible; not sure if that is presumed.

It’s 2024. It’s free to try. Try it out. It’s astounding.