"Parse, don't validate" through the years with C++
37 points by dwrodri 3 days ago | 7 comments
bregma 2 hours ago
Author has used LLMs to generate Java code in C++. It detracts from his point.
replyjsymolon 2 hours ago
First thought, assuming that birth year starts at 1900 is bad for a number of reasons; one of which, "process this list of authors and ..."
replyWhat about everyone born before 1900?
alpinisme 2 hours ago
It’s a contrived example. And I have to assume the author intended it to be contrived given that he also put an upper bound at 1999 in an article written in 2026 in an industry that skews young.
replyBut the pattern applies regardless of the validation logic.
Neywiny 2 hours ago
Or what if they were born after 1999?
replyIt's just a toy example not a production ready birthday validation library.
psychoslave 24 minutes ago
Assuming it is necessarily known which is the birth year of anyone assumed to have been in existence is already a big hypothesis if we go in that direction.
replyactionfromafar 16 minutes ago
Disregarding the article for a second, has anyone else had the pattern that "parse don't validate" makes sense in object oriented style, but less sense in functional style programming? Like parsing and validating blurs into each other.
reply