Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Switch to .ruby extension?

Reply
Thread Tools

Switch to .ruby extension?

 
 
Karl von Laudermann
Guest
Posts: n/a
 
      06-11-2004
The current convention for Ruby source file names is to end them with
a .rb extension. This strikes me as too minimalistic. Why not .ruby?

File extensions of more than three characters are very commonplace,
now that Windows supports them. HTML files generally have a .html
extension; you very rarely see .htm anymore. And Java source and
object files have .java and .class extensions, respectively. "ruby" is
only two more letters than "rb", but I think it's clearer and more
aesthetically pleasing.

So, I propose a change in the convention from .rb to .ruby. Now, I'm
not suggesting that everyone change all of their existing scripts and
libraries, or even the files in the Ruby distribution. That would be
excessive for such a small thing. But, for example, the Windows
installer could associate both .rb and .ruby files with ruby.exe, and
we could start using .ruby in new projects.

Yes it's a silly little thing. But ever since Y2K, I've been wary of
excessive abbreviation. Besides, it's the attention to the little
things that makes Ruby so appealing.
 
Reply With Quote
 
 
 
 
Neil Stevens
Guest
Posts: n/a
 
      06-11-2004
Karl von Laudermann wrote:

> ... we could start using .ruby in new projects.


What stops you from doing so now?

You're sure never going to get me to start mangling my script names that
way. I leave script names unadorned, in case I ever wish to change the
implementation. This already paid off with shell scripts that I moved to
ruby.

--
Neil Stevens - neil @hakubi.us
"The world is a dangerous place to live; not because of the people who
are evil, but because of the people who don't do anything about it."
-- Albert Einstein(?)

 
Reply With Quote
 
 
 
 
Mark Hubbart
Guest
Posts: n/a
 
      06-11-2004

On Jun 11, 2004, at 10:23 AM, Neil Stevens wrote:

> Karl von Laudermann wrote:
>
>> ... we could start using .ruby in new projects.

>
> What stops you from doing so now?


Well, it's not just a convention. it's built-in. Try requiring 'foo'
when the file is named foo.rb.

FWIW, I see no reason not to support this, as long as it's an alternate
extension. Having a file named foo.ruby is at least as easy to
recognize as foo.rb.

> You're sure never going to get me to start mangling my script names
> that
> way. I leave script names unadorned, in case I ever wish to change the
> implementation. This already paid off with shell scripts that I moved
> to
> ruby.


Same here But I think OP was talking about libraries/included code.

> --
> Neil Stevens - neil @hakubi.us
> "The world is a dangerous place to live; not because of the people who
> are evil, but because of the people who don't do anything about it."
> -- Albert Einstein(?)


"I should have been a plumber." -- Albert Einstein



 
Reply With Quote
 
Neil Stevens
Guest
Posts: n/a
 
      06-11-2004
Mark Hubbart wrote:

>
> On Jun 11, 2004, at 10:23 AM, Neil Stevens wrote:
>
>> Karl von Laudermann wrote:
>>
>>> ... we could start using .ruby in new projects.

>>
>> What stops you from doing so now?

>
> Well, it's not just a convention. it's built-in. Try requiring 'foo'
> when the file is named foo.rb.
>
> FWIW, I see no reason not to support this, as long as it's an alternate
> extension. Having a file named foo.ruby is at least as easy to
> recognize as foo.rb.


Sure, I'm concerned about scripts, not libraries, though.

>> You're sure never going to get me to start mangling my script names
>> that
>> way. I leave script names unadorned, in case I ever wish to change the
>> implementation. This already paid off with shell scripts that I moved
>> to
>> ruby.

>
> Same here But I think OP was talking about libraries/included code.


Well, he did say scripts and libraries. I don't see what the names matter
for libraries, though. Only the scripts are user-visible.

