News for hackers. Stuff that matters.
Re:Matrix.org hacked by dmos62 on Friday April 12, 2019 @05:04AM (#19643245)
I do cat x | grep y, because that way you separate out the primary data being passed around and the secondary instructions for how to process it. Preferring functional programming, this is my bread and butter. It´s superior readability and simplicity is something that gets engraved on the inside of your mind after you do a pipe a few hundred times per day every day. This is not about being terse, terseness is almost never a factor.

  (->
  ¨log.txt¨
  read-to-string 
  ´(prepend ¨\n¨)
  ´(prepend ¨piping¨)
  lines-to-strings
  first
  ´(= ¨piping´)
  )
To think of writing (read-to-string ¨log.txt¨) in the above pipe is wrong. Might as well load on more functions on the input line:

  (->
  (prepend ¨piping¨ (prepend ¨\n¨ (read-to-string ¨log.txt¨)))
  lines-to-strings
  first
  ´(= ¨piping´)
  )
The simple principle that emerges is that the first line is for input, not for applying functions. You might guess that someone who does this even in a pipe as simple as cat x | grep y has this muscle memory too, but someone who criticizes it, certainly doesn´t. Maybe that´s not a bad thing, but you do feel a large divide between each other.
Re:Matrix.org hacked by yjftsjthsd-h on Friday April 12, 2019 @07:52AM (#19643950)
I'm fond of this bashism: `<myfile command | command | etc`
Re:Matrix.org hacked by jwilk on Friday April 12, 2019 @08:41AM (#19644242)
This is portable syntax, not a bashism.