News for hackers. Stuff that matters.
Re:John Carmack on Inlined Code (2014) by Roboprog on Tuesday July 19, 2016 @12:53PM (#12122886)
Best of both worlds in Javascript. Use "IIFE" to make an anonymous function and call it. The editor lets you elide the function if you don't want to see the details, or leave it "open" if you want to read it.

If it turns out said little dance needs to be done twice, instead, assign the function expression to a name (in an appropriate scope) and call it twice.

Nested funcs/procs in Pascal were useful for this kind of local partitioning, as well (before C; C++; Java came and peed in the development mindshare pool), even if you couldn't make closures out of them.

There are no comments on this comment yet.