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

You can ignore an error in Go simply by ignoring its return value. Sometimes it's difficult to tell a foot-gun and land-mine apart.


you can swallow an exception in java by simply having an empty exception case.

Exceptions are certainly more robust, but purposely ignoring errors can be done with exceptions too.


Ignoring errors silently, regardless of intention, can't be done with exceptions.


    try {
        // do stuff
    } except( Exception e) {  
        // ignore
    }

and yes, I've seen it often.

I will agree that it's not possible to accidentally ignore an exception, since it will likely crash your application.


That's not silent, it's screaming in the code.


that's only if you find it in the code


I thought we were talking about code though.




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

Search: