logoalt Hacker News

AlienRobot • yesterday at 8:23 PM • 3 replies • view on HN

I wrote in my AGENTS.md "do not use chained ternary operators." I'm still waiting for it to work.


Replies

sfink • yesterday at 11:51 PM

I've found that telling agents to not do something mostly just gives them a suggestion of a way to do that thing, and the part about not doing it that way gets lost. Well, it's nicely accessible for when it apologizes for doing it.

I now try to only give examples of how I want it to do things, and hooks that complain when they do the bad thing (but still don't mention the bad thing in the complaint.)

userbinator • yesterday at 9:13 PM

I would actually prefer chained ternaries over more verbose if/else expressions with duplicated LHS, so this does go back to the argument about "taste".

➕ show 1 reply
pianopatrick • yesterday at 8:37 PM

You're better off using linting for something specific like that.