Hacker News new | ask | show | jobs
by OptionOfT 67 days ago
Yesterday I had it get the length of a word in characters by doing `word.len()`. In Rust. In 2026. Using Opus.

This again showed me that I can't go in YOLO mode. Things like this are disastrous if left to fester in a codebase.

1 comments

Eh… I get what you’re saying but the word “character” is super overloaded. C uses “char” to mean “byte”. Rust uses it to mean “Unicode scalar” (which still isn’t a user-perceived character.) The meaning that corresponds to “where should the caret move when I press the arrow keys in a text editor” turns out to only be meaningful in a tiny set of circumstances. The vast, vast, vast majority of the time, it doesn’t make sense to think about “characters” at all, and it’s just bytes you need to account for. I’m generally with you on AI needing serious review from knowledgeable humans or it can be a disaster, but “it misunderstood what I meant by characters” smells a lot more like you were unclear in your prompt.
That's the thing. I didn't ask it about how to get to the width of the string.

It came up with a plan and I tried it.