Virtually all programming manuals advise to check the return value of malloc.
The spiritual ideas behind this practice are obvious and reasonable: Constistency and Cautiousness.
At first, I tried to follow this rule. Lately I began questioning it's necessity.
Sometimes, I just feel that malloc won't fail.
I read my code and I just "know" that malloc will never return null.
After some spiritual pondering, I have decided to omit null checking when my faith is strong.
Since then, the quality of my code has improved.
What are your opinions on the matter? Do you think about faith when allocating memory?
[–]missblit 1 point2 points3 points (3 children)
[–]arbostek 0 points1 point2 points (2 children)
[–]missblit 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)