--
Neil Stevens - neil @hakubi.us
"The world is a dangerous place to live; not because of the people who
are evil, but because of the people who don't do anything about it."
-- Albert Einstein(?)

 
Reply With Quote
 
Tyler Zesiger
Guest
Posts: n/a
 
      06-11-2004
The obsessive levels of abbreviation in the *nix world infuriate me.
Especially when it's so easy to make verbose and abbreviated commands
exist together, and do the same thing.

I remember when I first started using linux (now I use FreeBSD, which is
no better in this regard), I spent an hour trying to figure out how to
copy a file..."copy" didn't work. Searching the internet for info on
"copying" didn't turn up anything, probably because Google wasn't what
it is now, back then. I had to finally get on IRC and ask someone how to
copy - Turns out it's "cp". It will take me a decade of typing "cp",
with it's two fewer letters than "copy", to earn back the hour it took
me to figure out the command in the first place.

When I mention to *nix people how easy it would be to make "copy" work
simultaneously along with "cp" for the sake of user-friendliness, I'm
met with scorn and rage, and cat-calls saying "go back to windows". It
seems that most *nix people have no interest in other people, even to
the small extent of making things accessible for newcomers to their
favorite tools. That's what I call an antisocial failure to communicate.

Ruby ought to have a either a .ruby extension, or no extension at all,
as someone else mentioned in this thread. I'm sure lots of anti-social
types find their meaning in life by insulting the intelligence of people
who can't figure out what ".rb" means, but I'm not one of them. I
wholeheartedly agree with you, that abbreviations are ancient relics of
an elitist and anti-social past, and they should be buried with the
creaky old coots that invented them.


Karl von Laudermann wrote:

> The current convention for Ruby source file names is to end them with
> a .rb extension. This strikes me as too minimalistic. Why not .ruby?
>
> File extensions of more than three characters are very commonplace,
> now that Windows supports them. HTML files generally have a .html
> extension; you very rarely see .htm anymore. And Java source and
> object files have .java and .class extensions, respectively. "ruby" is
> only two more letters than "rb", but I think it's clearer and more
> aesthetically pleasing.
>
> So, I propose a change in the convention from .rb to .ruby. Now, I'm
> not suggesting that everyone change all of their existing scripts and
> libraries, or even the files in the Ruby distribution. That would be
> excessive for such a small thing. But, for example, the Windows
> installer could associate both .rb and .ruby files with ruby.exe, and
> we could start using .ruby in new projects.
>
> Yes it's a silly little thing. But ever since Y2K, I've been wary of
> excessive abbreviation. Besides, it's the attention to the little
> things that makes Ruby so appealing.
>
>
>




 
Reply With Quote
 
Lothar Scholz
Guest
Posts: n/a
 
      06-11-2004
Hello Neil,

NS> Karl von Laudermann wrote:

>> ... we could start using .ruby in new projects.


NS> What stops you from doing so now?

Some braindead lines in the ruby interpreter. You can't even "require" rbw files
without patching the hardcoded extensions names in eval.c

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's




 
Reply With Quote
 
Hal Fulton
Guest
Posts: n/a
 
      06-11-2004
Tyler Zesiger wrote:
> The obsessive levels of abbreviation in the *nix world infuriate me.
> Especially when it's so easy to make verbose and abbreviated commands
> exist together, and do the same thing.
>
> I remember when I first started using linux (now I use FreeBSD, which is
> no better in this regard), I spent an hour trying to figure out how to
> copy a file..."copy" didn't work. Searching the internet for info on
> "copying" didn't turn up anything, probably because Google wasn't what
> it is now, back then. I had to finally get on IRC and ask someone how to
> copy - Turns out it's "cp". It will take me a decade of typing "cp",
> with it's two fewer letters than "copy", to earn back the hour it took
> me to figure out the command in the first place.


True. But the best thing would have been to read a tutorial of some
kind. It would have taken an hour, and you might have saved many hours
that you now will not get back.

