(Corrected the email address to scala-debate)
> Although you will agree that learning the line comment syntax is not
> particularly hard,
I do agree, I was attempting to point out the non-trivial mental cost of
switching back and forth between languages' and keeping their
idiosyncrasies straight. This is important when you consider Scala
advocacy -- familiar syntax helps newbies.
For a real world example, look at PHP and its infuriating use of "." as
a string concatenation operator; pretty much every time I or anyone on
my team has to jump into PHP we screw up and write "+" a few times until
we hit a runtime error. Then we waste time going back and fixing all the
operators, and it does not leave us with a good impression of PHP.
If // were an extremely common operator I'd be much more in favor of
breaking consistency. But it doesn't sound like // is going to be the
next hot operator anytime soon. Honestly if you want to choose a better
comment character, I'd suggest considering # for consistency with
Python, Ruby, Shell scripts, etc. (Also I think on some keyboards with
larger Enter keys the \ character is moved around to various places.)
ARKBAN
On 4/26/12 5:06 PM, Alex Repain wrote:
> 2012/4/26, ARKBAN<
ark...@arkban.net>:
>> > I hate that // is the single line comment, probably, we all do.
>>
>> I, for one, am very happy that the single line comment is consistent
>> with other C-like languages. It is one less thing to learn when
>> switching languages, and one more less hurdle for new Scala developers.
>>
> Although you will agree that learning the line comment syntax is not
> particularly hard, in Scala or in any other (practicable) language.
> This could have been an idea worth discussing ... years ago, when the
> language was fresh and would possibly evolve abruptly in its core
> syntax. Now it's just how it is. If you definitely want to use //, try
> escaping it with backquotes :
>
> scala> def `//`(i: Int) = 2 * i
>
> $div$div: (i: Int)Int
>
> scala> $div$div(3)
>
> res0: Int = 6
>
> scala> `//`(3)
>
> res1: Int = 6
>
>> ARKBAN
>>
>> On 4/26/12 2:25 PM, Daniel Sobral wrote:
>>> I'd be annoyed if // was not single line comment.
>>>
>>> On Thu, Apr 26, 2012 at 14:56, Rodrigo Cano<
ioni...@gmail.com> wrote:
>>>> Hi there,
>>>>
>>>> Here is the issue (and I know all the reasons for it to be like it is,
>>>> and
>>>> that I'm probably be discarded right away, anyway I wanted to share :-)
>>>> ), I
>>>> hate that // is the single line comment, probably, we all do. Any
>>>> respectable path uses / as separator, unix paths, xpath, urls, sed,
>>>> anything. If I would write a path-like thing now, I would use / as
>>>> separator. The thing is that the // is almost always assigned a meaning
>>>> too,
>>>> but we are restricted in scala from having it as an operator.
>>>> In order to propose something with meaning that could potentially justify
>>>> making such big change, it occurred to me that I have to suggest
>>>> something
>>>> that gives more punctuation freedom, and I came to think of one
>>>> punctuation
>>>> symbol which we already cannot use, and that in fact, we never use
>>>> (because
>>>> it's bad taste :-P), the `;`, practically we never use it, so nobody
>>>> would
>>>> mind if `;;` would be the single line comment, after all, it even makes
>>>> no
>>>> sense (that it occurs to me now) to write ;; in scala. I can't think of a
>>>> case were I would like to write an empty statement like that.
>>>>
>>>> With such change, we really gain in syntax freedom I think. What are your
>>>> opinions?.
>>>>
>>>> Cheers.
>>>
>