lainchan / Ω

(untitled)

Crazy Jake · 2023-08-27 11:58
There is literally not even one reason to need to parse a string ever, unless your OS is broken. Everything should always be conveyed as a struct. Any "convenient" form of string parsing is broken by default unless the user goes well out of his way to make it handle all the edge cases. A most common example being just splitting on some delimiter and not taking escapes into account. That's already broken and if malicious input is involved now fields can be spoofed and data corrupted. In the best case, parsing a string just gives you what is had by default with structs, but with much more work and ugly code.