Why are interpreted / scripting languages ​​rarely have multi-line comments?

Of the interpreted languages ​​that I know (Python, Perl, R, bash), multi-line comments seem to be usually related to the misuse of another language function (e.g. multi-line strings).

Is there anything inherent in the type of parsing that interpreters do that makes multi-line comments difficult? It does not seem to be very different from, say, multi-line strings.

+5
source share
6 answers

In truth, I'm sure there is no point in implementing any form of multi-line comments (based on the methods that most parsers use to read / execute a script). In my personal opinion, scripts require multi-line comments most of all because of distribution and explanation (most high-level languages ​​are usually compiled, and only a percentage of it is open anyway). I know that Lua, a scripting language, provides multi-line comments:

--[==[
COMMENT
]==]--

I am sure that it is just a coincidence that many languages ​​do not support this. It is generally accepted to simply use single comments to create a multi-line comment.

//*****************************************\\
//**                                     **\\
//**            JOHN SMITH               **\\
//**        COPYRIGHT 2008-2011          **\\
//**                                     **\\
//*****************************************\\

(ASCII ART) ( , , // /).

+1

, , . JavaScript, Groovy, Lua, PHP, REXX, Smalltalk Dart .

+1

Python .

?

0

. , Ruby .

, . . ( , / , .)

, . , . , ?

0

, . C c-esque, .

. , , , , lang . .

0

.

, "/ ". . (, Fortran, Lisp) (, Perl, Python).

, " ". , , - , , . , Python , , , no-op, . Perl Pod - ; , =pod … =cut ( , <<'EOF'; … EOF, ).

0
source

All Articles