News for hackers. Stuff that matters.
Re:The C++ standard for the F-35 Fighter Jet [video] by zahlman on Monday December 08, 2025 @12:21PM (#46194949)
> And they're correct. In most modern languages it's fine. The "no early returns" rule does not apply to Java, TypeScript, C#, Rust, Python, etc. Because these languages specifically made early return habitable.

Early return is perfectly manageable in C as long as you aren't paranoid about function inlining. You just have a wrapper that does unconditional setup, passes the acquired resources to a worker, and unconditionally cleans up. Then the worker can return whenever it likes, and you don't need any gotos either.

Re:The C++ standard for the F-35 Fighter Jet [video] by SideburnsOfDoom on Monday December 08, 2025 @12:27PM (#46195020)
> In C, you just have a wrapper that does unconditional setup, passes the acquired resources to a worker, and unconditionally cleans up. Then the worker can return whenever it like

Right, so you allow early return only in functions that do not have any setup and clean-up - where it's safe. Something like "pure" functions. And you describe a way to extract such functions from others.