3 ms·
A pure function (which a lambda typically is) answers a question. It's helpful to have words describing what question it answers. The next person to read the co
by mypalmike 5y ago
A pure function (which a lambda typically is) answers a question. It's helpful to have words describing what question it answers. The next person to read the code will actually be able to read the words.
An if statement is a lower level mechanism for directing the code path within a function. If it needs a name, wrap it in a function. I often do.
- HelloNurse 5y agoControl statements rarely "need" a name, but if they are significant enough to be named they can be named by extracting meaningful and somewhat reusable functions.