Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
stop68678yNull: there is no data(enpty file, ...)
Exception: error while processing data(no right to read, socket closed, format error, ...) -
Bikonja23868yFormat system partition to ensure you get the point across that your function had nothing to return, regardless if whether it was because of an error or there was no data.
Disclaimer: Please don't actually do this -
<quote>"If you are tempted to return null from a method, consider throwing an exception or returning a special object"</quote> Robert C Martin Clean Code, i read this today, i haven't read the entire book yet, but it seems a pretty nice book
Return null or throw exception, that's the question!
undefined
null or exception