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

Truncating strings is a practical alternative that provides useful signal with minimal extra error handling code. Yes, in the ideal world there will be no string truncation, but if there are no alternatives in a lot of cases truncation is better than nothing.

Which of those two error messages would you rather see?

    sprintf: output buffer is to small
or

    fopen: cannot open file /usr/bin/superlong-dist-path/208277409874874/fi


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

Search: