Document using bool args as an anti-pattern in AGENTS.md#6174
Conversation
|
LGTM |
Co-authored-by: Dan Lapid <dlapid@cloudflare.com>
|
Maybe it's just me but is this worded too strongly? I know we've introduced WD_STRONG_BOOL to avoid having consecutive boolean arguments, but never using them feels like it will be overkill. |
|
I guess another concern would be the agent taking issue with code changes to functions that use bool or moving code that uses bool – the agent could see bool being used and raise concerns even though the usage of bool is not increasing. |
|
I think never using them is fair, it's important we have strong typing in all cases. I don't think agents should touch existing code that uses bools unless you ask it to. If it does though then we can reconsider this prompt. |
I agree, I suspect we'll need to relax it to something like, "you can use at most one bool parameter". But let's see how it goes. I think my perfect world would be, "functions may have at most three parameters, and they must all be different types." That's about all my brain can handle. :) Edit: Another little worry I have is that we don't (yet) support defining strong bools in class scope. So, any private helper function in a class would have to use a publicly-defined type. Not the end of the world, but also not great. I have a branch to relax this constraint but couldn't decide how strongly I felt at the time. |
No description provided.