<shrug/>Whatever works for you. I find that always using the block form of grep and map is a lot clearer for the compiler as well as human reader, and can prevent mistakes for more complicated expressions, at the cost of one extra character. So unless you're golfing it's probably better to stick with that.
| [reply] [d/l] |
The BLOCK form however does incur a bit more overhead since it has to do all the steps incurred entering and exiting a block. If it's done once, you're probably not going to notice it; if it's a statement you're executing each line for your 1G data file it may add up. Granted it's relatively small and may have been optimized in recent versions, but be aware of the overhead if you're looking for somewhere to shave a few microseconds off after you benchmark (of course always benchmark :).
| [reply] |
I disagree. If EXPR is simple enough, as in this case, then at least for me it is much easier to read. I'm just used to it. Of course should it grow complex enough, then it would soon become a pita, thus I would prefer a BLOCK instead. I don't have the slightest idea about the compiler - and I don't care much.
| [reply] [d/l] [select] |
grep length,
Is better, because we don't want extra spaces for empty lines | [reply] [d/l] |