Hacker News new | ask | show | jobs
by jniedrauer 1567 days ago
I may be in the minority here, but I personally prefer the "wrong answer" highlighted at the beginning of this article. Scripts are source code. They go in the repo, and they have the same standards applied to them as any other source code. I would much prefer that the code be explicit and rely on few if any third party libraries. I have go scripts that have been functioning in production for half a decade now without modification. They are as "self documenting" as any other go code, and I do not require esoteric knowledge about a third party library to re-familiarize myself with them.
2 comments

I think you are missing the point. The overarching motivation here is "Normally one would do this in bash, but I want to use go instead. Is there any way for me to do that while retaining the aspects of bash that make it good for these tasks?" And the author provides a solution. Dunno why you would do that, but not really important.
I agree. It would be much more readable if it simply had a few comments too (something that can't really exist in a 1-liner) and is infinitely flexible (ex: for each match, also make an API call).