[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

T. Onoma

11/12/2004 8:41:00 PM


The argument that #init should be available to end users like #id is very weak
b/c 'id' is very common, especially in DB work (where it is essentially
required). I have never had a need for my own #init, nor seen any other code
that required such --i.e. made things troubling for the lack of it.

The main point as to why #init is much better, is simply to do with saving
time. Add up all the time you save typing those extra 6 characters. Lets say
it takes you 1/2 second to type (give or take depending on how fast you
type). In a year I would guess that I type 'initialize' multiple thousands of
times, as I'm sure many Rubyists do. Well, for every 1200, that's nearly an
hour of my life. Between a 100 Rubyists, that's 100 man hours wasted! Worse
is when I've accidently mistyped it, which always happens somewhere in those
last six characters. I mistype it maybe 1-2% of the time (I've gotton better
at it over time). For each of those I waste a minute or two finding and
fixing the typo. There goes another hour of my life (and many more total man
hours for our Rubyists).

'initialize' is easily in the top 5 most typed ruby words, like 'def', 'if'
and 'class'. Such words really ought to be short for this simple reason.

T.

P.S. Not to mention all the time spent by people thinking the above and then
spending time to tell other people about it ;)


4 Answers

Stu

11/12/2004 8:46:00 PM

0

On Sat, 13 Nov 2004 05:41:22 +0900, "trans. (T. Onoma)"
<transami@runbox.com> wrote:

>The main point as to why #init is much better, is simply to do with saving
>time.
>'initialize' is easily in the top 5 most typed ruby words, like 'def', 'if'
>and 'class'. Such words really ought to be short for this simple reason.
>

ive spent the last 30 years of my life typing initialise. the ise/lise
pattern is ingrained into my fingers. it is SO hard to put the Z in.
it goes against everything I have ever been taught in school.

if we have def instead of define, why cant we have init eh?? :)

or at least alias initialise to initialize.


-- Stu --
[FAQ] Write Your Own Operating System
http://www.mega-tokyo....
3x3 Eyes Fanfiction Archive
http://www.mega-tok...

Ivan Vodopiviz

11/12/2004 8:53:00 PM

0

>ive spent the last 30 years of my life typing initialise. the ise/lise
>pattern is ingrained into my fingers. it is SO hard to put the Z in.
>it goes against everything I have ever been taught in school.
>
>if we have def instead of define, why cant we have init eh?? :)
>
>or at least alias initialise to initialize.
>
hi,
i don't know how's your keyboard, but in QWERTY, the S is really next
to the Z... not a big difference between initialize / initialise

but, #init would be great!

cya

--
BlueSteel | | Merkoth


James Gray

11/12/2004 9:01:00 PM

0

On Nov 12, 2004, at 2:48 PM, Stu wrote:

> ive spent the last 30 years of my life typing initialise. the ise/lise
> pattern is ingrained into my fingers. it is SO hard to put the Z in.
> it goes against everything I have ever been taught in school.

But Ruby is a different language with different rules. Things like
def, elsif and __FILE__ probably aren't part of many native tongues,
eh?

James Edward Gray II



gabriele renzi

11/13/2004 12:54:00 AM

0

trans. (T. Onoma) ha scritto:
> The argument that #init should be available to end users like #id is very weak
> b/c 'id' is very common, especially in DB work (where it is essentially
> required). I have never had a need for my own #init, nor seen any other code
> that required such --i.e. made things troubling for the lack of it.

I may recall wrongly but ruby/SDL has it, ruby/GTK (ruby-gnome2), Fox
and qtruby too. And maybe the oracle driver. It seem that some kind of
libraries (i.e. those written in c/c++ with an OO mind) make some use of
it. I guess some more may have it.


> The main point as to why #init is much better, is simply to do with saving
> time. Add up all the time you save typing those extra 6 characters.

don't get me wrong, I'd like to save keystrokes, and actually I'd have
loved if matz designed #initialize as something shorter since the
beginning, but now I guess it breaks too much stuff.