logoalt Hacker News

smallstepformantoday at 8:08 AM0 repliesview on HN

The other day I just wanted to loop through characters in a std::string to copy data to a new string with a few escape characters (sending to peripheral device). Simple enough task for AI. I got a coroutine monstrocity back, with copies to std::array and a range based iterator, since I specified C++23. If I specified C++11, I would have received a: char p = src.data(); while (p) { … p++; }

I had the experience to keep calling out AI to simplify and downgrade the solution to something primitive, which ended up smaller, faster, easier to maintain. Juniors with real world experience would not bother, they’ll take the first working AI result.