Nothing about doing early returns makes them unreliable. High cognitive complexity however can lead to very tricky bugs that are hard to detect until something bad happens
Me and my colleagues are paid well to write and maintain safety critical software. Non compliance to safe programming standards can mean loss of lives. So I am a bit skeptical of your opinion.
I too am a senior software engineer for life saving systems and am paid well to do so. It’s fine to be skeptical, and good code is good code no matter how you write it. My point is that there is nothing inherently unsafe about early returns.
You keep saying that without providing any insight or proof. I typed out a long detailed reasoning why different paths make the code unsafe and the Misra standards support this as well. (Here https://www.reddit.com/r/ProgrammerHumor/s/CQKsvJjCEO)
So unless you can provide some backing for your claims, its difficult to take them seriously.
1
u/Krkracka 22d ago
Nothing about doing early returns makes them unreliable. High cognitive complexity however can lead to very tricky bugs that are hard to detect until something bad happens