Please help with finding the language in which there is a syntactic difference between the definition of the comment at the beginning of the line and the definition in the middle of the line?

  • one
    that is, what would these two types of comments look differently? - KoVadim
  • Yes, I meant it. So that for them was a distinguishable symbol identifier. Well, or a small transformation, but the same symbol (that is, a doubling, or a premium or something like that). - Ilya.K.
  • one
    in the good old BASIC like this was. The comment at the beginning of the line was indicated by the REM operator, and the comment from the middle of the line to the end - by a single quote. - KoVadim
  • Here I also remember, in childhood I played with him. Recheck. Thank you. - Ilya.K.
  • one
    Theoretically, in Fortran a comment was determined by C at the beginning of the line, but in addition a comment was allowed from 73 to 80 positions. Without C , but without some other character. This does not count? :) - Harry

3 answers 3

Vb6

At the beginning:

 Rem я комментарий ' я тоже комментарий 

And in the middle - only such

 ЯКакойТоКод ' а я комментарий 

Javascript for browsers only (ES6, Annex B)

At the beginning of the line:

 // Комментарий <!-- тоже комментарий --> и это - тоже 

In the middle - just like this:

 doSmth(); // комментарий doSmthElse(); <!-- тоже комментарий 

 with(new Proxy({}, { has() { return true }, get(obj, key, proxy) { return console.log(String(key)) } }) ) { ЭтоКод <!-- и комментарий <!-- а вот это - не код --> как и это НоВотТут --> СноваКод // А так - нет КакИТут // тоже можно } 

    In Fortran, this was (after all, the “any language” was declared :) ), for example:

    • C - A comment starting with this character could be located only at the beginning of a line;
    • ! - A comment starting with this symbol could start from any position.

      All trite Java

       int a = 1; int b = 2; //int c = 3; if (a < b /*&& b < c*/) { //TODO: } 

      Did I understand you correctly?

      • one
        comment /* */ can be used at the beginning of the line - KoVadim
      • I answered to the comments Vadim clarified. - Ilya.K.