Back writing in my website.

  • thingsiplay@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    18 hours ago

    I think this solves an issue, that’s not an issue at all and makes it more complicated and harder to read. What do I mean by that?

    It requires more text and exact correct syntax of multiple elements. It makes it harder to see where the start and end is, and one has to look for any lines that could potentially be a comment in a heredoc. The syntax highlighter does not show this in comment color. Bash still executes those lines to read the “comment”, as it thinks its normal code. In example variables can still be expanded in heredocs. Other tools removing comments from script to count lines would be fooled too.

    Compare this to a single hashtag symbol in the beginning of each comment. That’s all. This is also good practice everyone understands. From practical point of view, why would anyone use heredocs for multi line comments over single line comments?