Hacker News new | comments | show | ask | jobs | submit login

Your example is quite telling. Catting a file may be 'useless' in a pure functional sense, but the command has extremely small overhead and aids readability, as you can read the input/output flow from left to right. This is consistent with the rest of the pipeline.

It's also easier to change the first command in the pipeline without having to step over the input argument, again more consistent with the rest of the pipeline.

To avoid the cat, one can write

    < file program1 | program2
but in practice, cat adds no noticeable overhead.

As for regexes, I personally find using POSIX regular expressions to be a bit like using vi after becoming familiar with vim. You can get by, but it's crap and there's a reason why people came up with something better. Of course, using complicated features of any language or toolkit without understanding how they work is dumb, but that's not a reason to go back to the 1980s.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact