Back writing in my website.

    • EuAndreh@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      1 month ago

      AFAICT, not really, looks line POSIX sh at a glance. Just don’t forget to : <<'EOF' instead of : <<EOF.

      But : is arguably simpler than cat, one fewer fork/exec call plus no open(2) on /dev/null.

    • TehPers@beehaw.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      Multiline comments are a bit of an anti-pattern at the best of times.

      If you’re making this as a general statement, it varies from language to language. For example, CSS (and arguably HTML and Markdown) only supports multiline comments, and multiline comments are often used for documentation (as with jsdoc and, though only comments in the same way that heredocs to /dev/null are, Python).

      But yeah, if you actually do this in Bash, wat.

      • thingsiplay@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        1 month ago

        CSS (and arguably HTML and Markdown) only supports multiline comments, and multiline comments are often used for documentation

        Those aren’t programming languages. Because, especially in HTML, a line end does not end an instruction and is just for formatting. So single line comments would be very awkward in HTML, so they had to use multi only. And because CSS is meant to be used close to HTML, I think they opt in to the same. JavaScript in example has single line comments again.

        Does any programming language exist that supports multiline comments only without single line comments?

          • thingsiplay@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            1 month ago

            Good example, at least historical. ;-) I wonder why they never added single line comments before. I mean it took them quite a long time to do so. Languages before 1960 even had single lines too.

            Edit: BTW it was common in C to write multiline comments to have them look like single line comments too, because that’s easier to read and understand. Maybe that’s why they didn’t feel the need for, because in practical usage it could be replicated. In example as:

            /* Title
             * description
             * variables
             */
            

            This could easily be replaced by single lines as:

            // Title
            // description
            // variables
            
        • TehPers@beehaw.org
          link
          fedilink
          English
          arrow-up
          0
          arrow-down
          1
          ·
          edit-2
          1 month ago

          Both HTML and CSS (when together) are turing complete, and JSX syntax only supports HTML comments in many places.

          JavaScript having single line comments isn’t really relevant. Multiline comments are in heavy use there, arguably moreso than single line comments.

          Edit: and I should add that “programming languages” is moving the goalpost. The person I responded to didn’t qualify their statement to programming languages.

          • thingsiplay@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            1 month ago

            I don’t think that being turing complete means anything in this discussion, because it does not change what the language is for and how its used and interpreted. HTML and CSS are not instructions for the CPU, they are markup languages describing text for humans, not compiling it down to execute machine code for CPUs.

          • thingsiplay@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            1 month ago

            Edit: and I should add that “programming languages” is moving the goalpost. The person I responded to didn’t qualify their statement to programming languages.

            I think from context it is apparent that we are not talking about HTML and CSS (which you brought this up yourself, not the person you responded to). I think there was no need to specify his statement was to programming languages, by context we know it is. Also we are in Programming.dev. What context do you need more?

            • TehPers@beehaw.org
              link
              fedilink
              English
              arrow-up
              1
              ·
              1 month ago

              TIL programmers don’t write HTML and CSS.

              (I guess if all you use are LLMs to write it, maybe that’s true.)

              • thingsiplay@lemmy.ml
                link
                fedilink
                arrow-up
                1
                ·
                1 month ago

                You understand the difference between a markup language to display text with HTML and CSS, and a programming language to execute programs. Right? And this has nothing to do with LLMs. I don’t know why you are in an attacking position for no reason. I didn’t want hurt anyone, just discussing here.

                • TehPers@beehaw.org
                  link
                  fedilink
                  English
                  arrow-up
                  1
                  ·
                  1 month ago

                  I don’t know why you are in an attacking position for no reason. I didn’t want hurt anyone, just discussing here.

                  You are being excessively pedantic over a topic that has absolutely nothing to do with the discussion. I don’t know how you want me to respond to these comments.

                  As a reminder, what I was responding to was whether multiline comments are an anti-pattern, not whether HTML+CSS is a programming language.

      • FizzyOrange@programming.dev
        link
        fedilink
        arrow-up
        1
        arrow-down
        1
        ·
        1 month ago

        The fact that CSS only supports multiline comments doesn’t mean multiline comments are good, it means CSS is badly designed.

        • TehPers@beehaw.org
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          1
          ·
          1 month ago

          It means neither of those, actually, just that CSS supports only multiline comments.

          Multiline comments remain prevalent across ecosystems though (like in JS and Python). If you believe they’re bad there too, that’s fine, but the fact is that it would be an anti-pattern to go against those established standards.