Ask HN: The importance of heredoc
I wish to ask Rubyists and Shell programmers: Does heredoc still have a place? Is it still worth its syntactic weight? I can see how it would be great for one-off scripts producing a bit of text. But I can picture a number of ways to get almost the same effect (readable one-offs producing text) in a scripting language without complicating the syntax.
(
7 comments
| on HN
)
And what's so complicated about the syntax? Even if you have never seen a heredoc before, it's generally very easy to figure out what's going on from context.
I supect you may be new to Ruby and confused by the heredoc sytnax. If so, this post has a review of some of the syntactical issues with heredocs:
http://log.gmarik.info/2007/12/rubys-here-document-heredoc-m...
Hope that helps.
Use heredoc for metaprogramming? Now I'm starting to believe in the Lisp dogma.