> When I mention to *nix people how easy it would be to make "copy" work
> simultaneously along with "cp" for the sake of user-friendliness, I'm
> met with scorn and rage, and cat-calls saying "go back to windows". It
> seems that most *nix people have no interest in other people, even to
> the small extent of making things accessible for newcomers to their
> favorite tools. That's what I call an antisocial failure to communicate.


Heh heh, no scorn and rage here.

Ordinarily this would be easy in Unix -- you'd make a link from cp to
copy. But it doesn't work here (unless I'm behind the times) for an
interesting reason. Such programs as cp. mv, and ln are traditionally
actually links to the *same* program on disk. Their different behavior
is explained by the fact that this program checks argv to see what name
it was invoked with, in order to know how to behave.

Believe me, this made a lot more sense in 1972 than it does today.

Of course, most shells have an "alias" feature; you can do something
like alias copy=cp or the like.

Failing that, you could always make your own script "copy" that simply
said cp $* or whatever.

> Ruby ought to have a either a .ruby extension, or no extension at all,
> as someone else mentioned in this thread. I'm sure lots of anti-social
> types find their meaning in life by insulting the intelligence of people
> who can't figure out what ".rb" means, but I'm not one of them. I
> wholeheartedly agree with you, that abbreviations are ancient relics of
> an elitist and anti-social past, and they should be buried with the
> creaky old coots that invented them.


LOL!

There are many things in society, not just in computing, where this is
true.


Hal Fulton,
Creaky Old Coot




 
Reply With Quote
 
James Britt
Guest
Posts: n/a
 
      06-11-2004
Karl von Laudermann wrote:

> The current convention for Ruby source file names is to end them with
> a .rb extension. This strikes me as too minimalistic. Why not .ruby?
>
> File extensions of more than three characters are very commonplace,
> now that Windows supports them. HTML files generally have a .html
> extension; you very rarely see .htm anymore. And Java source and
> object files have .java and .class extensions, respectively. "ruby" is
> only two more letters than "rb", but I think it's clearer and more
> aesthetically pleasing.
>
> So, I propose a change in the convention from .rb to .ruby. Now, I'm
> not suggesting that everyone change all of their existing scripts and
> libraries, or even the files in the Ruby distribution. That would be
> excessive for such a small thing. But, for example, the Windows
> installer could associate both .rb and .ruby files with ruby.exe, and
> we could start using .ruby in new projects.


The package installer for Blogtari uses the .ruby extension.

This came out of necessity; I moved from distributing the app as a
tarball to deploying a self-extracting Ruby script that prompts the user
for configuration details, writes out (or updates) the config file, and
installs the program. But whereas serving up *.tgz worked fine, serving
up *.rb from the web server caused it to execute on the server .

While there are any number of workarounds for this, I opted to use the
ruby extension and tell Apache to serve it as a particular MIME type so
that browsers would prompt the user to save it to disk.


Jamess



 
Reply With Quote
 
Gennady
Guest
Posts: n/a
 
      06-11-2004
Tyler Zesiger wrote:
> The obsessive levels of abbreviation in the *nix world infuriate me.
> Especially when it's so easy to make verbose and abbreviated commands
> exist together, and do the same thing.
>
> I remember when I first started using linux (now I use FreeBSD, which is
> no better in this regard), I spent an hour trying to figure out how to
> copy a file..."copy" didn't work. Searching the internet for info on
> "copying" didn't turn up anything, probably because Google wasn't what
> it is now, back then. I had to finally get on IRC and ask someone how to
> copy - Turns out it's "cp". It will take me a decade of typing "cp",
> with it's two fewer letters than "copy", to earn back the hour it took
> me to figure out the command in the first place.
>
> When I mention to *nix people how easy it would be to make "copy" work
> simultaneously along with "cp" for the sake of user-friendliness, I'm
> met with scorn and rage, and cat-calls saying "go back to windows". It


Go back to windows

