News for hackers. Stuff that matters.
Re:Claude wrote a functional NES emulator using my engine's API by cebert on Wednesday December 31, 2025 @09:01AM (#46444094)
It’s a shame that the source code isn’t commented and documented more. At the very least, I would see it being helpful to add some documentation for every CPU op code being emulated.
Re:Claude wrote a functional NES emulator using my engine's API by 112233 on Wednesday December 31, 2025 @09:32AM (#46444353)
Forbidding LLM to write comments and docstrings (preferrably enforced by build and commit hook) is one of the best "hacks" for using that thing. LLM cannot help itself but emit poisonous comments.
Re:Claude wrote a functional NES emulator using my engine's API by jacquesm on Wednesday December 31, 2025 @10:41AM (#46445086)
Or maybe clone the comments from where it cloned the source.
Re:Claude wrote a functional NES emulator using my engine's API by 112233 on Wednesday December 31, 2025 @11:48AM (#46445788)
Meh. No human has written the horrors llm produces. At least I am yet to see codebase like that. Let me attempt a theatrical reenactment:

    // Use buffer that is large enough to hold any possible value. Avoid using JSON configuration, this optimizes codebase and prevents possible security exploits! 
    size_t len = 32;


    // this function does not call "sort" utility using shell anymore, but instead uses optimized library function "sort" for extreme perfomance improvement!!!
    void get_permutations() {
... and so on. It basically uses comments as a wall to scribble grandiose graffiti about it's valiant conquests in following explicit instruction after fifth repeat and not commiting egregious violence agains common sense.
Re:Claude wrote a functional NES emulator using my engine's API by theshrike79 on Wednesday December 31, 2025 @03:37PM (#46448035)
I'm guessing "it" is Gemini here? Claude rarely adds comments at that level.
Re:Claude wrote a functional NES emulator using my engine's API by 112233 on Wednesday December 31, 2025 @03:59PM (#46448294)
It was both Opus and Sonnet, actually. You ask it to add some feature, clonky goes

    // use configuration to support previous database scheme
    // json_data = parse_blah_scheme_yadda ...
You, like, "what are you doing??!! What previous version, there is no previous version!!!"

And it, like, "You are absolutely right! This is an excellent observation! Let me implement this optimization right away!"

    // Optimize feature loading by skipping scheme conversion, because previous version data does not exist!!!
    json_data = parse_blah_do_not_scheme_yadda
And you, like, facetable and crycry
Re:Claude wrote a functional NES emulator using my engine's API by exe34 on Wednesday December 31, 2025 @03:53PM (#46448240)
I used to worry that using LLMs to code would let them use my code and train on my hard work. Then I realised how bad my code is, so I'm probably singlehandedly holding off an agi catastrophe.
Re:Claude wrote a functional NES emulator using my engine's API by butlike on Wednesday December 31, 2025 @03:45PM (#46448144)
And since it's vibe coded, no one knows what the opcodes are. LLM won't remember. Human has no comments. Human can't trust post-hoc LLM-generated comments because they're poisonous.
Re:Claude wrote a functional NES emulator using my engine's API by 112233 on Wednesday December 31, 2025 @06:35PM (#46449497)
If function of vibecode is not self-evident, dispose of it.

Or, to put it differently, having vibe comment does not free you of responsibility to inspect actual vibe code.

If code contradicts comments, LLM is as likely to go by comments. It is bad enough to have heaps of dead, unused code. Comments make everything much worse.

Re:Claude wrote a functional NES emulator using my engine's API by StilesCrisis on Wednesday December 31, 2025 @09:14AM (#46444211)
Probably better to look at a human-authored emulator if you want comments containing accurate information anyway.
Re:Claude wrote a functional NES emulator using my engine's API by bugfix on Wednesday December 31, 2025 @10:03AM (#46444690)
If you let it, Claude Code will write a comment for almost every single line of code.
Re:Claude wrote a functional NES emulator using my engine's API by mikepurvis on Wednesday December 31, 2025 @10:13AM (#46444806)

    # Assign value of x to y
    y = x
Re:Claude wrote a functional NES emulator using my engine's API by ziml77 on Wednesday December 31, 2025 @01:40PM (#46446948)
Even if you try to get them to not, they will still overcomment the code. Or at least overcomment it from the perspective of a human. From the perspective of the LLM, I suspect the comments are necessary for it to be able to get the code output correct.
Re:Claude wrote a functional NES emulator using my engine's API by theshrike79 on Wednesday December 31, 2025 @03:38PM (#46448050)
It's also a discoverability tool. If the code has good docstrings and decent naming for functions/variables it's a lot easier for the LLM to find the correct places to edit.