|
|
|
|
|
by optymizer
5173 days ago
|
|
"code blocks" is why they invented functions and procedures half a century ago (and even those differ only in how they return). I think people forget (or don't know) that these are all labels to jump or branch to. So your named functions, functions, lambdas, code blocks, etc, become.. well.. equivalent. Hipsters, don't confuse the young ones with your 30 ways of jumping into a block of code. Cheers! |
|
So your named functions, functions, lambdas, code blocks, etc, become.. well.. equivalent.
They can also become so lexically awkward as to be unusable. For example, one code a toy "fuzzy logic" system in Smalltalk with a handful of methods. The result looks like a 1st class member of the language, just like the control structures that are already there. (Same goes for the loops)
Doing this with named functions is going to scatter code between different functions. It's semantically equivalent, but harder to read. Write anything involved in such a way, and it becomes untenable. Blocks can make such DSLs an order of magnitude more readable.Hipsters, don't confuse the young ones with your 30 ways of jumping into a block of code. Cheers!
A good heaping fraction of hipsters don't understand what's good about code blocks.