Never Nesting I once came across this video around a year ago, and I still think about it whenever I code. Never nesting is essentially never nesting past 3 indents (not strict at all, but as a recommendation.) As Linus Torvalds says: ... if you need more than 3 levels of indentation, you're screwed anyway, and should fix your program. void process_order ( User * u , Order * o , Payment * p ) { if ( u != NULL ) { if ( o != NULL ) { if ( p != NULL ) { if ( ! u -> is_banned ) { if ( o -> total > 0
Comment
Sign in to join the discussion.
Loading comments…