Hacker News new | ask | show | jobs
by junke 3479 days ago
The example is not really interesting, because as you said there is already a simple structure. But programming with text becomes really tiresome after a while. For example:

    git blame -L ${LINE},+1 --porcelain ${FILE} | sed -n '/^author / {s/^author //; p}'
I would rather:

    (name (author (first (git blame file :line line))))
... where git blame returns a sequence of "blame" data for which I can retrieve the author easily (if you prefer pipes over function composition syntax, use threading macros). Then I don't have to worry about strange characters crashing my scripts randomly. Suppose I forgot to add the "^" symbol in my regexp (I can assume this, since you assume people forget parentheses), there could be situations where I would match too many lines.