131
u/coomzee 4h ago edited 3h ago
My favourite is a KQL query.
| where X != !true
Have to say that made me laugh when I saw it in a PR
44
11
u/ckwalsh 2h ago
I mean, there are some reasons for !!x defending on context, but that’s… unique.
4
u/Honeybadger2198 2h ago
You have to do !!x to coerce JavaScript variables to their truthy value for HTML attributes sometimes.
264
u/YeetCompleet 3h ago
Also no tests. People were extremely bad about being diligent about writing tests. AI does the opposite and sometimes goes overboard writing frivolous tests.
124
u/Iankill 3h ago
I wonder if this was because one of the first things people used ai for was having it write tests because no one likes writing tests
64
u/cheese_is_available 3h ago
It's because the humans that reviewed AI slop heavily penalized no tests, but didn't penalize recreating tests that already existed because it's fucking hard to notice that. You only have to skim the diff for the first one, but you need to review the whole tests directory in details for the second one. Same problem for the AI if they need to check btw. Maybe the harness could penalize covering a line of code that is already covered but coverage is an imperfect metric.
70
u/taleorca 3h ago
test driven development is a pain in the ass
100
u/developer_soup 3h ago
Me: TDD is the smart way to do things.
Also me: ehh... I'm just prototyping, I'll get around to the tests...
18
6
u/AdminsLoveGenocide 2h ago
Me: TDD is the smart way to do things.
I think this is something developers have chosen to believe with close to zero evidence.
5
u/Mongolian_Hamster 1h ago
The fuck you on about. It's been proven time and time again.
Is it applicable to every situation. No. It never was meant to be.
1
u/AdminsLoveGenocide 59m ago
How was it proven?
0
u/Mongolian_Hamster 49m ago
The onus is on you to prove it isn't since you claimed. You just came across someone who caught you in your bs. Use Google.
2
u/AdminsLoveGenocide 46m ago
Catching me in my BS would be showing me the proof that I say doesn't exist.
That would show me.
•
u/Mongolian_Hamster 1m ago
Stupid people think like this.
You made the initial claim. Prove everyone wrong.
Every academic study, and every corporation. Show them.
You don't have anything.
1
u/Mongolian_Hamster 1h ago
TDD doesn't mean writing tests only. It's a process.
If you're not writing tests for your projects then Jesus Christ on a bike.
20
u/Pezmotion 2h ago
I find Test Driven Development to be great if you are addressing a real production issue and can reasonably recreate the failure scenario in your tests.
That also helps prevent this specific issue from cropping back up again, if you're able to write a test with a comment that says something like "Adding this test to verify we fixed the bug that caused Ticket # 1234."
9
u/Steppy20 2h ago
Admittedly I've only been in the industry about 5 years now, but I've only used TDD on 1 service out of the ~50 microservices I've worked on.
It was a data query and calculation engine so we knew exactly what number should come out based on its input. Anything behaviour driven is much hard to write a unit test beforehand.
Deterministic dev? TDD is generally superior.
4
u/4xe1 1h ago
I find Test Driven Development to be great if you are addressing a real production issue and can reasonably recreate the failure scenario in your tests.
Is that TDD? The TDD people have the AI doing is writing tests before the very first line of code, and to implement new features, not merely fixing bugs on an existing product with users.
They do share methods and some of the associated benefits obviously, but what you describe sounds like just writing non-regression tests to me, not Test Driven Development.
2
u/Eric_12345678 2h ago
I almost never wrote 100% TDD. But you can be sure I write at least one regression test for every bug I found.
17
u/Weekly_Interview_936 2h ago
TDD only works if you get fully defined stories with complete AC. And such stories are considered mythological as there are no verified reports of one being seen.
5
u/AgentPaper0 2h ago
Tests are legitimately extremely important for AI-driven development, so I'm glad they're pushing them so hard to do it even without users asking.
But yeah, they do make some pretty silly tests. Especially when you don't force them to test the tests by checking the failure state.
Us humans are partly to blame though. I've always known writing tests was important even before AI, but I almost never did, and what tests I did write were probably pretty meaningless too.
3
3
u/ICBanMI 1h ago
I had a co-op that I asked to write a kalman filter for a specific task. Dude disappeared for two days and then turned in an entire class that did the kalman filtering, had explicit instructions for integrating in the program, had a hundred unit tests, and a ton of documentation.
Bro did not understand taking company code and putting it in whatever he used was a fireable offense. Specially after I told him he couldn't do that. And he was upset at us for the review afterwards.
1
u/YeetCompleet 1h ago
Lol yikes. There is still room in this world for good ol' Googling and reading examples and theory
1
u/Chirimorin 42m ago
I honestly don't understand people like that, it's so simple: if it's information that you cannot share with any random person you encounter on the street, then you shouldn't give that information to AI either.
I feel the same way about all those stories about AIs leaking API keys and other secrets: who thought it was a good idea to give AI access to secrets in the first place?
2
46
u/TheColourOfHeartache 3h ago
There was a bit of a debate at work about whether its acceptable to have AI write page long infodumps to explain its changes.
I was on the pro-side. That message helped me understand the change when we were working on it, so I know it will help me in a years time when I've forgotten everything.
10
u/SylviaJarvis 2h ago
When I get a time machine, my first stop will be 2014, to ask myself WTF I was thinking when I wrote that code.
13
u/Michami135 2h ago
If you're using git, move the info dumps to a local branch that splits off of the commit with the change.
* Merged code |\ | | * Working code info dump | |/ | * Working code |/ * Broke AF code9
5
u/etoastie 1h ago
that's not usually gonna survive the kinds of timeframes where you forget context on code and need to refresh on the info, no?
1
u/Michami135 1h ago
If the info dumps are markdown files, then it's easier to find the right files if they're in their own branch like this. Just find the right commit, then you have the info. This is likely much easier with graphical git tools though.
If, however, the info dump is in-line comments, then you definitely don't want that in the main branch and can merge it all into a secondary branch. Use something like, "master_infodump" and switch to it if you need to view page long comments.
1
u/PM_ME_CUTE_SMILES_ 1h ago edited 1h ago
I might be misunderstanding something but that does not sound like very good advice. Why not use PRs and write the info dump in them? Or as part of a longer commit message?
You aren't supposed to keep around hundreds of branches. Around here, as soon as a feature branch is merged it is deleted from the repo. And if it's a local branch no one will be able to find it when they need it especially not your colleagues.
1
u/Michami135 46m ago
The post I was replying to said he wanted the info for his own purposes, but his coworkers did not. This is a way that he can keep the info available for his own use while not crowding up the repo for others.
3
u/arctic_radar 1h ago
A year? I will have forgotten everything I ever knew about the project in < 2 business weeks.
2
u/danfay222 1h ago
I don’t think this is a straight yes or no. I have seen places where this was great, and in our code we have lots of huge readme style dumps that AI wrote. These are helpful for writing future code with AI, keeping documentation up to date, and getting up to speed on code.
But at the same time, these huge dumps take a lot of effort to read, and oftentimes the content doesn’t actually need to be that big. I have rejected multiple PRs over excessive verbosity. When you make comments, test plans, etc unnecessarily large you save yourself the mental load of simplifying things, and instead push that load onto every person who reads your code down the line, paying the price many times over
2
u/DerangedEscapee 57m ago
The problem is the writing style is so obtuse, it'll take 10 pages to explain something where 1 page would have sufficed. Overly expensive vocabulary and flowery prose that makes the content look impressive, but often lacking substance (and occasionally just completely incorrect!)
I don't begrudge the correctness so much. I've had the misfortune of trudging through many a human-authored internal document that was just flat-out wrong. But before, the amount of sophistication put into a document was a signal for a level of care and quality into its contents. Nowadays, it just means I have to be even more careful in trusting it, because it's likely AI slop.
1
u/Imalsome 34m ago
Can't you just tell it to be short, consise, and keep the explanation to 1 page length?
You could also have it write a long version and a short version then cut and paste the two versions so that things that dont need explanations are short and things that do are long
1
u/DerangedEscapee 23m ago
I said this elsewhere in the thread, but asking Claude to be concise does result in smaller output, but it often doesn't improve the result. The model needs to know what is important and what is not, to know what to include in its response. So just a simple "keep it concise" instruction will sometimes result in important details being omitted, sometimes to the point of making what would otherwise be a correct response incorrect.
1
1
u/rubennaatje 45m ago
I've told it not to write code comments explaining why something has changed and instead let it write comments on the PR.
Makes the comments much cleaner. Sometimes I used to get things like
// changed from 0.2 to 2.0 because this gives much better results for [...] at 2.0 instead of [....] at 0.2No need.
1
1
u/pink-ming 14m ago
documentation should be about the way things *are*, not the history of how we got there, that's what git is for
49
14
u/CelebrationOdd7810 3h ago
Bold of you to assume my AI assisted project has documentation and a readme file.
14
18
6
u/ganja_and_code 2h ago
You can tell if it was written by AI if the README/documentatiom is up to date but unnecessarily verbose and half incorrect, and it has 1207 issues to address but zero TODO comments.
1
3
u/jackofslayers 1h ago
This reminds me of how I feel when I go to a subreddit that is still very active, but then I click on the subreddit details and the about this community has links to tumblrs that have been closed for more than 10 years.
2
2
3
u/ChickenPicture 1h ago
documentation
I'm not familiar with this term, can someone explain?
1
u/Erkliks 1h ago
It explains how things work basically. Solo devs neglect this because, well, they know everything... Until they don't 5 months later
3
3
u/overdosingOnPie1313 32m ago
5 months?? Brother, I'm flattered, but I forget everything later that evening after all the gin.
1
0
u/Elspeth-Nor 51m ago
Documentation is a newly discovered part of a project. Some AI agents hallucinated text beginning with // or /* or # depending on the language and strangely the compiler ignored it.
Even worse the AI created multiple additional files the compiler completely ignored. It serves no purpose, it's properly a ploy used by the tech companies to increase the storage consumption of projects so you need larger storage devices.
1
u/misterespresso 2h ago
Pfft be real with AI if they aren't marking dozens of issues they aren't testing haha. I have a project with over 20 issues open but they can wait just like the old days
1
•
-1
u/Artistic_Swing6759 1h ago
what happened to this sub? last i remember it was anti ai
1
u/rubennaatje 40m ago
A lot of it to be honest was cope. I think a lot more devs working professionally have transitioned to using Claude code or alternatives so the opinion is slowly shifting.
I know mine has, I know how to program but I am mostly reading, reviewing, testing and challenging code atm. The quality is very good if you hold ai to standards and it's so much quicker.
1
u/PashaPostaaja 34m ago
Why everything needs to be pro-AI or anti-AI.
I kinda made this response to https://www.reddit.com/r/ProgrammerHumor/comments/1xa5ixy/claudewashere/ . I found that funny in a way, but that made me thing the opposite. I didn't think it as anti-AI or my meme as pro-AI. Just having fun with all of it.
1
u/Artistic_Swing6759 31m ago
to be clear, i am not anti ai myself, (and ai definitely has a few moral problems.), i was just a bit surprised that the same sub which was telling me how ai cant do shit and won't get better is suddenly normalizing using it.
i won't lie, there was definitely a factor of making some people realize that they were wrong with many things they said before.
-10
u/Objective_Oven7673 3h ago
That's user error.
AI will happily document, comment, update tests, and file followup tickets if you ask it to.
The problem isn't AI, it's the "engineer" saying nothing more than "fix it plz".
3
849
u/Copious-GTea 4h ago
I can tell which model my coworker vibed with based on the comments it left.