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

I mean it's kind of a smartass answer, but—don't fail during constructors. Move all possible code that can fail into an initialize method; check explicitly for allocation failure and/or put things on the stack instead of heap when possible; consider failing hard with a stack trace or core dump over catching and processing exceptions before (likely) failing anyway.


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

Search: