Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

...aaand if you actually think this through you will just come to the conclusion

  - piping isn't anything special, its just an operator
  - piping has like 10 different things you need to account for, just a bunch of stuff is chosen FOR you (heuristically) in the shell. for example IFS. whether its correct for a given pipeline is an entirely different question
  - any form of error handling in a pipeline is a syntactic disaster mostly because shell syntax completely sucks
  - every second program in the pipeline will literally just execute code from the input until you figure out the secret option to make it not do that anymore
  - data has a structure, whether you think it does or not. whenever you fail to account for all possible cases (doesn't help that these tools mostly don't have any specified format) of that (such as in most shell scripts), you are opening holes for bugs. both sides of the pipe must use the same data structure (and since its shell that means encoding it to text which changes depending on your locale and encoding).
  - for most cases you don't even need pipes:
  a = f()
  g(a)
  or just g(f())
  piping is just premature optimization like lazy evaluation. composing functions is actually simpler, just shells have no (good) way to do it.


What's important to me is that I can feed a huge amount of data generated by one process into another process without ever having to write it to disc.

This is important in a practical rather than theoretical way.

As for structured data......lines of ascii is more that useful enough a great deal of the time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: