News for hackers. Stuff that matters.
Re:Trying New Programming Languages Helped Me Grow as a Soft... by Izkata on Monday October 17, 2022 @01:27AM (#33230047)
Cargo-culting from C where you have explicit malloc() and free(). Best practice was to have only 1 return to ensure free() was always called on everything just before the return, so you wouldn't have a memory leak if one was missing from an early return.
Re:Trying New Programming Languages Helped Me Grow as a Soft... by synthc on Tuesday October 18, 2022 @02:49AM (#33243835)
I was wondering where this 1 return practice originated from, but yeah, it makes sense in that context.