More seriously, In Unix you spend almost all your time at the command
prompt, so it would "infuriate" me if I had to type at least twice as
much all the day if commands were called as you suggest. As for
newcomers, short command names is the least problem they would encounter
if they switch from Windows (for completely fresh people it does not
matter what command set to learn anyway).

On the other hand, you have a lot of means to alias any command in any
Unix shell.

> seems that most *nix people have no interest in other people, even to
> the small extent of making things accessible for newcomers to their
> favorite tools. That's what I call an antisocial failure to communicate.
>
> Ruby ought to have a either a .ruby extension, or no extension at all,
> as someone else mentioned in this thread. I'm sure lots of anti-social
> types find their meaning in life by insulting the intelligence of people
> who can't figure out what ".rb" means, but I'm not one of them. I
> wholeheartedly agree with you, that abbreviations are ancient relics of
> an elitist and anti-social past, and they should be buried with the
> creaky old coots that invented them.
>
>
> Karl von Laudermann wrote:
>
>> The current convention for Ruby source file names is to end them with
>> a .rb extension. This strikes me as too minimalistic. Why not .ruby?
>>
>> File extensions of more than three characters are very commonplace,
>> now that Windows supports them. HTML files generally have a .html
>> extension; you very rarely see .htm anymore. And Java source and
>> object files have .java and .class extensions, respectively. "ruby" is
>> only two more letters than "rb", but I think it's clearer and more
>> aesthetically pleasing.
>>
>> So, I propose a change in the convention from .rb to .ruby. Now, I'm
>> not suggesting that everyone change all of their existing scripts and
>> libraries, or even the files in the Ruby distribution. That would be
>> excessive for such a small thing. But, for example, the Windows
>> installer could associate both .rb and .ruby files with ruby.exe, and
>> we could start using .ruby in new projects.
>>
>> Yes it's a silly little thing. But ever since Y2K, I've been wary of
>> excessive abbreviation. Besides, it's the attention to the little
>> things that makes Ruby so appealing.
>>
>>
>>

>
>




 
Reply With Quote
 
Mark Hubbart
Guest
Posts: n/a
 
      06-11-2004

On Jun 11, 2004, at 10:55 AM, Tyler Zesiger wrote:

> I remember when I first started using linux (now I use FreeBSD, which
> is no better in this regard), I spent an hour trying to figure out how
> to copy a file..."copy" didn't work. Searching the internet for info
> on "copying" didn't turn up anything, probably because Google wasn't
> what it is now, back then. I had to finally get on IRC and ask someone
> how to copy - Turns out it's "cp". It will take me a decade of typing
> "cp", with it's two fewer letters than "copy", to earn back the hour
> it took me to figure out the command in the first place.


heh I had a similar experience, coming from a Mac, with no command
line, to a Mac running OS X, with a full fledged UNIX interface, when
you want it... it was all very frustrating until a friend pointed me in
the direction of the 'apropos' tool. After that, it was mostly smooth
sailing.

I don't think that there should be extra commands littering up the one
monolithic namespace of shell commands. A simple 'help' tool, which
relays a few ways of finding various commands, should, IMHO, be
included. A few tips about apropos, man, and a short note about how
command line arguments work. That would be enough, I think, to get a
determined person up and running.

cheers,
Mark



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
trunking between Cisco Catalyst 500 switch and other type of switch jshubo@yahoo.com Cisco 3 01-19-2008 12:10 AM
Switch/Switch problem fibre gigbit ethernet hartmut.albers@gmail.com Cisco 2 09-06-2005 04:59 PM
Is a frame switch and an ISDN switch really needed? owmanstubbedmytoe Cisco 2 12-05-2004 07:15 AM
bridge / layer 2 switch / layer 3 switch Joel M. Baldwin Cisco 2 11-06-2003 11:19 PM
difference b/w layer 2 switch and layer 3 switch praveen Cisco 1 10-22-2003 07:19 AM



Advertisments