Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Eeeeeeewwwww.

If you're using .split() to "parse" untrusted input, and not even validating it against a regex first, that's an epic fail in its own right.



What a weird thing to say. You trust a regex engine more than you trust "split()"?


I trust a generated parser more than a hand-written one. Any parsing algorithm that involves the use of split() is almost certain to be weakly thought-out and have ill-defined behavior for unexpected input. A well-written parser will never read past the first unexpected character, or at least token.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: