News for hackers. Stuff that matters.
Re:How to Write Unmaintainable Code (2017) by badlukk on Friday August 17, 2018 @09:03AM (#17782467)
C functions shouldn't change behavior based on state, they do the same thing every time. Instead of changing a particular global variable, any variable of that type should be passed in and changed, then returned. It's good programming advice for functional languages. In OO it makes sense to make state changes in object methods, but not usually the best functional approach.

There are no comments on this comment yet.