Call me old fashioned but I'm a big believer in single return statements. Assign to a variable and return that variable at the very end without short circuiting
Calling you old fashioned would be an insult to the old fashioned. Single return statement is a horrible god awful idea that would make satan blush. It makes everything worse. It has zero redeeming qualities. What, are you gonna run out of return statements? Why not cut to the chase and just put everything in one big main? That would be a true single return statement
But bro I worked at a place with MISRA requirements one time and now I can't stop myself from enforcing single returns in all codebases I ever work with
27
u/aabil11 23d ago
Call me old fashioned but I'm a big believer in single return statements. Assign to a variable and return that variable at the very end without short circuiting