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

You probably wouldn't send "hlcrkorluatnsuh" either. But using that to represent "no error" would still be a bad idea.


I don’t understand what the structure you’re proposing is. There are a lot of ways of doing form validation. Typically you’ll have field levels errors and form level errors. In those cases, the no error state is represented by an empty list. I have never seen errors represented in a way that null means no error but blank string means unknown error. That would be a weird way to represent it.


Incidentally, the JS DOM represents no error on an input element as a blank string, not null: https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectE...




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

Search: