Page 1 of 1
Things That Make You Go "Hmmm..."
Posted: Thu Mar 31, 2016 4:22 pm
by S1User
One of those random things that make you wonder why it is...
I wonder why Ruby uses a modified key character for comments? (#) It's obvious switching between multiple languages, Ruby, Lua, VB, the relative annoyance of having to use the CTL mod to get to it.
LUA: --
VB: '
Ruby: CTL+3 (#)
Was it maybe the case that when they created Ruby the # key was a standard exposed key or something?
Re: Things That Make You Go "Hmmm..."
Posted: Thu Mar 31, 2016 7:23 pm
by tulamide
Indeed, you made me go "hmmm..."
Are you aware that there is a great number of keyboard layouts? You will never find that one 'comment instruction sign' valid for all of them. US has '#' at shift+'3', vietnamese on Alt Gr + '3', canadian french on the key left to '1', italian on Alt Gr + the key far right in the third row, german on that very same key but without Alt Gr, etc.
I would experience the same as you but in VB, because that '-sign is a combination on my keyboard.
Btw, you can also comment like so in Ruby:
Code: Select all
=begin
I am a fantastic comment
(...write as many lines as you wish...)
=end
Re: Things That Make You Go "Hmmm..."
Posted: Thu Mar 31, 2016 11:04 pm
by martinvicanek
Code: Select all
=begin
that's about the least intuitive multiline comment coding I know
=end
<!--
but wait, HTML is equally bad
-->
/*
I really like C style
*/
Re: Things That Make You Go "Hmmm..."
Posted: Fri Apr 01, 2016 12:30 am
by Perfect Human Interface
martinvicanek wrote:Code: Select all
<!--
but wait, HTML is equally bad
-->
The worst ever!
Re: Things That Make You Go "Hmmm..."
Posted: Fri Apr 01, 2016 3:36 am
by tulamide
martinvicanek wrote:/*
I really like C style
*/
[/code]
Not that I like it much, but at least it's been there for ages. Why don't just all agree on one kind of commenting like C. At least Javascript, PHP and Arduino (but maybe more) use the same syntax // and /* */
And older ones will certainly know where this comes from:
Code: Select all
REM No multiline comment support
REM but we used to comment as little as possible xD
Re: Things That Make You Go "Hmmm..."
Posted: Fri Apr 01, 2016 5:46 am
by RJHollins
Commodore ?
Re: Things That Make You Go "Hmmm..."
Posted: Fri Apr 01, 2016 2:10 pm
by Spogg
RJHollins wrote:Commodore ?
Certainly Sinclair Basic!
Re: Things That Make You Go "Hmmm..."
Posted: Fri Apr 01, 2016 4:03 pm
by S1User
Yeah. I kinda hate code editors that don't have shortcuts for things like that, where you can't just select a block of code and hit CTL+Whatever to comment out a block 'o code.