News for hackers. Stuff that matters.
Re:A case for Go as the best language for AI agents by wakawaka28 on Monday March 02, 2026 @04:08PM (#47224098)
Unit tests in the same file wastes context and makes the whole thing hard to navigate for humans and machines alike.
Re:A case for Go as the best language for AI agents by dnautics on Monday March 02, 2026 @04:15PM (#47224168)
nah, the agents jump around files anyways.
Re:A case for Go as the best language for AI agents by J_Shelby_J on Monday March 02, 2026 @04:21PM (#47224258)
I’ve been doing the least amount of unit tests possible and doing debug asserts instead.
Re:A case for Go as the best language for AI agents by 0x3f on Monday March 02, 2026 @06:30PM (#47225793)
Normally I would put as many invariants in the types as possible, then tests cover the rest. I'm curious how you do this/what you use it for though. Would be cool if you had any examples.
Re:A case for Go as the best language for AI agents by jimbokun on Monday March 02, 2026 @06:11PM (#47225602)
It’s about the best possible documentation.
Re:A case for Go as the best language for AI agents by wakawaka28 on Monday March 02, 2026 @06:36PM (#47225855)
It isn't documentation. It is example code, in the best case. That shit belongs in other files, not in the main file. There is also a reason why literate programming never took off in general. Good luck getting anything done when 80% (conservatively) of the stuff you have to scroll through contributes nothing to the actual execution of the program and might actually be giving you false impressions of how things need to be done.
Re:A case for Go as the best language for AI agents by g947o on Tuesday March 03, 2026 @06:47AM (#47231052)
I have yet to see a single Rust file where the test comes before source and takes 80% of the file content.
Re:A case for Go as the best language for AI agents by wakawaka28 on Tuesday March 03, 2026 @09:25AM (#47232822)
Probably because all the tests are trivial, and people have the bias to not add all the testing that is needed inline with the code.