News for hackers. Stuff that matters.
Re:How to avoid the assignment statement by loup-vaillant on Monday July 12, 2010 @04:11AM (#1507176)
Thank you for your feedback, I will amend my entry.

> "Make functions, not procedures" --> "Don't check for errors. Don't even make it possible to check for errors."

I will make my tutorial clearer on this point: errors can be embeded in results. Option types can do wonders. Of course, this is not easy to do in C.

My opinion is that programming in C means either dealing with legacy code, seeking utmost performance, or being nuts. I think that leaves plenty of room for reasonable programming. I never said that my assertion is valid in all circumstances. Actually I agree with you here. But I would be extremely surprised if my advice couldn't be followed by most programmers, most of the time.

Re:How to avoid the assignment statement by mfukar on Monday July 12, 2010 @04:44AM (#1507233)
"Of course, this is not easy to do in C."

Actually, it's quite simple. The issue is that debugging becomes a bitch, and error codes are hidden even from the developer inside nested function calls - ie. you can't stop/recover from errors right away.