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

> you are trying to open a file for reading. The file does not exist. Is this exceptional?

It's actually handy to have an API that includes both situations. For example, parse and tryParse in C#. Parse will trigger an exception if it fails but tryParse will not. When used in your code, this actually documents what the programmer is expected. If an open and tryOpen operations existed, you would know whether or not the programmer expects the file to exist or not.



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

Search: